module

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WsUserID    = "sendID"
	OperationID = "operationID"
	PlatformID  = "platformID"
)
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"
)

Variables

This section is empty.

Functions

func CloseAgent

func CloseAgent(a gate.Agent)

func DataRecv

func DataRecv(data interface{}, a gate.Agent)

func NewAgent

func NewAgent(a gate.Agent)

Types

type JsCore

type JsCore struct {
	RespMessagesChan chan *core_func.EventData
	// contains filtered or unexported fields
}

func NewJsCore

func NewJsCore(para *ParamStru, sessionId string) *JsCore

func (*JsCore) Destroy

func (core *JsCore) Destroy()

func (*JsCore) RecvMsg

func (core *JsCore) RecvMsg() chan *core_func.EventData

func (*JsCore) SendMsg

func (core *JsCore) SendMsg(req *Req) error

type JsInterface

type JsInterface interface {
	//recv消息
	RecvMsg() chan interface{} //todo your sturct,error or response
	//send消息
	SendMsg(interface{}) error
	//关闭循环,并释放资源
	Destroy()
}

type MActor

type MActor interface {
	//recv消息
	ProcessRecvMsg(interface{}) error
	//关闭循环,并释放资源
	Destroy()
	// contains filtered or unexported methods
}

func NewMActor

func NewMActor(a gate.Agent, sessionId string, appParam *ParamStru) (MActor, error)

type MActorIm

type MActorIm struct {
	SessionId string

	ReceivMsgChan chan interface{} //接收网络层数据通道
	// contains filtered or unexported fields
}

func (*MActorIm) Destroy

func (actor *MActorIm) Destroy()

func (*MActorIm) ProcessRecvMsg

func (actor *MActorIm) ProcessRecvMsg(msg interface{}) error

type ParamStru

type ParamStru struct {
	UrlPath   string
	Token     string
	SessionId string
	UserId    int64
	GroupId   int64
	OrgId     int64
	OrgName   string
}

func (*ParamStru) GetOperationID

func (p *ParamStru) GetOperationID() string

func (*ParamStru) GetPlatformID

func (p *ParamStru) GetPlatformID() string

type Req

type Req struct {
	ReqFuncName string `json:"reqFuncName" `
	OperationID string `json:"operationID"`
	Data        string `json:"data"`
	UserID      string `json:"userID"`
	Batch       int    `json:"batchMsg"`
}

type RequestSt

type RequestSt struct {
	Cmd          string `json:"cmd"` // "subscribe" "unsubscribe" or "heart"
	RequestId    string `json:"requestId"`
	Topic        string `json:"topic"`
	Extra        string `json:"extra"`
	MsgTimeStamp int64  `json:"msgStartTime"`
	MsgSeqId     int64  `json:"msgSeqId"`
}

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"`
	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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL