src/client/client.go
func NewCachedLoader(namespace string, consulAddr string) (config.Loader, error) {
	config := api.DefaultConfig()
	config.Address = consulAddr
	consul, err := api.NewClient(config)
	if err != nil {
		return nil, fmt.Errorf("Could not connect to consul: %v", err)
	}

	return &cachedLoader{namespace: namespace, consulKV: consul.KV()}, nil
}
func NewCachedLoader(namespace string, consulAddr string) (config.Loader, error) {
	config := api.DefaultConfig()
	config.Address = consulAddr
	consul, err := api.NewClient(config)
	if err != nil {
		return nil, fmt.Errorf("Could not connect to consul: %v", err)
	}

	return &cachedLoader{namespace: namespace, consulKV: consul.KV()}, nil
}
func NewCachedLoader ( namespace string , consulAddr string ) ( config . Loader , error ) { config := api . DefaultConfig ( ) config . Address = consulAddr consul , err := api . NewClient ( config ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return & cachedLoader { namespace : namespace , consulKV : consul . KV ( ) } , nil }
// NewCachedLoader creates a Loader that will cache the provided namespace on initialization
// and return data from that cache on Get
NewCachedLoader creates a Loader that will cache the provided namespace on initialization and return data from that cache on Get