Documentation ¶
Index ¶
- Constants
- func DependencyServiceTypes(serviceDependency string) ([]uint8, error)
- func SignAccessToken(node fatchoy.NodeID, gameId, key string) string
- type Backend
- func (s *Backend) AddDependency(info *protocol.NodeInfo)
- func (s *Backend) DelDependency(etcdDown bool, node fatchoy.NodeID)
- func (s *Backend) Init(ctx *fatchoy.ServiceContext) error
- func (s *Backend) IsMyDependency(node fatchoy.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 fatchoy.PacketHandler)
- func (s *Node) Context() *fatchoy.ServiceContext
- func (s *Node) Dispatch(pkt *fatchoy.Packet) error
- func (s *Node) Environ() *fatchoy.Environ
- func (s *Node) Init(ctx *fatchoy.ServiceContext) error
- func (s *Node) IsClosing() bool
- func (s *Node) NodeID() fatchoy.NodeID
- func (s *Node) SendPacket(pkt *fatchoy.Packet) error
- func (s *Node) SetNodeID(v fatchoy.NodeID)
- func (s *Node) Shutdown()
- func (s *Node) Startup() error
- type NodeInfoMap
- type ServiceSinker
Constants ¶
View Source
const ( TimeoutSecond = 5 DefaultLeaseTTL = 5 )
Variables ¶
This section is empty.
Functions ¶
func DependencyServiceTypes ¶ added in v1.0.5
Types ¶
type Backend ¶
type Backend struct { Node qnet.RpcFactory // contains filtered or unexported fields }
服务节点
func (*Backend) AddDependency ¶
type EtcdDiscovery ¶
type EtcdDiscovery struct {
// contains filtered or unexported fields
}
基于ETCD的服务发现
func NewEtcdDiscovery ¶
func NewEtcdDiscovery(env *fatchoy.Environ, sink ServiceSinker) *EtcdDiscovery
func (*EtcdDiscovery) Close ¶
func (d *EtcdDiscovery) Close()
func (*EtcdDiscovery) Start ¶
func (d *EtcdDiscovery) Start() error
type Node ¶
节点
func (*Node) AddMessageHandler ¶
func (s *Node) AddMessageHandler(isPrepend bool, f fatchoy.PacketHandler)
添加消息处理函数
func (*Node) Context ¶
func (s *Node) Context() *fatchoy.ServiceContext
type NodeInfoMap ¶
按服务类型区分的节点信息
func NewNodeInfoMap ¶
func NewNodeInfoMap() *NodeInfoMap
func (*NodeInfoMap) Clear ¶
func (m *NodeInfoMap) Clear()
Click to show internal directories.
Click to hide internal directories.