Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsulClient ¶
type ConsulClient struct { ID string Name string ConsulAgent *consul.Agent ConsulHealth *consul.Health TTL time.Duration AgentReg *consul.AgentServiceRegistration }
func (*ConsulClient) DeRegister ¶
func (this *ConsulClient) DeRegister(string) error
func (*ConsulClient) GetService ¶
func (this *ConsulClient) GetService(service, tag string) ([]*ServiceEntry, error)
func (*ConsulClient) Register ¶
func (this *ConsulClient) Register(registration *ServiceRegistration) error
func (*ConsulClient) UpdateTTL ¶
func (this *ConsulClient) UpdateTTL(check func() (bool, error))
/////////////////// self function /////////////////////
type ServiceDiscoveryClient ¶
type ServiceDiscoveryClient interface { // Get a Service from consul GetService(string, string) ([]*ServiceEntry, error) // Register a service with local agent Register(*ServiceRegistration) error // Deregister a service with local agent DeRegister(string) error }
func NewConsulClient ¶
func NewConsulClient(addr string) (ServiceDiscoveryClient, error)
NewConsul returns a Client interface for given consul address
type ServiceEntry ¶
Click to show internal directories.
Click to hide internal directories.