interaction

package
v0.0.0-...-13b6049 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenMsgIncr

func GenMsgIncr(userID string) string

Types

type GeneralWsReq

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

type GeneralWsResp

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

type MsgSync

type MsgSync struct {
	db_interface.DataBase
	*Ws
	LoginUserID string

	PushMsgAndMaxSeqCh chan common.Cmd2Value
	// contains filtered or unexported fields
}

func NewMsgSync

func NewMsgSync(dataBase db_interface.DataBase, ws *Ws, loginUserID string, ch chan common.Cmd2Value, pushMsgAndMaxSeqCh chan common.Cmd2Value, joinedSuperGroupCh chan common.Cmd2Value) *MsgSync

func (*MsgSync) GetCh

func (m *MsgSync) GetCh() chan common.Cmd2Value

func (*MsgSync) Work

func (m *MsgSync) Work(cmd common.Cmd2Value)

type PostApi

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

no share

func NewPostApi

func NewPostApi(token string, apiAddress string) *PostApi

func (*PostApi) Post2UnmarshalRespReturn

func (p *PostApi) Post2UnmarshalRespReturn(url string, req interface{}, output interface{}) error

func (*PostApi) PostFatalCallback

func (p *PostApi) PostFatalCallback(callback open_im_sdk_callback.Base, url string, data interface{}, output interface{}, operationID string)

func (*PostApi) PostFatalCallbackPenetrate

func (p *PostApi) PostFatalCallbackPenetrate(callback open_im_sdk_callback.Base, url string, data interface{}, output interface{}, operationID string)

func (*PostApi) PostReturn

func (p *PostApi) PostReturn(url string, req interface{}, output interface{}) error

func (*PostApi) PostReturnWithTimeOut

func (p *PostApi) PostReturnWithTimeOut(url string, req interface{}, output interface{}, timeOut time.Duration) error

type ReadDiffusionGroupMsgSync

type ReadDiffusionGroupMsgSync struct {
	db_interface.DataBase
	*Ws

	Group2SeqMaxNeedSync     map[string]uint32 //需要同步的seq  可能来自于心跳max,也可能来自于push
	Group2SeqMaxSynchronized map[string]uint32 //已经同步的最大seq
	SuperGroupIDList         []string

	Group2SyncMsgFinished map[string]bool
	// contains filtered or unexported fields
}

func NewReadDiffusionGroupMsgSync

func NewReadDiffusionGroupMsgSync(dataBase db_interface.DataBase, ws *Ws, loginUserID string, conversationCh chan common.Cmd2Value, joinedSuperGroupCh chan common.Cmd2Value) *ReadDiffusionGroupMsgSync

func (*ReadDiffusionGroupMsgSync) TriggerCmdNewMsgCome

func (m *ReadDiffusionGroupMsgSync) TriggerCmdNewMsgCome(msgList []*server_api_params.MsgData, operationID string, loginSync int)

type SelfMsgSync

type SelfMsgSync struct {
	db_interface.DataBase
	*Ws
	// contains filtered or unexported fields
}

func NewSelfMsgSync

func NewSelfMsgSync(dataBase db_interface.DataBase, ws *Ws, loginUserID string, conversationCh chan common.Cmd2Value) *SelfMsgSync

type SelfMsgSyncLatestModel

type SelfMsgSyncLatestModel struct {
	*db.DataBase
	*Ws
	// contains filtered or unexported fields
}

type SeqPair

type SeqPair struct {
	BeginSeq uint32
	EndSeq   uint32
}

type SuperGroupMsgSync

type SuperGroupMsgSync struct {
	*db.DataBase
	*Ws

	Group2SeqMaxNeedSync     map[string]uint32
	Group2SeqMaxSynchronized map[string]uint32
	SuperGroupIDList         []string
	// contains filtered or unexported fields
}

type Ws

type Ws struct {
	*WsRespAsyn
	*WsConn

	JustOnceFlag bool
	IsBackground bool
	// contains filtered or unexported fields
}

func NewWs

func NewWs(wsRespAsyn *WsRespAsyn, wsConn *WsConn, cmdCh chan common.Cmd2Value, pushMsgAndMaxSeqCh chan common.Cmd2Value, cmdHeartbeatCh, conversationCH chan common.Cmd2Value) *Ws

func (*Ws) DoWSSignal

func (w *Ws) DoWSSignal(wsResp GeneralWsResp) error

func (*Ws) Logout

func (w *Ws) Logout(operationID string)

func (*Ws) ReadData

func (w *Ws) ReadData()

func (*Ws) SendReqTest

func (w *Ws) SendReqTest(m proto.Message, reqIdentifier int32, timeout int, senderID, operationID string) bool

func (*Ws) SendReqWaitResp

func (w *Ws) SendReqWaitResp(m proto.Message, reqIdentifier int32, timeout, retryTimes int, senderID, operationID string) (*GeneralWsResp, error)

func (*Ws) SendSignalingReqWaitResp

func (w *Ws) SendSignalingReqWaitResp(req *server_api_params.SignalReq, operationID string) (*server_api_params.SignalResp, error)

func (*Ws) SignalingWaitPush

func (w *Ws) SignalingWaitPush(inviterUserID, inviteeUserID, roomID string, timeout int32, operationID string) (*server_api_params.SignalReq, error)

func (*Ws) WaitResp

func (w *Ws) WaitResp(ch chan GeneralWsResp, timeout int, operationID string, connSend *websocket.Conn) (*GeneralWsResp, error)

func (*Ws) WaitTest

func (w *Ws) WaitTest(ch chan GeneralWsResp, timeout int, operationID string, connSend *websocket.Conn, m proto.Message, senderID string) bool

type WsConn

type WsConn struct {
	IsCompression  bool
	ConversationCh chan common.Cmd2Value
	// contains filtered or unexported fields
}

func NewWsConn

func NewWsConn(listener open_im_sdk_callback.OnConnListener, token string, loginUserID string, isCompression bool, conversationCh chan common.Cmd2Value) *WsConn

func (*WsConn) CloseConn

func (u *WsConn) CloseConn(operationID string) error

func (*WsConn) IsFatalError

func (u *WsConn) IsFatalError(err error) bool

func (*WsConn) IsInterruptReconnection

func (u *WsConn) IsInterruptReconnection() bool

func (*WsConn) IsReadTimeout

func (u *WsConn) IsReadTimeout(err error) bool

func (*WsConn) IsWriteTimeout

func (u *WsConn) IsWriteTimeout(err error) bool

func (*WsConn) Lock

func (u *WsConn) Lock()

func (*WsConn) LoginStatus

func (u *WsConn) LoginStatus() int32

func (*WsConn) ReConn

func (u *WsConn) ReConn(operationID string) (*websocket.Conn, error, bool, bool)

func (*WsConn) SendPingMsg

func (u *WsConn) SendPingMsg() error

func (*WsConn) SetLoginStatus

func (u *WsConn) SetLoginStatus(loginState int32)

func (*WsConn) SetReadTimeout

func (u *WsConn) SetReadTimeout(timeout int) error

func (*WsConn) SetWriteTimeout

func (u *WsConn) SetWriteTimeout(timeout int) error

func (*WsConn) Unlock

func (u *WsConn) Unlock()

type WsRespAsyn

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

func NewWsRespAsyn

func NewWsRespAsyn() *WsRespAsyn

func (*WsRespAsyn) AddCh

func (u *WsRespAsyn) AddCh(userID string) (string, chan GeneralWsResp)

func (*WsRespAsyn) AddChByIncr

func (u *WsRespAsyn) AddChByIncr(msgIncr string) chan GeneralWsResp

func (*WsRespAsyn) DelCh

func (u *WsRespAsyn) DelCh(msgIncr string)

func (*WsRespAsyn) GetCh

func (u *WsRespAsyn) GetCh(msgIncr string) chan GeneralWsResp

Jump to

Keyboard shortcuts

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