Documentation ¶
Overview ¶
* 集成consul组件,包含实例化consul客户端,服务发现,服务注册,服务注销,负载均衡等方法
Index ¶
- func DefaultConfig() *consulapi.Config
- func NewServiceCheck() *consulapi.AgentServiceCheck
- func NewServiceRegistration() *consulapi.AgentServiceRegistration
- type Client
- func (client *Client) DeRegister(name string) error
- func (client *Client) Discover(name string) ([]Service, error)
- func (client *Client) Init() (err error)
- func (client *Client) LoadBalance(serviceItems []Service) (*Service, error)
- func (client *Client) Register(registration *consulapi.AgentServiceRegistration) error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServiceRegistration ¶
func NewServiceRegistration() *consulapi.AgentServiceRegistration
NewServiceRegistration 实例化服务注册项
Types ¶
Click to show internal directories.
Click to hide internal directories.