Set consul token via registry options.
Optionally configure a token to use with the consul client.
This commit is contained in:
@@ -59,6 +59,10 @@ func newConsulRegistry(opts ...Option) Registry {
|
||||
if c != nil {
|
||||
config = c.(*consul.Config)
|
||||
}
|
||||
t := options.Context.Value("consul_token")
|
||||
if t != nil {
|
||||
config.Token = t.(string)
|
||||
}
|
||||
}
|
||||
|
||||
// set timeout
|
||||
|
||||
Reference in New Issue
Block a user