discovery/triton/triton.go
func New(logger log.Logger, conf *SDConfig) (*Discovery, error) {
	tls, err := config_util.NewTLSConfig(&conf.TLSConfig)
	if err != nil {
		return nil, err
	}

	transport := &http.Transport{
		TLSClientConfig: tls,
		DialContext: conntrack.NewDialContextFunc(
			conntrack.DialWithTracing(),
			conntrack.DialWithName("triton_sd"),
		),
	}
	client := &http.Client{Transport: transport}

	d := &Discovery{
		client:   client,
		interval: time.Duration(conf.RefreshInterval),
		sdConfig: conf,
	}
	d.Discovery = refresh.NewDiscovery(
		logger,
		"triton",
		time.Duration(conf.RefreshInterval),
		d.refresh,
	)
	return d, nil
}
func New(logger log.Logger, conf *SDConfig) (*Discovery, error) {
	tls, err := config_util.NewTLSConfig(&conf.TLSConfig)
	if err != nil {
		return nil, err
	}

	transport := &http.Transport{
		TLSClientConfig: tls,
		DialContext: conntrack.NewDialContextFunc(
			conntrack.DialWithTracing(),
			conntrack.DialWithName("triton_sd"),
		),
	}
	client := &http.Client{Transport: transport}

	d := &Discovery{
		client:   client,
		interval: time.Duration(conf.RefreshInterval),
		sdConfig: conf,
	}
	d.Discovery = refresh.NewDiscovery(
		logger,
		"triton",
		time.Duration(conf.RefreshInterval),
		d.refresh,
	)
	return d, nil
}
func New ( logger log . Logger , conf * SDConfig ) ( * Discovery , error ) { tls , err := config_util . NewTLSConfig ( & conf . TLSConfig ) if err != nil { return nil , err } transport := & http . Transport { TLSClientConfig : tls , DialContext : conntrack . NewDialContextFunc ( conntrack . DialWithTracing ( ) , conntrack . DialWithName ( " " ) , ) , } client := & http . Client { Transport : transport } d := & Discovery { client : client , interval : time . Duration ( conf . RefreshInterval ) , sdConfig : conf , } d . Discovery = refresh . NewDiscovery ( logger , " " , time . Duration ( conf . RefreshInterval ) , d . refresh , ) return d , nil }
// New returns a new Discovery which periodically refreshes its targets.
New returns a new Discovery which periodically refreshes its targets .