Documentation ¶
Index ¶
- type Client
- func (bc *Client) CheckDeregister(checkID string) error
- func (bc *Client) CheckFail(checkID, note string) error
- func (bc *Client) CheckPass(checkID, note string) error
- func (bc *Client) CheckRegister(serviceID, checkID string, ttl string) error
- func (bc *Client) GetOrCreateService(serviceID, serviceName string, tags []string, address string, port int) error
- func (bc *Client) ServiceDeregister(serviceID string) error
- type Instance
- func (i *Instance) CancelService() error
- func (i *Instance) CheckDeregister() error
- func (i *Instance) CheckPass() error
- func (i *Instance) CheckRegister() error
- func (i *Instance) DeregisterService() error
- func (i *Instance) GetOrCreateService() error
- func (i *Instance) KeepServiceAlive() error
- func (i *Instance) Wait()
- type InstanceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client client 封装了 consul 部分读写操作
func (*Client) CheckDeregister ¶
CheckDeregister 注销检查器
func (*Client) CheckRegister ¶
CheckRegister 注册检查器
func (*Client) GetOrCreateService ¶
func (*Client) ServiceDeregister ¶
ServiceDeregister 注销 service, name 既是 ID
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance 标识一个 Consul 连接实例
func NewConsulInstance ¶
func NewConsulInstance(ctx context.Context, opt InstanceOptions) (*Instance, error)
func (*Instance) CancelService ¶
func (*Instance) CheckDeregister ¶
func (*Instance) CheckRegister ¶
func (*Instance) DeregisterService ¶
func (*Instance) GetOrCreateService ¶
func (*Instance) KeepServiceAlive ¶
Click to show internal directories.
Click to hide internal directories.