discovery/refresh/refresh.go
func NewDiscovery(l log.Logger, mech string, interval time.Duration, refreshf func(ctx context.Context) ([]*targetgroup.Group, error)) *Discovery {
	if l == nil {
		l = log.NewNopLogger()
	}
	return &Discovery{
		logger:   l,
		interval: interval,
		refreshf: refreshf,
		failures: failuresCount.WithLabelValues(mech),
		duration: duration.WithLabelValues(mech),
	}
}
func NewDiscovery(l log.Logger, mech string, interval time.Duration, refreshf func(ctx context.Context) ([]*targetgroup.Group, error)) *Discovery {
	if l == nil {
		l = log.NewNopLogger()
	}
	return &Discovery{
		logger:   l,
		interval: interval,
		refreshf: refreshf,
		failures: failuresCount.WithLabelValues(mech),
		duration: duration.WithLabelValues(mech),
	}
}
func NewDiscovery ( l log . Logger , mech string , interval time . Duration , refreshf func ( ctx context . Context ) ( [ ] * targetgroup . Group , error ) ) * Discovery { if l == nil { l = log . NewNopLogger ( ) } return & Discovery { logger : l , interval : interval , refreshf : refreshf , failures : failuresCount . WithLabelValues ( mech ) , duration : duration . WithLabelValues ( mech ) , } }
// NewDiscovery returns a Discoverer function that calls a refresh() function at every interval.
NewDiscovery returns a Discoverer function that calls a refresh () function at every interval .