Documentation ¶
Index ¶
- type Client
- type ConsulClient
- func (c *ConsulClient) DeRegister(id string) error
- func (c *ConsulClient) PeriodicRegister(id, name, host string, port int, path, health string, seconds int) error
- func (c *ConsulClient) Register(id, name, host string, port int, path, health string) error
- func (c *ConsulClient) Service(service, tag string) ([]*consul.ServiceEntry, *consul.QueryMeta, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Get a Service from consul Service(string, string) ([]string, error) // Register a service with local agent Register(string, int) error // Deregister a service with local agent DeRegister(string) error }
Client provides an interface for getting data out of Consul
type ConsulClient ¶
func NewConsulClient ¶
func NewConsulClient(addr string) (*ConsulClient, error)
NewConsul returns a Client interface for given consul address
func (*ConsulClient) DeRegister ¶
func (c *ConsulClient) DeRegister(id string) error
DeRegister a service with consul local agent
func (*ConsulClient) PeriodicRegister ¶
func (c *ConsulClient) PeriodicRegister(id, name, host string, port int, path, health string, seconds int) error
Register a service with consul local agent periodically
func (*ConsulClient) Register ¶
func (c *ConsulClient) Register(id, name, host string, port int, path, health string) error
Register a service with consul local agent
func (*ConsulClient) Service ¶
func (c *ConsulClient) Service(service, tag string) ([]*consul.ServiceEntry, *consul.QueryMeta, error)
Service return a service
Click to show internal directories.
Click to hide internal directories.