gate

package
v0.0.0-...-4702bed Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

** description(""). ** copyright('Open_IM,www.Open_IM.io'). ** author("fg,Gordon@tuoyun.net"). ** time(2021/5/21 15:29).

Index

Constants

This section is empty.

Variables

View Source
var MaxPullMsgNum = 100

Functions

func Init

func Init(rpcPort, wsPort int)

func Run

func Run(promethuesPort int)

func SetTokenKicked

func SetTokenKicked(userID string, platformID int, operationID string)

Types

type MaxSeqResp

type MaxSeqResp struct {
	MaxSeq int64 `json:"maxSeq"`
}

type MsgData

type MsgData struct {
	PlatformID  int32                  `mapstructure:"platformID" validate:"required"`
	SessionType int32                  `mapstructure:"sessionType" validate:"required"`
	MsgFrom     int32                  `mapstructure:"msgFrom" validate:"required"`
	ContentType int32                  `mapstructure:"contentType" validate:"required"`
	RecvID      string                 `mapstructure:"recvID" validate:"required"`
	ForceList   []string               `mapstructure:"forceList"`
	Content     string                 `mapstructure:"content" validate:"required"`
	Options     map[string]interface{} `mapstructure:"options" validate:"required"`
	ClientMsgID string                 `mapstructure:"clientMsgID" validate:"required"`
	OfflineInfo map[string]interface{} `mapstructure:"offlineInfo" validate:"required"`
	Ext         map[string]interface{} `mapstructure:"ext"`
}

type PullMessageResp

type PullMessageResp struct {
}

type RPCServer

type RPCServer struct {
	// contains filtered or unexported fields
}

func (*RPCServer) GenPullSeqList

func (r *RPCServer) GenPullSeqList(currentSeq uint32, operationID string, userID string) ([]uint32, error)

func (*RPCServer) GetSingleUserMsg

func (r *RPCServer) GetSingleUserMsg(operationID string, currentMsgSeq uint32, userID string) []*sdk_ws.MsgData

func (*RPCServer) GetSingleUserMsgForPush

func (r *RPCServer) GetSingleUserMsgForPush(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformID int) *sdk_ws.MsgDataList

func (*RPCServer) GetSingleUserMsgForPushPlatforms

func (r *RPCServer) GetSingleUserMsgForPushPlatforms(operationID string, msgData *sdk_ws.MsgData, pushToUserID string, platformIDList []int) map[int]*sdk_ws.MsgDataList

func (*RPCServer) KickUserOffline

func (*RPCServer) OnlinePushMsg

func (*RPCServer) SuperGroupBackgroundOnlinePush

func (r *RPCServer) SuperGroupBackgroundOnlinePush(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error)

func (*RPCServer) SuperGroupOnlineBatchPushOneMsg

func (r *RPCServer) SuperGroupOnlineBatchPushOneMsg(_ context.Context, req *pbRelay.OnlineBatchPushOneMsgReq) (*pbRelay.OnlineBatchPushOneMsgResp, error)

type Req

type Req struct {
	ReqIdentifier int32  `json:"reqIdentifier" validate:"required"`
	Token         string `json:"token" `
	SendID        string `json:"sendID" validate:"required"`
	OperationID   string `json:"operationID" validate:"required"`
	MsgIncr       string `json:"msgIncr" validate:"required"`
	Data          []byte `json:"data"`
}

type Resp

type Resp struct {
	ReqIdentifier int32  `json:"reqIdentifier"`
	MsgIncr       string `json:"msgIncr"`
	OperationID   string `json:"operationID"`
	ErrCode       int32  `json:"errCode"`
	ErrMsg        string `json:"errMsg"`
	Data          []byte `json:"data"`
}

type SeqData

type SeqData struct {
	SeqBegin int64 `mapstructure:"seqBegin" validate:"required"`
	SeqEnd   int64 `mapstructure:"seqEnd" validate:"required"`
}

type SeqListData

type SeqListData struct {
	SeqList []int64 `mapstructure:"seqList" validate:"required"`
}

type UserConn

type UserConn struct {
	*websocket.Conn

	PlatformID   int32
	PushedMaxSeq uint32
	IsCompress   bool

	IsBackground bool
	// contains filtered or unexported fields
}

type WServer

type WServer struct {
	// contains filtered or unexported fields
}

func (*WServer) MultiTerminalLoginChecker

func (ws *WServer) MultiTerminalLoginChecker(uid string, platformID int, newConn *UserConn, token string, operationID string)

func (*WServer) MultiTerminalLoginCheckerWithLock

func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int, token string, operationID string)

func (*WServer) MultiTerminalLoginRemoteChecker

func (ws *WServer) MultiTerminalLoginRemoteChecker(userID string, platformID int32, token string, operationID string)

func (*WServer) SetWriteTimeout

func (ws *WServer) SetWriteTimeout(conn *UserConn, timeout int)

func (*WServer) SetWriteTimeoutWriteMsg

func (ws *WServer) SetWriteTimeoutWriteMsg(conn *UserConn, a int, msg []byte, timeout int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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