Documentation ¶
Overview ¶
* * @Author: xhzhang * @Date: 2019-06-11 14:21
Index ¶
- type AfisRegister
- type AfisServiceRegister
- func (asr *AfisServiceRegister) Get(key string, isprefix bool) (map[string]string, error)
- func (asr *AfisServiceRegister) GetWithPrefix(prefix string) ([]string, error)
- func (asr *AfisServiceRegister) NewAfisServiceRegister(endpoint []string, dialtimeout time.Duration) (*AfisServiceRegister, error)
- func (asr *AfisServiceRegister) Put(key, value string) error
- type AgentFunc
- type BaseClient
- func (c *BaseClient) Del(info string, isprefix bool) error
- func (c *BaseClient) Get(key string, isprefix bool) (map[string]string, error)
- func (bc *BaseClient) GetAgents(dealfunc DealFunc) (map[string]string, error)
- func (bc *BaseClient) GetServices(dealfunc DealFunc) (map[string]string, error)
- func (c *BaseClient) Put(key, value string) error
- type ClientDis
- type DealFunc
- type ServiceRegister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AfisRegister ¶
type AfisRegister struct { BClient BaseClient Lease clientv3.Lease LeaseResp *clientv3.LeaseGrantResponse // contains filtered or unexported fields }
func NewAfisRegister ¶
func NewAfisRegister(bc BaseClient) (*AfisRegister, error)
func (*AfisRegister) ListenLeaseRespChan ¶
func (ar *AfisRegister) ListenLeaseRespChan()
type AfisServiceRegister ¶
func (*AfisServiceRegister) Get ¶
如果isprefix是true,则根据前缀获取val值,反之isprefix是false,则根据key值获取val值 返回返回map[key]val,error
func (*AfisServiceRegister) GetWithPrefix ¶
func (asr *AfisServiceRegister) GetWithPrefix(prefix string) ([]string, error)
func (*AfisServiceRegister) NewAfisServiceRegister ¶
func (asr *AfisServiceRegister) NewAfisServiceRegister(endpoint []string, dialtimeout time.Duration) (*AfisServiceRegister, error)
func (*AfisServiceRegister) Put ¶
func (asr *AfisServiceRegister) Put(key, value string) error
type BaseClient ¶
type BaseClient struct {
// contains filtered or unexported fields
}
func NewBaseClient ¶
func NewBaseClient(endpoint []string, dialtimeout time.Duration) (*BaseClient, error)
func (*BaseClient) Get ¶
如果isprefix是true,则根据前缀获取val值,反之isprefix是false,则根据key值获取val值 返回返回map[key]val,error
func (*BaseClient) GetAgents ¶
func (bc *BaseClient) GetAgents(dealfunc DealFunc) (map[string]string, error)
func (*BaseClient) GetServices ¶
func (bc *BaseClient) GetServices(dealfunc DealFunc) (map[string]string, error)
func (*BaseClient) Put ¶
func (c *BaseClient) Put(key, value string) error
type ClientDis ¶
type ClientDis struct {
// contains filtered or unexported fields
}
func NewClientDis ¶
func (*ClientDis) DelServiceList ¶
func (*ClientDis) SetServiceList ¶
type ServiceRegister ¶
type ServiceRegister struct { Client *clientv3.Client Lease clientv3.Lease LeaseResp *clientv3.LeaseGrantResponse // contains filtered or unexported fields }
func NewServiceRegister ¶
func NewServiceRegister(endpoint []string, dialtimeout time.Duration) (*ServiceRegister, error)
func (*ServiceRegister) ListenLeaseRespChan ¶
func (sr *ServiceRegister) ListenLeaseRespChan()
func (*ServiceRegister) PutService ¶
func (sr *ServiceRegister) PutService(key, val string) error
注册服务
Click to show internal directories.
Click to hide internal directories.