alg

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PacketMaxLen = 343 * 1024 // 最大应用层包长度
)

Variables

This section is empty.

Functions

func DecodeBinToPayload

func DecodeBinToPayload(data []byte, kcpMsgList *[]*PackMsg, xorKey []byte)

func DecodeLoop

func DecodeLoop(data []byte, kcpMsgList *[]*PackMsg)

func DecodePayloadToProto

func DecodePayloadToProto(msg *PackMsg) (protoObj pb.Message)

func EncodePayloadToBin

func EncodePayloadToBin(kcpMsg *PackMsg, xorKey []byte) (bin []byte)

func GetAppId

func GetAppId() string

func GetAppIdStr added in v1.2.1

func GetAppIdStr(appId uint32) string

func GetAppIdUint32 added in v1.2.1

func GetAppIdUint32(appid string) uint32

func GetEc2b

func GetEc2b() *random.Ec2b

func GetEveryDay4 added in v1.2.1

func GetEveryDay4() time.Duration

func MaxUin32 added in v1.2.2

func MaxUin32(x, y uint32) uint32

func S2U32 added in v1.2.1

func S2U32(msg string) uint32

Types

type PackMsg

type PackMsg struct {
	CmdId     uint16
	HeadData  []byte
	ProtoData []byte
}

func EncodeProtoToPayload

func EncodeProtoToPayload(protoMsg *ProtoMsg) (serviceMsg *PackMsg)

type ProtoMsg

type ProtoMsg struct {
	CmdId          uint16
	PayloadMessage pb.Message
}

type SnowflakeWorker

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

func NewSnowflakeWorker

func NewSnowflakeWorker(workerId int64) *SnowflakeWorker

func (*SnowflakeWorker) GenId

func (s *SnowflakeWorker) GenId() int64

Jump to

Keyboard shortcuts

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