Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIp(ip string) bool
- func CheckRequestIp(r *http.Request) bool
- func ClientIp(r *http.Request) string
- func FilterGatewayAddrs(config map[int]int, members int, addrs map[string]int, priority bool) map[string]int
- func GenerateChatRoomBroadcastTag(appid interface{}) string
- func GenerateChatRoomTag(appid interface{}, room string) string
- func GenerateWebChatRoomTag(appid interface{}, room string) string
- func GetAllSubscribeSection(component, nodeId string) []string
- func GetAppids() map[string]bool
- func GetDefaultKey(appid, cversion uint16) []byte
- func GetGatewayGorpcMap() map[string]int
- func GetInnerIp() string
- func GetIp() string
- func GetRandApnsGorpc() string
- func GetRouterGorpc() string
- func GetRpcIndex(rpc string, rpcs []string) (index int)
- func GetSaverGorpc() string
- func GetServerRoomName() string
- func GetServerRoomNameSection() string
- func GetSessionGorpc() string
- func GetSn() uint64
- func GetStatedCenterGorpc(key string) string
- func GetStatedCoordinatorGorpc(key string) string
- func GetStatedCoordinatorGorpcs(key string) []string
- func GetStatedSessionGorpc(key string) string
- func GetTraceId(gwaddr string, connectionId ConnectionId) string
- func HumSize(bit uint64) string
- func LogicSubscribe(nodeId string) []string
- func MakeSecretRan(pwd, serverRan string) []byte
- func MakeVerfCode(user string) string
- func NetGlobalConf() *data.Global
- func RandString(length int) string
- func ShowJson(j interface{})
- func StringToUint16(s string) uint16
- func Sum(key string) int
- func UpdateDynamicConfType()
- type ChatRoomMessage
- type ChatRoomMessageNotify
- type ChatRoomMsgRaw
- type ConnectionId
- type ConnectionIdGenerator
- type DynamicConfType
- type MessageNotify
- type PrivateChatRoomMessageNotify
- type UserGateway
Constants ¶
View Source
const ( VERF_CODE_SALT = "360tantan@1408$" DEFAULT_APPID = 2080 APPID_HUAJIAO = 2080 APPID_OVERSEA = 2081 APPID_HUAJIAO_STR = "2080" )
Variables ¶
View Source
var (
ComponentTags map[string]string = map[string]string{
"svn": _SVN_,
"version": _VERSION_,
"author": _AUTHOR_,
"compile_time": _COMPILETIME_,
}
)
View Source
var DynamicConfPtr unsafe.Pointer = unsafe.Pointer(&DynamicConfType{})
View Source
var RootDir = func() string { binDir, err := process.GetProcessBinaryDir() if err != nil { panic(err.Error()) } return binDir + "/.." }()
初始化项目根目录
View Source
var StaticConf = newStaticConfType()
Functions ¶
func CheckRequestIp ¶
func FilterGatewayAddrs ¶
func GenerateChatRoomBroadcastTag ¶
func GenerateChatRoomBroadcastTag(appid interface{}) string
func GenerateChatRoomTag ¶
func GenerateWebChatRoomTag ¶
func GetAllSubscribeSection ¶
func GetDefaultKey ¶
func GetGatewayGorpcMap ¶
func GetInnerIp ¶
func GetInnerIp() string
func GetRandApnsGorpc ¶
func GetRandApnsGorpc() string
func GetRouterGorpc ¶
func GetRouterGorpc() string
func GetRpcIndex ¶
func GetSaverGorpc ¶
func GetSaverGorpc() string
func GetServerRoomNameSection ¶
func GetServerRoomNameSection() string
func GetSessionGorpc ¶
func GetSessionGorpc() string
func GetStatedCenterGorpc ¶
func GetStatedCoordinatorGorpcs ¶
coordinator可能是多发,所以获取到的是一个[]string
func GetStatedSessionGorpc ¶
func GetTraceId ¶
func GetTraceId(gwaddr string, connectionId ConnectionId) string
func LogicSubscribe ¶
func MakeSecretRan ¶
func MakeVerfCode ¶
func StringToUint16 ¶
Types ¶
type ChatRoomMessage ¶
type ChatRoomMessageNotify ¶
type ChatRoomMsgRaw ¶
type ChatRoomMsgRaw struct { Appid uint16 RoomID string Sender string MsgContent string MsgType int Priority int MsgId uint TraceId string MaxId uint }
聊天室消息的原始请求
type ConnectionId ¶
type ConnectionId uint64
func (ConnectionId) String ¶
func (self ConnectionId) String() string
type ConnectionIdGenerator ¶
type ConnectionIdGenerator struct {
// contains filtered or unexported fields
}
func NewConnectionIdGenerator ¶
func NewConnectionIdGenerator() *ConnectionIdGenerator
func (*ConnectionIdGenerator) NextConnectionId ¶
func (this *ConnectionIdGenerator) NextConnectionId() ConnectionId
type DynamicConfType ¶
type DynamicConfType struct { Appids map[string]bool LocalSaverRpc string LocalSessionRpc string LocalRouterRpc string LocalCoordinatorRpc string GatewaySrMap map[string]string }
需要再处理的动态配置,每次从keeper取回来的配置有更新的话,会同步更新该结构
type MessageNotify ¶
type MessageNotify struct { InfoType string InfoContent []byte InfoId int64 QueryAfterSeconds uint32 ExpireTime uint64 Sender string }
func NewMessageNotify ¶
type PrivateChatRoomMessageNotify ¶
type PrivateChatRoomMessageNotify struct { *ChatRoomMessage UserGateways []*UserGateway TraceId string }
type UserGateway ¶
type UserGateway struct { GatewayAddr string ConnId ConnectionId }
* describes the gateway information which user logged on * * GatewayAddr: is gateway address * ConnId: is connection id on gateway
Directories ¶
Path | Synopsis |
---|---|
Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT!
|
Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! Code generated by tool/convert DO NOT EDIT! |
Package pb is a generated protocol buffer package.
|
Package pb is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.