registry/consul: rename "RegisterTCPCheck" to "TCPCheck"
This commit is contained in:
parent
68ab671bd0
commit
1eb4398b6c
@ -18,13 +18,13 @@ func Config(c *consul.Config) registry.Option {
|
||||
}
|
||||
|
||||
//
|
||||
// RegisterTCPCheck will tell the service provider to check the service address
|
||||
// TCPCheck will tell the service provider to check the service address
|
||||
// and port every `t` interval. It will enabled only if `t` is greater than 0.
|
||||
// See `TCP + Interval` for more information [1].
|
||||
//
|
||||
// [1] https://www.consul.io/docs/agent/checks.html
|
||||
//
|
||||
func RegisterTCPCheck(t time.Duration) registry.Option {
|
||||
func TCPCheck(t time.Duration) registry.Option {
|
||||
return func(o *registry.Options) {
|
||||
if t <= time.Duration(0) {
|
||||
return
|
||||
@ -32,7 +32,6 @@ func RegisterTCPCheck(t time.Duration) registry.Option {
|
||||
if o.Context == nil {
|
||||
o.Context = context.Background()
|
||||
}
|
||||
o.Context = context.WithValue(o.Context,
|
||||
registry.ConsulRegisterTCPCheckKey, t)
|
||||
o.Context = context.WithValue(o.Context, "consul_register_tcp_check", t)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user