Help us shape the future of Go! Take the 2026 Go Developer Survey

define

package
v1.12.25 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOG_MASK        = 1 << 0 // 日志屏蔽模式
	UPDATETIME_MASK = 1 << 1 // 时间屏蔽模式
	CMD_FLAG        = 1 << 2 // 客户端交互命令
	NOTIFY_FLAG     = 1 << 3 // 推送消息
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ICache

type ICache interface {
	Has(string) bool
	SetCache(string, IValue)
	GetCache(string) IValue
	GetAllCache() map[string]IValue
	Refresh(except ...string)
}

type IContext

type IContext interface {
	ILogger
	IHead
	ICache
	ReadOnly() *packet.Head
	Clone(...func(*packet.Head)) *packet.Head  // 转发
	Derive(...func(*packet.Head)) *packet.Head // 派生
	AddDepth(int32) int32
	GetDepth() int32
}

type IHead

type IHead interface {
	GetSendType() packet.SendType
	GetSrcType() uint32
	GetSrcId() uint32
	GetDstType() uint32
	GetDstId() uint32
	GetUid() uint64
	GetCmd() uint32
	GetSeq() uint32
	GetActorId() uint64
	GetActorFunc() uint32
	GetSocketId() uint32
	GetVersion() uint32
	GetCreateTime() int64
	GetBack() *packet.Callback
	GetReply() string
	GetActorFuncName() string
	GetClientIp() string
	SetSendType(packet.SendType)
	SetSrcType(uint32)
	SetSrcId(uint32)
	SetDstType(uint32)
	SetDstId(uint32)
	SetUid(uint64)
	SetCmd(uint32)
	SetSeq(uint32)
	SetActorId(uint64)
	SetActorFunc(uint32)
	SetSocketId(uint32)
	SetVersion(uint32)
	SetCreateTime(int64)
	SetBack(*packet.Callback)
	SetReply(string)
	SetActorFuncName(string)
	SetClientIp(string)
}

type ILogger

type ILogger interface {
	Tracef(string, ...any)
	Debugf(string, ...any)
	Warnf(string, ...any)
	Infof(string, ...any)
	Errorf(string, ...any)
	Fatalf(string, ...any)
	Trace(...any)
	Debug(...any)
	Warn(...any)
	Info(...any)
	Error(...any)
	Fatal(...any)
}

type IValue

type IValue interface {
	Clone() IValue
	Get() any
	IsChanged() bool
	Change()
	Reset()
}

type Message

type Message interface {
	proto.Message
	CloneMessageVT() proto.Message
	MarshalVT() ([]byte, error)
	UnmarshalVT([]byte) error
}

Jump to

Keyboard shortcuts

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