func NewDiscovery(conf SDConfig, logger log.Logger) (*Discovery, error) {
	rt, err := config_util.NewRoundTripperFromConfig(conf.HTTPClientConfig, "marathon_sd")
	if err != nil {
		return nil, err
	}

	if len(conf.AuthToken) > 0 {
		rt, err = newAuthTokenRoundTripper(conf.AuthToken, rt)
	} else if len(conf.AuthTokenFile) > 0 {
		rt, err = newAuthTokenFileRoundTripper(conf.AuthTokenFile, rt)
	}
	if err != nil {
		return nil, err
	}

	d := &Discovery{
		client:     &http.Client{Transport: rt},
		servers:    conf.Servers,
		appsClient: fetchApps,
	}
	d.Discovery = refresh.NewDiscovery(
		logger,
		"marathon",
		time.Duration(conf.RefreshInterval),
		d.refresh,
	)
	return d, nil
}
func NewDiscovery(conf SDConfig, logger log.Logger) (*Discovery, error) {
	rt, err := config_util.NewRoundTripperFromConfig(conf.HTTPClientConfig, "marathon_sd")
	if err != nil {
		return nil, err
	}

	if len(conf.AuthToken) > 0 {
		rt, err = newAuthTokenRoundTripper(conf.AuthToken, rt)
	} else if len(conf.AuthTokenFile) > 0 {
		rt, err = newAuthTokenFileRoundTripper(conf.AuthTokenFile, rt)
	}
	if err != nil {
		return nil, err
	}

	d := &Discovery{
		client:     &http.Client{Transport: rt},
		servers:    conf.Servers,
		appsClient: fetchApps,
	}
	d.Discovery = refresh.NewDiscovery(
		logger,
		"marathon",
		time.Duration(conf.RefreshInterval),
		d.refresh,
	)
	return d, nil
}
func NewDiscovery ( conf SDConfig , logger log . Logger ) ( * Discovery , error ) { rt , err := config_util . NewRoundTripperFromConfig ( conf . HTTPClientConfig , " " ) if err != nil { return nil , err } if len ( conf . AuthToken ) > 0 { rt , err = newAuthTokenRoundTripper ( conf . AuthToken , rt ) } else if len ( conf . AuthTokenFile ) > 0 { rt , err = newAuthTokenFileRoundTripper ( conf . AuthTokenFile , rt ) } if err != nil { return nil , err } d := & Discovery { client : & http . Client { Transport : rt } , servers : conf . Servers , appsClient : fetchApps , } d . Discovery = refresh . NewDiscovery ( logger , " " , time . Duration ( conf . RefreshInterval ) , d . refresh , ) return d , nil }
// NewDiscovery returns a new Marathon Discovery.
NewDiscovery returns a new Marathon Discovery .