leafutil

package
v0.0.0-...-9c21ab8 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDir   = "_config"
	ResourceDir = "resource"
)
View Source
const (
	// server conf
	PendingWriteNum = 2000
	MaxMsgLen       = 1 * 1024 * 1024 // 最大长度为1M
	HTTPTimeout     = 5 * time.Second
	LenMsgLen       = 4
	MaxConnNum      = 20000

	// skeleton conf
	GoLen              = 10000
	TimerDispatcherLen = 10000
	AsyncCallLen       = 10000
	ChanRPCLen         = 10000
)

Variables

View Source
var (
	ProtoProcessor = protobuf.NewProcessor()
)

Functions

func CheckAuth

func CheckAuth(ag gate.Agent) bool

func FindPath

func FindPath(name string) string

从程序所在目录逐层往上找直到找到 注意:go run的执行文件在临时目录,一般是(/var/folders/),这种方法是找不到的

func FindPathFrom

func FindPathFrom(root string, name string) string

可以在执行go run的时候直接把当前目录当参数传进来,然后在此基础上查找

func NewProtoWsGate

func NewProtoWsGate(wsAddr string, chanRPC *chanrpc.Server) *gate.WsGate

func NewSkeleton

func NewSkeleton() *module.Skeleton

func RecoverFromPanic

func RecoverFromPanic(cb func())

通用recover函数,在单独协程的最开始使用defer调用

Types

type TextDuration

type TextDuration struct {
	time.Duration
}

func (*TextDuration) UnmarshalText

func (d *TextDuration) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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