Documentation ¶
Overview ¶
Package basegate is a generated protocol buffer package.
It is generated from these files:
session.proto
It has these top-level messages:
Sessionpb
Index ¶
- Variables
- func Get_uuid() string
- func NewGateHandler(gate *Gate) gate.GateHandler
- func NewMqttAgent(module module.FullModule) *agent
- func NewSession(app module.AppInterface, data []byte) (gate.Session, error)
- func NewSessionByMap(app module.AppInterface, data map[string]interface{}) (gate.Session, error)
- func RandInt64(min, max int64) int64
- func TimeNow() time.Time
- func TransNumToString(num int64) (string, error)
- func TransStringToNum(str string) (int64, error)
- type Gate
- func (this *Gate) DefaultCreateAgent() gate.Agent
- func (this *Gate) Deserialize(ptype string, b []byte) (param interface{}, err error)
- func (this *Gate) GetAgentLearner() gate.AgentLearner
- func (this *Gate) GetGateHandler() gate.GateHandler
- func (this *Gate) GetMinStorageHeartbeat() int64
- func (this *Gate) GetSessionLearner() gate.SessionLearner
- func (this *Gate) GetStorageHandler() gate.StorageHandler
- func (this *Gate) GetTracingHandler() gate.TracingHandler
- func (gate *Gate) GetType() string
- func (this *Gate) GetTypes() []string
- func (this *Gate) NewSession(data []byte) (gate.Session, error)
- func (this *Gate) NewSessionByMap(data map[string]interface{}) (gate.Session, error)
- func (this *Gate) OnDestroy()
- func (this *Gate) OnInit(app module.AppInterface, module module.FullModule, ...)
- func (this *Gate) Run(closeSig chan bool)
- func (this *Gate) Serialize(param interface{}) (ptype string, p []byte, err error)
- func (this *Gate) SetAgentLearner(agentLearner gate.AgentLearner) error
- func (this *Gate) SetCreateAgent(cfunc func() gate.Agent) error
- func (this *Gate) SetGateHandler(gateHandler gate.GateHandler) error
- func (this *Gate) SetSessionLearner(sessionLearner gate.SessionLearner) error
- func (this *Gate) SetStorageHandler(storageHandler gate.StorageHandler) error
- func (this *Gate) SetTracingHandler(tracingHandler gate.TracingHandler) error
- func (gate *Gate) Version() string
- type Sessionpb
- func (*Sessionpb) Descriptor() ([]byte, []int)
- func (m *Sessionpb) GetCarrier() map[string]string
- func (m *Sessionpb) GetIP() string
- func (m *Sessionpb) GetNetwork() string
- func (m *Sessionpb) GetServerid() string
- func (m *Sessionpb) GetSessionid() string
- func (m *Sessionpb) GetSettings() map[string]string
- func (m *Sessionpb) GetToken() string
- func (m *Sessionpb) GetUserid() string
- func (*Sessionpb) ProtoMessage()
- func (m *Sessionpb) Reset()
- func (m *Sessionpb) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var RPC_PARAM_ProtocolMarshal_TYPE = "ProtocolMarshal"
View Source
var RPC_PARAM_SESSION_TYPE = "SESSION"
Functions ¶
func NewGateHandler ¶
func NewGateHandler(gate *Gate) gate.GateHandler
func NewMqttAgent ¶
func NewMqttAgent(module module.FullModule) *agent
func NewSession ¶
func NewSessionByMap ¶
func TransNumToString ¶
func TransStringToNum ¶
Types ¶
type Gate ¶
type Gate struct { //module.RPCSerialize basemodule.BaseModule MaxConnNum int MaxMsgLen uint32 MinStorageHeartbeat int64 //Session持久化最短心跳包 // websocket WSAddr string HTTPTimeout time.Duration // tcp TCPAddr string //tls Tls bool CertFile string KeyFile string // contains filtered or unexported fields }
func (*Gate) DefaultCreateAgent ¶
func (*Gate) Deserialize ¶
func (*Gate) GetAgentLearner ¶
func (this *Gate) GetAgentLearner() gate.AgentLearner
func (*Gate) GetGateHandler ¶
func (this *Gate) GetGateHandler() gate.GateHandler
func (*Gate) GetMinStorageHeartbeat ¶
func (*Gate) GetSessionLearner ¶
func (this *Gate) GetSessionLearner() gate.SessionLearner
func (*Gate) GetStorageHandler ¶
func (this *Gate) GetStorageHandler() gate.StorageHandler
func (*Gate) GetTracingHandler ¶
func (this *Gate) GetTracingHandler() gate.TracingHandler
func (*Gate) NewSessionByMap ¶
func (*Gate) OnInit ¶
func (this *Gate) OnInit(app module.AppInterface, module module.FullModule, settings *conf.ModuleSettings)
func (*Gate) SetAgentLearner ¶
func (this *Gate) SetAgentLearner(agentLearner gate.AgentLearner) error
func (*Gate) SetCreateAgent ¶
* 设置创建客户端Agent的函数
func (*Gate) SetGateHandler ¶
func (this *Gate) SetGateHandler(gateHandler gate.GateHandler) error
func (*Gate) SetSessionLearner ¶
func (this *Gate) SetSessionLearner(sessionLearner gate.SessionLearner) error
* 设置客户端连接和断开的监听器
func (*Gate) SetStorageHandler ¶
func (this *Gate) SetStorageHandler(storageHandler gate.StorageHandler) error
* 设置Session信息持久化接口
func (*Gate) SetTracingHandler ¶
func (this *Gate) SetTracingHandler(tracingHandler gate.TracingHandler) error
type Sessionpb ¶
type Sessionpb struct { IP string `protobuf:"bytes,1,opt,name=IP" json:"IP,omitempty"` Network string `protobuf:"bytes,2,opt,name=Network" json:"Network,omitempty"` Userid string `protobuf:"bytes,3,opt,name=Userid" json:"Userid,omitempty"` Sessionid string `protobuf:"bytes,4,opt,name=Sessionid" json:"Sessionid,omitempty"` Serverid string `protobuf:"bytes,5,opt,name=Serverid" json:"Serverid,omitempty"` Settings map[string]string `` /* 136-byte string literal not displayed */ Carrier map[string]string `` /* 134-byte string literal not displayed */ Token string `protobuf:"bytes,8,opt,name=Token" json:"Token,omitempty"` }
func (*Sessionpb) Descriptor ¶
func (*Sessionpb) GetCarrier ¶
func (*Sessionpb) GetNetwork ¶
func (*Sessionpb) GetServerid ¶
func (*Sessionpb) GetSessionid ¶
func (*Sessionpb) GetSettings ¶
func (*Sessionpb) ProtoMessage ¶
func (*Sessionpb) ProtoMessage()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.