mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-24 10:07:04 +02:00
Remove consul token helper method.
A Consul config struct can be passed using the `Config` helper making this helper redundant.
This commit is contained in:
parent
19be4ea2fd
commit
fabdd4a704
@ -14,12 +14,3 @@ func Config(c *consul.Config) registry.Option {
|
|||||||
o.Context = context.WithValue(o.Context, "consul_config", c)
|
o.Context = context.WithValue(o.Context, "consul_config", c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Token(t string) registry.Option {
|
|
||||||
return func(o *registry.Options) {
|
|
||||||
if o.Context == nil {
|
|
||||||
o.Context = context.Background()
|
|
||||||
}
|
|
||||||
o.Context = context.WithValue(o.Context, "consul_token", t)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -58,10 +58,6 @@ func newConsulRegistry(opts ...Option) Registry {
|
|||||||
if c, ok := options.Context.Value("consul_config").(*consul.Config); ok {
|
if c, ok := options.Context.Value("consul_config").(*consul.Config); ok {
|
||||||
config = c
|
config = c
|
||||||
}
|
}
|
||||||
|
|
||||||
if t, ok := options.Context.Value("consul_token").(string); ok {
|
|
||||||
config.Token = t
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// set timeout
|
// set timeout
|
||||||
|
Loading…
Reference in New Issue
Block a user