Documentation
¶
Index ¶
- func NameToId(name string) uint32
- func Register0[A any](f M0Func[A], flags ...uint32)
- func Register1[A any, R any](f M1Func[A, R], flags ...uint32)
- func Register2[A any, R any, U any](f M2Func[A, R, U], flags ...uint32)
- type HandlerMgr
- type IHandler
- type M0
- type M0Func
- type M1
- type M1Func
- type M2
- type M2Func
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HandlerMgr ¶
type HandlerMgr struct {
// contains filtered or unexported fields
}
func NewHandlerMgr ¶
func NewHandlerMgr() *HandlerMgr
func (*HandlerMgr) Get ¶
func (d *HandlerMgr) Get(head *packet.Head) IHandler
Get 获取handler 优先按名称查找,失败时回退到按数字 ID 查找(兼容跨服务路由时 ActorFuncName 残留的场景)
func (*HandlerMgr) GetByActorFunc ¶
func (d *HandlerMgr) GetByActorFunc(id uint32) IHandler
GetById 通过ID获取handler
func (*HandlerMgr) GetByActorFuncName ¶
func (d *HandlerMgr) GetByActorFuncName(name string) IHandler
GetByName 通过名称获取handler
type IHandler ¶
type M0 ¶
type M0[A any] struct { // contains filtered or unexported fields }
func (*M0[A]) GetActorFunc ¶
func (*M0[A]) GetActorFuncName ¶
type M2 ¶
func (*M2[A, R, U]) GetActorFunc ¶
func (*M2[A, R, U]) GetActorFuncName ¶
Click to show internal directories.
Click to hide internal directories.