gate

package
v0.0.0-...-2692626 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GateLogoutReq

func GateLogoutReq(protoHead libpb.IHeader, protoMessage proto.Message, obj interface{}) *liberror.Error

func GateRegisterReq

func GateRegisterReq(protoHead libpb.IHeader, protoMessage proto.Message, obj interface{}) *liberror.Error

func RecvError

func RecvError(err error, fun func())

Types

type APIServer

type APIServer struct {
	protogate.UnimplementedGateServiceServer
}

func (*APIServer) BidirectionalBinaryData

func (s *APIServer) BidirectionalBinaryData(stream protogate.GateService_BidirectionalBinaryDataServer) error

type Bus

type Bus struct {
}

Bus 总线

func (*Bus) OnEventBus

func (p *Bus) OnEventBus(v interface{}) error

OnEventBus 处理事件-总线

func (*Bus) OnEventEtcd

func (p *Bus) OnEventEtcd(key string, value string) error

OnEventEtcd 处理事件-etcd

type Friend

type Friend struct {
	*pkgservice.Service
}

func (*Friend) OnRecv

func (p *Friend) OnRecv()

func (*Friend) String

func (p *Friend) String() string

type FriendMgr

type FriendMgr struct {
	*libutil.Mgr[string, *Friend]
	// contains filtered or unexported fields
}

func (*FriendMgr) Send

func (p *FriendMgr) Send(ctx context.Context) error

Send 发送

func (*FriendMgr) SpawnFriend

func (p *FriendMgr) SpawnFriend(key string, stream grpc.ServerStream) *Friend

type Gate

type Gate struct {
	*pkgserver.Normal
	// contains filtered or unexported fields
}

func NewGate

func NewGate(normal *pkgserver.Normal) *Gate

func (*Gate) CanHandle

func (p *Gate) CanHandle(messageID uint32) bool

CanHandle 是否可以处理的命令 判断cmd是否符合自己可以处理的消息类型 如果符合,返回true;否则,返回false

func (*Gate) Handle

func (p *Gate) Handle(stream protogate.GateService_BidirectionalBinaryDataServer, header *pkgmsg.Header, body []byte) error

func (*Gate) OnPreStop

func (p *Gate) OnPreStop(_ context.Context) (err error)

func (*Gate) OnStart

func (p *Gate) OnStart(_ context.Context) (err error)

func (*Gate) OnTimerEachDayFun

func (p *Gate) OnTimerEachDayFun(_ interface{})

OnTimerEachDayFun 新的一天

func (*Gate) OnTimerEachSecondFun

func (p *Gate) OnTimerEachSecondFun(arg interface{})

OnTimerEachSecondFun 新的一秒

func (*Gate) String

func (p *Gate) String() string

type Router

type Router struct {
}

Router 消息路由管理器

func (*Router) Handle

func (p *Router) Handle(routerKey string, stream protogate.GateService_BidirectionalBinaryDataServer, header *pkgmsg.Header, data []byte) error

type User

type User struct {
	Stream grpc.ServerStream
	// contains filtered or unexported fields
}

User 用户

func (*User) OnMailBox

func (p *User) OnMailBox(msg *libactor.Msg) error

OnMailBox 处理收到的消息

func (*User) String

func (p *User) String() string

type UserMgr

type UserMgr struct {
	// contains filtered or unexported fields
}

func NewUserMgr

func NewUserMgr() *UserMgr

func (*UserMgr) DeleteUser

func (p *UserMgr) DeleteUser(key string)

func (*UserMgr) Find

func (p *UserMgr) Find(key string) *User

func (*UserMgr) FindByStream

func (p *UserMgr) FindByStream(stream grpc.ServerStream) *User

func (*UserMgr) OnBus

func (p *UserMgr) OnBus()

func (*UserMgr) SpawnUser

func (p *UserMgr) SpawnUser(key string, stream grpc.ServerStream) *User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL