alg

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: AGPL-3.0 Imports: 22 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 EncodePayloadToBin

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

func ExtractDigits added in v1.5.0

func ExtractDigits(str string) uint32

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 GetDaysSinceBaseline added in v1.5.0

func GetDaysSinceBaseline(currentTime time.Time) int32

func GetEc2b

func GetEc2b() *random.Ec2b

func GetEveryDay4 added in v1.2.1

func GetEveryDay4() time.Duration

func GetRelicSub added in v1.5.0

func GetRelicSub(sub string) map[uint32]uint32

func MaxUin32 added in v1.2.2

func MaxUin32(x, y uint32) uint32

func NewHttp added in v1.5.0

func NewHttp(netInfo constant.AppNet, handler http.Handler) error

func S2I added in v1.5.0

func S2I(msg string) int

func S2I32 added in v1.3.1

func S2I32(msg string) int32

func S2U32 added in v1.2.1

func S2U32(msg string) uint32

Types

type PackMsg

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

type Status added in v1.5.0

type Status struct {
	T   time.Time `json:"-"`
	Cpu float64   `json:"cpu"`
	Mem struct {
		Current uint64 `json:"current"`
		Total   uint64 `json:"total"`
	} `json:"mem"`
	Swap struct {
		Current uint64 `json:"current"`
		Total   uint64 `json:"total"`
	} `json:"swap"`
	Disk struct {
		Current uint64 `json:"current"`
		Total   uint64 `json:"total"`
	} `json:"disk"`
	Uptime     uint64    `json:"uptime"`
	Loads      []float64 `json:"loads"`
	TcpCount   int       `json:"tcpCount"`
	UdpCount   int       `json:"udpCount"`
	NetTraffic struct {
		Sent uint64 `json:"sent"`
		Recv uint64 `json:"recv"`
	} `json:"netTraffic"`
}

func GetStatus added in v1.5.0

func GetStatus() *Status

Jump to

Keyboard shortcuts

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