Consul refactor
This commit is contained in:
parent
2375c2a23a
commit
566cbbd31b
@ -21,7 +21,7 @@ type Service struct {
|
||||
ttl time.Duration
|
||||
client *consul.Client
|
||||
agent *consul.Agent
|
||||
connect *consul.Connect
|
||||
connect *connect.Service
|
||||
kv *consul.KV
|
||||
}
|
||||
|
||||
@ -107,7 +107,10 @@ func (s *Service) Unregister() error {
|
||||
}
|
||||
|
||||
func (s *Service) Connect() (*connect.Service, error) {
|
||||
return connect.NewService(s.Name, s.client)
|
||||
svc, err := connect.NewService(s.Name, s.client)
|
||||
s.connect = svc
|
||||
|
||||
return svc, err
|
||||
}
|
||||
|
||||
func (s *Service) KV() *consul.KV {
|
||||
|
Loading…
Reference in New Issue
Block a user