Documentation ¶
Index ¶
- Constants
- func SignAccessToken(node choykit.NodeID, gameId, key string) string
- type Backend
- func (s *Backend) AddDependency(info *protocol.NodeInfo)
- func (s *Backend) DelDependency(etcdDown bool, node choykit.NodeID)
- func (s *Backend) Init(ctx *choykit.ServiceContext) error
- func (s *Backend) IsMyDependency(node choykit.NodeID) bool
- func (s *Backend) NodeInfo() *protocol.NodeInfo
- func (s *Backend) Shutdown()
- func (s *Backend) Startup() error
- type EtcdDiscovery
- type Node
- func (s *Node) AddMessageHandler(isPrepend bool, f choykit.PacketHandler)
- func (s *Node) Codec() choykit.Codec
- func (s *Node) Context() *choykit.ServiceContext
- func (s *Node) Dispatch(pkt *choykit.Packet) error
- func (s *Node) Environ() *choykit.Environ
- func (s *Node) Init(ctx *choykit.ServiceContext) error
- func (s *Node) IsClosing() bool
- func (s *Node) NodeID() choykit.NodeID
- func (s *Node) SendPacket(pkt *choykit.Packet) error
- func (s *Node) SetNodeID(v choykit.NodeID)
- func (s *Node) Shutdown()
- func (s *Node) Startup() error
- type NodeInfoMap
- func (m *NodeInfoMap) AddNode(info *protocol.NodeInfo)
- func (m *NodeInfoMap) Clear()
- func (m *NodeInfoMap) DeleteNode(node choykit.NodeID)
- func (m *NodeInfoMap) DeleteService(srvType uint8)
- func (m *NodeInfoMap) GetNodes(srvType uint8) []*protocol.NodeInfo
- func (m *NodeInfoMap) GetNodesBy(srvType uint8, district uint16) []*protocol.NodeInfo
- type ServiceSinker
Constants ¶
View Source
const ( TimeoutSecond = 5 DefaultLeaseTTL = 5 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct { Node qnet.RpcFactory // contains filtered or unexported fields }
服务节点
func (*Backend) AddDependency ¶
func (*Backend) DelDependency ¶
func (*Backend) IsMyDependency ¶
type EtcdDiscovery ¶
type EtcdDiscovery struct {
// contains filtered or unexported fields
}
func NewEtcdDiscovery ¶
func NewEtcdDiscovery(opts *choykit.Options, sink ServiceSinker) *EtcdDiscovery
func (*EtcdDiscovery) Close ¶
func (d *EtcdDiscovery) Close()
func (*EtcdDiscovery) Start ¶
func (d *EtcdDiscovery) Start() error
type Node ¶
type Node struct { choykit.Executor // contains filtered or unexported fields }
节点
func (*Node) AddMessageHandler ¶
添加消息处理函数
func (*Node) SendPacket ¶
type NodeInfoMap ¶
按服务类型区分的节点信息
func NewNodeInfoMap ¶
func NewNodeInfoMap() *NodeInfoMap
func (*NodeInfoMap) Clear ¶
func (m *NodeInfoMap) Clear()
func (*NodeInfoMap) GetNodes ¶
func (m *NodeInfoMap) GetNodes(srvType uint8) []*protocol.NodeInfo
所有本类型的节点
func (*NodeInfoMap) GetNodesBy ¶
func (m *NodeInfoMap) GetNodesBy(srvType uint8, district uint16) []*protocol.NodeInfo
本区服所有类型的节点
Click to show internal directories.
Click to hide internal directories.