diff --git a/consul/discovery.go b/consul/discovery.go index 64767c8..29a9e02 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -19,8 +19,8 @@ type Service struct { port int ttl time.Duration agent *consul.Agent + connect *consul.Connect kv *consul.KV - catalog *consul.Catalog } var ErrServiceUnavailable = fmt.Errorf("Service is unavailable") @@ -40,8 +40,8 @@ func NewService(servAddr, id, name, hostname, domain, pathPrefix string, appPort return nil, err } s.agent = client.Agent() + s.connect = client.Connect() s.kv = client.KV() - s.catalog = client.Catalog() return s, nil } @@ -103,12 +103,12 @@ func (s *Service) Unregister() error { return s.agent.ServiceDeregister(s.GetID()) } -func (s *Service) KV() *consul.KV { - return s.kv +func (s *Service) Connect() *consul.Connect { + return s.connect } -func (s *Service) Catalog() *consul.Catalog { - return s.catalog +func (s *Service) KV() *consul.KV { + return s.kv } func (s *Service) healthCheck() (bool, error) {