Documentation ¶
Index ¶
- Constants
- Variables
- func CloseAgent(a gate.Agent)
- func CloseStatusAgent(a gate.Agent)
- func DataRecv(data interface{}, a gate.Agent)
- func DataRecvStatus(data interface{}, a gate.Agent)
- func NewAgent(a gate.Agent)
- func NewStatusAgent(a gate.Agent)
- type JsActorMap
- type JsCore
- type JsInterface
- type MActor
- type MActorIm
- type ParamStru
- type Req
- type RequestSt
- type ResReleaseStru
- type ResponseSt
- type StatusActorIm
Constants ¶
View Source
const ( WsUserID = "sendID" OperationID = "operationID" PlatformID = "platformID" )
View Source
const ( LogoutTips = "js sdk socket close" LogoutName = "Logout" )
View Source
const ( RESP_OP_TYPE = "response" MQ_MSG_TYPE = "mqMessage" HEART_CONFIG_TYPE = "heartConfig" CONN_CMD = "connect" SUB_CMD = "subscribe" UNSUB_CMD = "unsubscribe" HEART_CMD = "heart" )
View Source
const DisconnectGCLimit = 100
View Source
const ProtocolError = "Protocol Error"
Variables ¶
View Source
var ProgressStartTime int64
Functions ¶
func CloseAgent ¶
CloseAgent is called when the WebSocket connection is closed. It performs cleanup actions for the agent.
func CloseStatusAgent ¶
func DataRecv ¶
DataRecv is called when new data is received on the WebSocket connection. It processes the incoming data through the actor.
func DataRecvStatus ¶
func NewAgent ¶
NewAgent is called when a new WebSocket connection is established. It initializes agent-related data and checks the token validity.
func NewStatusAgent ¶
Types ¶
type JsActorMap ¶
var GJsActors *JsActorMap
type JsCore ¶
type JsCore struct { RespMessagesChan chan *core_func.EventData // contains filtered or unexported fields }
func (*JsCore) Destroy ¶
func (core *JsCore) Destroy()
Destroy performs cleanup when the core is no longer needed.
type JsInterface ¶
type JsInterface interface { RecvMsg() chan interface{} //todo your sturct,error or response SendMsg(interface{}) error Destroy() }
type MActor ¶
type MActor interface { ProcessRecvMsg(interface{}) error Destroy() // ReleaseRes() // contains filtered or unexported methods }
type MActorIm ¶
type MActorIm struct { SessionId string ReceivMsgChan chan interface{} //接收网络层数据通道 // contains filtered or unexported fields }
func (*MActorIm) ProcessRecvMsg ¶
ProcessRecvMsg processes received messages and sends them to the ReceivMsgChan.
func (*MActorIm) ReleaseRes ¶
func (actor *MActorIm) ReleaseRes()
type ParamStru ¶
type ParamStru struct { UrlPath string Token string SessionId string UserId int64 GroupId int64 OrgId int64 OrgName string }
func (*ParamStru) GetOperationID ¶
GetOperationID parses the URL to get the OperationID parameter.
func (*ParamStru) GetPlatformID ¶
GetPlatformID parses the URL to get the PlatformID parameter.
type ResReleaseStru ¶
type ResReleaseStru struct {
BackSign chan bool
}
type ResponseSt ¶
type ResponseSt struct { Type string `json:"type"` //"response" or "mqMessage" or "heartConfig" Cmd string `json:"cmd"` //"connect" "subscribe" "unsubscribe" Success bool `json:"success"` // ErrMsg string `json:"errMsg"` UserId []string `json:"userIds"` Duration int64 `json:"duration"` // progress run time ,seconds RequestId string `json:"requestId"` Topic string `json:"topic"` Extra string `json:"extra"` MsgTimeStamp int64 `json:"msgTimeStamp"` MsgSeqId int64 `json:"msgSeqId"` Data string `json:"data"` Rate int64 `json:"rate"` }
type StatusActorIm ¶
type StatusActorIm struct { SessionId string ReceivMsgChan chan interface{} //接收网络层数据通道 // contains filtered or unexported fields }
func (*StatusActorIm) Destroy ¶
func (actor *StatusActorIm) Destroy()
func (*StatusActorIm) ProcessRecvMsg ¶
func (actor *StatusActorIm) ProcessRecvMsg(interface{}) error
func (*StatusActorIm) ReleaseRes ¶
func (actor *StatusActorIm) ReleaseRes()
Click to show internal directories.
Click to hide internal directories.