Documentation ¶
Overview ¶
Copyright 2014 mqant Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqant Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqant Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2014 mqant Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package basegate is a generated protocol buffer package.
It is generated from these files:
session.proto
It has these top-level messages:
SessionImp
Index ¶
- Variables
- func NewGateHandler(gate gate.Gate) *handler
- func NewMqttAgent(module module.RPCModule) *agent
- func NewSession(app module.App, data []byte) (gate.Session, error)
- func NewSessionByMap(app module.App, data map[string]interface{}) (gate.Session, error)
- type Gate
- 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) GetModule() module.RPCModule
- func (this *Gate) GetSessionLearner() gate.SessionLearner
- func (this *Gate) GetStorageHandler() (storage gate.StorageHandler)
- func (this *Gate) GetTracingHandler() gate.TracingHandler
- 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) OnAppConfigurationLoaded(app module.App)
- func (this *Gate) OnConfChanged(settings *conf.ModuleSettings)
- func (this *Gate) OnDestroy()
- func (this *Gate) OnInit(subclass module.RPCModule, app module.App, settings *conf.ModuleSettings)
- func (this *Gate) Run(closeSig chan bool)
- func (this *Gate) Serialize(param interface{}) (ptype string, p []byte, err error)
- func (this *Gate) SetCreateAgent(cfunc func() gate.Agent) error
- func (this *Gate) SetSessionLearner(sessionLearner gate.SessionLearner) error
- func (this *Gate) SetStorageHandler(storage gate.StorageHandler) error
- func (this *Gate) SetTracingHandler(tracing gate.TracingHandler) error
- type SessionImp
- func (*SessionImp) Descriptor() ([]byte, []int)
- func (m *SessionImp) GetCarrier() map[string]string
- func (m *SessionImp) GetIP() string
- func (m *SessionImp) GetNetwork() string
- func (m *SessionImp) GetServerId() string
- func (m *SessionImp) GetSessionId() string
- func (m *SessionImp) GetSettings() map[string]string
- func (m *SessionImp) GetSpanId() string
- func (m *SessionImp) GetTraceId() string
- func (m *SessionImp) GetUserId() string
- func (*SessionImp) ProtoMessage()
- func (m *SessionImp) Reset()
- func (m *SessionImp) String() string
Constants ¶
This section is empty.
Variables ¶
var RPC_PARAM_ProtocolMarshal_TYPE = "ProtocolMarshal"
var RPC_PARAM_SESSION_TYPE = "SESSION"
Functions ¶
func NewGateHandler ¶
func NewMqttAgent ¶
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) 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() (storage gate.StorageHandler)
func (*Gate) GetTracingHandler ¶
func (this *Gate) GetTracingHandler() gate.TracingHandler
func (*Gate) NewSessionByMap ¶
func (*Gate) OnAppConfigurationLoaded ¶
func (*Gate) OnConfChanged ¶
func (this *Gate) OnConfChanged(settings *conf.ModuleSettings)
func (*Gate) SetCreateAgent ¶
* 设置创建客户端Agent的函数
func (*Gate) SetSessionLearner ¶
func (this *Gate) SetSessionLearner(sessionLearner gate.SessionLearner) error
* 设置客户端连接和断开的监听器
func (*Gate) SetStorageHandler ¶
func (this *Gate) SetStorageHandler(storage gate.StorageHandler) error
* 设置Session信息持久化接口
func (*Gate) SetTracingHandler ¶
func (this *Gate) SetTracingHandler(tracing gate.TracingHandler) error
* 设置Session信息持久化接口
type SessionImp ¶ added in v1.8.0
type SessionImp 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"` TraceId string `protobuf:"bytes,6,opt,name=TraceId" json:"TraceId,omitempty"` SpanId string `protobuf:"bytes,7,opt,name=SpanId" json:"SpanId,omitempty"` Settings map[string]string `` /* 136-byte string literal not displayed */ Carrier map[string]string `` /* 134-byte string literal not displayed */ }
func (*SessionImp) Descriptor ¶ added in v1.8.0
func (*SessionImp) Descriptor() ([]byte, []int)
func (*SessionImp) GetCarrier ¶ added in v1.8.0
func (m *SessionImp) GetCarrier() map[string]string
func (*SessionImp) GetIP ¶ added in v1.8.0
func (m *SessionImp) GetIP() string
func (*SessionImp) GetNetwork ¶ added in v1.8.0
func (m *SessionImp) GetNetwork() string
func (*SessionImp) GetServerId ¶ added in v1.8.0
func (m *SessionImp) GetServerId() string
func (*SessionImp) GetSessionId ¶ added in v1.8.0
func (m *SessionImp) GetSessionId() string
func (*SessionImp) GetSettings ¶ added in v1.8.0
func (m *SessionImp) GetSettings() map[string]string
func (*SessionImp) GetSpanId ¶ added in v1.8.0
func (m *SessionImp) GetSpanId() string
func (*SessionImp) GetTraceId ¶ added in v1.8.0
func (m *SessionImp) GetTraceId() string
func (*SessionImp) GetUserId ¶ added in v1.8.0
func (m *SessionImp) GetUserId() string
func (*SessionImp) ProtoMessage ¶ added in v1.8.0
func (*SessionImp) ProtoMessage()
func (*SessionImp) Reset ¶ added in v1.8.0
func (m *SessionImp) Reset()
func (*SessionImp) String ¶ added in v1.8.0
func (m *SessionImp) String() string