Documentation
¶
Index ¶
- func GetIp() (string, error)
- func GetLocalIP() (string, error)
- func ID() string
- func LocalIPv4s() ([]string, error)
- type Client
- 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 ¶
func LocalIPv4s ¶ added in v1.1.0
LocalIPv4s return all non-loop back IPv4 addresses
Types ¶
type Client ¶ added in v1.1.0
type Client struct {
// contains filtered or unexported fields
}
Client GRPC Client struct
type ClientArg ¶ added in v1.1.0
type ClientArg struct { ServerAddr string // 直连 *必填 EtcdAddr string // 使用发现服务 *必填 ClientName string ServiceName string // *必填 }
ClientArg GRPC Client arg struct
type EtcdCli ¶ added in v1.1.0
type EtcdCli struct { EtcdAddr []string // contains filtered or unexported fields }
EtcdCli etcd cli struct
func NewEtcdCli ¶ added in v1.1.0
NewEtcdCli new etcd cli
func (*EtcdCli) GetMinKeyCallBack ¶ added in v1.1.0
GetMinKeyCallBack 是GetMinKey方法的回调
func (*EtcdCli) GetRandKey ¶ added in v1.1.0
GetRandKey 使用前缀key查询随机反回一个
func (*EtcdCli) SetConnTimeOut ¶ added in v1.1.0
SetConnTimeOut set etcd conn timeout
func (*EtcdCli) UnRegister ¶ added in v1.1.0
UnRegister 解除注册
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 ¶ added in v1.1.0
OpenRegister set isRegister=true
func (*Server) SetEtcdAddr ¶ added in v1.1.0
SetEtcdAddr set etcd address
Click to show internal directories.
Click to hide internal directories.