|
|
|
@ -111,6 +111,7 @@ func init() {
|
|
|
|
|
// SDConfig is the configuration for Consul service discovery.
|
|
|
|
|
type SDConfig struct { |
|
|
|
|
Server string `yaml:"server,omitempty"` |
|
|
|
|
PathPrefix string `yaml:"path_prefix,omitempty"` |
|
|
|
|
Token config.Secret `yaml:"token,omitempty"` |
|
|
|
|
Datacenter string `yaml:"datacenter,omitempty"` |
|
|
|
|
Namespace string `yaml:"namespace,omitempty"` |
|
|
|
@ -211,6 +212,7 @@ func NewDiscovery(conf *SDConfig, logger log.Logger) (*Discovery, error) {
|
|
|
|
|
|
|
|
|
|
clientConf := &consul.Config{ |
|
|
|
|
Address: conf.Server, |
|
|
|
|
PathPrefix: conf.PathPrefix, |
|
|
|
|
Scheme: conf.Scheme, |
|
|
|
|
Datacenter: conf.Datacenter, |
|
|
|
|
Namespace: conf.Namespace, |
|
|
|
|