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