github.com/chwjbn/xclash@v0.2.0/adapter/outboundgroup/common.go (about)

     1  package outboundgroup
     2  
     3  import (
     4  	"time"
     5  
     6  	C "github.com/chwjbn/xclash/constant"
     7  	"github.com/chwjbn/xclash/constant/provider"
     8  )
     9  
    10  const (
    11  	defaultGetProxiesDuration = time.Second * 5
    12  )
    13  
    14  func getProvidersProxies(providers []provider.ProxyProvider, touch bool) []C.Proxy {
    15  	proxies := []C.Proxy{}
    16  	for _, provider := range providers {
    17  		if touch {
    18  			proxies = append(proxies, provider.ProxiesWithTouch()...)
    19  		} else {
    20  			proxies = append(proxies, provider.Proxies()...)
    21  		}
    22  	}
    23  	return proxies
    24  }