cmd_handler

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICmdHandler

type ICmdHandler interface {
	ProcessCmd(context IContext, data []byte) int
}

type IContext

type IContext interface {
	Uid() uint64
	OriSrcBusId() uint32
	Ip() uint32
	Flag() uint32

	ParseMsg(data []byte, msg proto.Message) error

	CallMsgBySvrType(svrType uint32, cmd uint32, req proto.Message, rsp proto.Message) error
	CallOtherMsgBySvrType(svrType uint32, cmd uint32, uid uint64, req proto.Message, rsp proto.Message) error
	SendMsgBack(pbMsg proto.Message)
	SendMsgByServerType(svrType uint32, cmd uint32, req proto.Message) error

	Errorf(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Debugf(format string, args ...interface{})
}

Transaction 实现了这个借口,在事务运行时保存了上下文

Jump to

Keyboard shortcuts

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