utils

package
v0.0.0-...-bfb5c6f Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 13 Imported by: 20

Documentation

Index

Constants

View Source
const (
	MAXUINT32              = 4294967295
	DEFAULT_UUID_CNT_CACHE = 512
)

Variables

This section is empty.

Functions

func HttpRequestWrap

func HttpRequestWrap(uri string, targat func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func ReSettingLog

func ReSettingLog()

func XingoTry

func XingoTry(f reflect.Value, args []reflect.Value, handler func(interface{}))

Types

type GlobalObj

type GlobalObj struct {
	TcpServers             map[string]iface.Iserver
	TcpServer              iface.Iserver
	OnConnectioned         func(fconn iface.Iconnection)
	OnClosed               func(fconn iface.Iconnection)
	OnClusterConnectioned  func(fconn iface.Iconnection) //集群rpc root节点回调
	OnClusterClosed        func(fconn iface.Iconnection)
	OnClusterCConnectioned func(fconn iface.Iclient) //集群rpc 子节点回调
	OnClusterCClosed       func(fconn iface.Iclient)
	OnServerStop           func() //服务器停服回调
	Protoc                 iface.IServerProtocol
	RpcSProtoc             iface.IServerProtocol
	RpcCProtoc             iface.IClientProtocol
	Host                   string
	DebugPort              int      //telnet port 用于单机模式
	WriteList              []string //telnet ip list
	TcpPort                int
	MaxConn                int
	IntraMaxConn           int //内部服务器最大连接数
	//log
	LogPath           string
	LogName           string
	MaxLogNum         int32
	MaxFileSize       int64
	LogFileUnit       logger.UNIT
	LogLevel          logger.LEVEL
	SetToConsole      bool
	LogFileType       int32
	PoolSize          int32
	MaxWorkerLen      int32
	MaxSendChanLen    int32
	FrameSpeed        uint8
	Name              string
	MaxPacketSize     uint32
	FrequencyControl  string                    //  100/h, 100/m, 100/s
	CmdInterpreter    iface.ICommandInterpreter //xingo debug tool Interpreter
	ProcessSignalChan chan os.Signal
	// contains filtered or unexported fields
}
var GlobalObject *GlobalObj

func (*GlobalObj) GetFrequency

func (this *GlobalObj) GetFrequency() (int, string)

func (*GlobalObj) GetSafeTimer

func (this *GlobalObj) GetSafeTimer() *timer.SafeTimerScheduel

func (*GlobalObj) IsThreadSafeMode

func (this *GlobalObj) IsThreadSafeMode() bool

func (*GlobalObj) Reload

func (this *GlobalObj) Reload()

type UUIDGenerator

type UUIDGenerator struct {
	Prefix string
	// contains filtered or unexported fields
}

func NewUUIDGenerator

func NewUUIDGenerator(prefix string) *UUIDGenerator

func (*UUIDGenerator) Get

func (this *UUIDGenerator) Get() string

func (*UUIDGenerator) GetUint32

func (this *UUIDGenerator) GetUint32() uint32

Jump to

Keyboard shortcuts

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