Documentation
¶
Overview ¶
Package discovery is a generated protocol buffer package.
It is generated from these files:
serverinfo.proto
It has these top-level messages:
ServerInfo
Index ¶
- func SetLogger(log godiscovery.ILogger)
- func SetNode(node *Node)
- type IMap
- type IServers
- type Node
- func (this *Node) GetBase() interface{}
- func (this *Node) GetBaseInfo() ServerInfo
- func (this *Node) GetPutData() (string, error)
- func (this *Node) InitPolicy(policy Policy)
- func (this *Node) OnNodeJoin(nodeIP string, nodeType int, id uint32, data []byte)
- func (this *Node) OnNodeLeave(nodeType int, id uint32)
- func (this *Node) OnNodeUpdate(nodeIP string, nodeType int, id uint32, data []byte)
- func (this *Node) Open(hosts []string, whatsmyipHost string, nodeType int, watchNodeTypes []int, ...)
- func (this *Node) OpenByStr(hostsStr string, whatsmyipHost string, nodeType int, watchNodeTypesStr string, ...)
- func (this *Node) SetBaseInfoIP(externalIp string)
- func (this *Node) SetBaseInfoId(id uint32)
- func (this *Node) SetBaseInfoOrdered(ordered uint32)
- func (this *Node) SetBaseInfoType(t uint32)
- type Policy
- type ServerInfo
- func (*ServerInfo) Descriptor() ([]byte, []int)
- func (m *ServerInfo) GetExternalIp() string
- func (m *ServerInfo) GetId() uint32
- func (m *ServerInfo) GetOrdered() uint32
- func (m *ServerInfo) GetType() uint32
- func (*ServerInfo) ProtoMessage()
- func (m *ServerInfo) Reset()
- func (m *ServerInfo) String() string
- type Servers
- func (this *Servers) Count(nodeType int) int
- func (this *Servers) Delete(nodeType int, id uint32)
- func (this *Servers) GetAll(nodeType int) ([]*ServerInfo, bool)
- func (this *Servers) GetByID(id uint32) (m *ServerInfo, ok bool)
- func (this *Servers) GetOne(nodeType int) (uint32, *ServerInfo, bool)
- func (this *Servers) Set(nodeType int, id uint32, val *ServerInfo)
- type ServersPolicyOrdered
- type ServersPolicyRandom
- type ServersPolicyRoundRobin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogger ¶
func SetLogger(log godiscovery.ILogger)
Types ¶
type IServers ¶
type IServers interface { GetOne(nodeType int) (uint32, *ServerInfo, bool) GetAll(nodeType int) ([]*ServerInfo, bool) Set(nodeType int, id uint32, val *ServerInfo) Delete(nodeType int, id uint32) GetByID(id uint32) (*ServerInfo, bool) Count(nodeType int) int }
func NewServersPolicyOrdered ¶
func NewServersPolicyOrdered() IServers
func NewServersPolicyRandom ¶
func NewServersPolicyRandom() IServers
func NewServersPolicyRoundRobin ¶
func NewServersPolicyRoundRobin() IServers
type Node ¶
type Node struct { godiscovery.Node Servers IServers // contains filtered or unexported fields }
func NewDefaultNode ¶
func NewDefaultNode(inst interface{}) *Node
func (*Node) GetBaseInfo ¶
func (this *Node) GetBaseInfo() ServerInfo
func (*Node) GetPutData ¶
func (*Node) InitPolicy ¶
func (*Node) OnNodeJoin ¶
func (*Node) OnNodeLeave ¶
func (*Node) OnNodeUpdate ¶
func (*Node) SetBaseInfoIP ¶
func (*Node) SetBaseInfoId ¶
func (*Node) SetBaseInfoOrdered ¶
func (*Node) SetBaseInfoType ¶
type ServerInfo ¶
type ServerInfo struct { Type uint32 `protobuf:"varint,1,opt,name=type" json:"type,omitempty"` Id uint32 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` ExternalIp string `protobuf:"bytes,3,opt,name=external_ip,json=externalIp" json:"external_ip,omitempty"` Ordered uint32 `protobuf:"varint,4,opt,name=ordered" json:"ordered,omitempty"` }
func (*ServerInfo) Descriptor ¶
func (*ServerInfo) Descriptor() ([]byte, []int)
func (*ServerInfo) GetExternalIp ¶
func (m *ServerInfo) GetExternalIp() string
func (*ServerInfo) GetId ¶
func (m *ServerInfo) GetId() uint32
func (*ServerInfo) GetOrdered ¶
func (m *ServerInfo) GetOrdered() uint32
func (*ServerInfo) GetType ¶
func (m *ServerInfo) GetType() uint32
func (*ServerInfo) ProtoMessage ¶
func (*ServerInfo) ProtoMessage()
func (*ServerInfo) Reset ¶
func (m *ServerInfo) Reset()
func (*ServerInfo) String ¶
func (m *ServerInfo) String() string
type ServersPolicyOrdered ¶
type ServersPolicyOrdered struct {
gomap.OrderedMap
}
ServersPolicyOrdered
func (*ServersPolicyOrdered) GetOne ¶
func (this *ServersPolicyOrdered) GetOne() (key, val interface{}, ok bool)
type ServersPolicyRandom ¶
ServersPolicyRandom
func (*ServersPolicyRandom) GetOne ¶
func (this *ServersPolicyRandom) GetOne() (key, val interface{}, ok bool)
type ServersPolicyRoundRobin ¶
type ServersPolicyRoundRobin struct {
gomap.RoundRobinMap
}
ServersPolicyRoundRobin
func (*ServersPolicyRoundRobin) GetOne ¶
func (this *ServersPolicyRoundRobin) GetOne() (key, val interface{}, ok bool)
Click to show internal directories.
Click to hide internal directories.