Documentation ¶
Index ¶
- Constants
- func GenAddr(host, port string) string
- func GetPsutil() *deal.Psutil
- func InStringArr(s string, arr []string) bool
- func MsgMarsh(deal uint32, input interface{}) ([]byte, error)
- func MsgUnMarsh(deal uint32, msg []byte, output interface{}) error
- func PacketMarsh(p *Packet) ([]byte, error)
- func PrintMsg(msg *deal.Msg, data ...interface{})
- func SetConfig(file string)
- func VersionCompare(v1, v2 string) bool
- type Addr
- type Base
- type Cache
- func (c *Cache) Del(k string)
- func (c *Cache) Get(k string) interface{}
- func (c *Cache) GetBool(k string) bool
- func (c *Cache) GetFloat(k string) float64
- func (c *Cache) GetInt(k string) int
- func (c *Cache) GetInt32(k string) int32
- func (c *Cache) GetInt64(k string) int64
- func (c *Cache) GetString(k string) string
- func (c *Cache) GetUInt(k string) uint
- func (c *Cache) GetUInt32(k string) uint32
- func (c *Cache) GetUInt64(k string) uint64
- func (c *Cache) Set(k string, v interface{})
- type Config
- type Master
- type Member
- type Packet
- type Server
Constants ¶
View Source
const ( TcpDealProtobuf uint32 = iota + 1 TcpDealJson )
tcp协议类型
View Source
const ( PacketHeadLength int = 2 TcpReadBufLen int = 2048 )
packet常量
View Source
const ( // 延迟时间 DelayDuration time.Duration = time.Second // 服务注册时差 TcpHeartDuration time.Duration = time.Duration(60) * time.Second // TCP请求超时市场 TcpDeadDuration time.Duration = time.Duration(10) * time.Second // HTTP请求超时时间 HttpDeadDuration time.Duration = time.Duration(30) * time.Second // 连接池 TcpPoolIdMin int = 0 TcpPoolIdMax int = 10 // 获取对象最长等待时长 单位毫秒 TcpPoolMaxWaitTime int = 1000 // 30分钟 TcpPoolLifeTime int64 = 1800 )
tcp请求信息
View Source
const ( StatusZero int = iota StatusOne StatusTwo )
status
View Source
const ( MsgTypeNone uint32 = iota MsgTypeRequest MsgTypeResponse MsgTypeNotice MsgTypePush )
msg type
View Source
const ( HandleKeySession string = "Session" HandleKeyMid string = "Mid" MemberNode string = "MemberNode" ServerNode string = "ServerNode" MchIDKey string = "MchID" SessionIDKey string = "SessionID" MessageDeal string = "MessageDeal" )
handle key
View Source
const ( MinUint64 uint64 = 0 MaxUint64 uint64 = ^uint64(0) MemberSidSize uint64 = 10000 MaxSessionNum uint64 = 1000000 )
一些数值
Variables ¶
This section is empty.
Functions ¶
Types ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.