Documentation ¶
Index ¶
- func NewClient(dis ClientArg) (*client, error)
- type ClientArg
- type EtcdCli
- func (etcdCil *EtcdCli) Conn() (*EtcdCli, error)
- func (etcdCil *EtcdCli) Delete(key string) error
- func (etcdCil *EtcdCli) DeleteAll(key string) error
- func (etcdCil *EtcdCli) Get(key string) (*clientv3.GetResponse, error)
- func (etcdCil *EtcdCli) GetAllKey(key string) ([]string, error)
- func (etcdCil *EtcdCli) GetHash(key, h string)
- func (etcdCil *EtcdCli) GetMinKey(key string) (string, error)
- func (etcdCil *EtcdCli) GetMinKeyCallBack(key string) error
- func (etcdCil *EtcdCli) GetRandKey(key string) (string, error)
- func (etcdCil *EtcdCli) Register(key, value string) error
- func (etcdCil *EtcdCli) SetConnTimeOut(timeOut int) *EtcdCli
- func (etcdCil *EtcdCli) SetTTl(ttl int) *EtcdCli
- func (etcdCil *EtcdCli) UnRegister(key string) error
- type Server
- type ServerArg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientArg ¶
type ClientArg struct { ServiceAddr string EtcdAddr string ClientName string ServiceName string ReqFuncName string OpenLog bool }
DiscoveryArg 创建发现服务对象参数
type EtcdCli ¶
type EtcdCli struct { EtcdAddr []string // contains filtered or unexported fields }
func NewEtcdCli ¶
func (*EtcdCli) GetMinKeyCallBack ¶
GetMinKeyCallBack 与 EtcdCli.GetMinKey 配合使用客户端连接成功后调用
func (*EtcdCli) GetRandKey ¶
GetRandKey 模糊key查询随机反回一个key
func (*EtcdCli) SetConnTimeOut ¶
SetConnTimeOut 设置连接etcd的timeout
type Server ¶
type Server struct { Listener net.Listener Server *grpc.Server Port int // 端口 Name string // 服务昵称 EtcdAddr []string // contains filtered or unexported fields }
Server GRPC Server struct
func (*Server) OpenRegister ¶
func (*Server) SetEtcdAddr ¶
Click to show internal directories.
Click to hide internal directories.