Documentation
¶
Index ¶
- type Account
- type BaseRespCmd
- type BizHub
- type BrokerHub
- type BrokerInfo
- type Client
- type CmdCreateAccountReq
- type CmdCreateAccountResp
- type CmdDialogueReq
- type CmdDialogueResp
- type CmdMatchReq
- type CmdMatchResp
- type CmdPingReq
- type CmdPingResp
- type CmdPushDialogueReq
- type CmdPushDialogueResp
- type CmdPushSignalReq
- type CmdPushSignalResp
- type CmdPushViewedAckReq
- type CmdReConnectReq
- type CmdReConnectResp
- type CmdViewedAckReq
- type CmdViewedAckResp
- type CommonCmd
- type InBox
- type OutBox
- type Session
- type SessionAccount
- type SessionWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID uint64 `gorm:"column:id" json:"id"`
NickName string `gorm:"column:nickname" json:"nickname"`
Status int `gorm:"column:status" json:"status"`
Broker string `gorm:"column:broker" json:"broker"`
Token string `gorm:"column:token" json:"token"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
ModifiedAt time.Time `gorm:"column:modified_at" json:"-"`
}
type BaseRespCmd ¶
type BizHub ¶
melody.Session keys 是一个Map,多线程处理有并发问题
func (*BizHub) GetAllClient ¶
func (*BizHub) RemoveClient ¶
type BrokerHub ¶
melody.Session keys 是一个Map,多线程处理有并发问题
func NewBrokerHub ¶
func NewBrokerHub() *BrokerHub
func (*BrokerHub) GetBroker ¶
func (h *BrokerHub) GetBroker(brokerAddr string) (pb.BrokerClient, bool)
func (*BrokerHub) GetBrokerList ¶
func (h *BrokerHub) GetBrokerList() []BrokerInfo
func (*BrokerHub) RemoveBroker ¶
type BrokerInfo ¶
type BrokerInfo struct {
Addr string
Client pb.BrokerClient
}
type Client ¶
type CmdCreateAccountReq ¶
func NewCmdCreateAccountReq ¶ added in v0.1.0
func NewCmdCreateAccountReq() *CmdCreateAccountReq
type CmdCreateAccountResp ¶
type CmdCreateAccountResp struct {
BaseRespCmd
NickName string `json:"nickName"`
AccountId uint64 `json:"accountId"`
Token string `json:"token"`
}
func NewCmdCreateAccountResp ¶ added in v0.1.0
func NewCmdCreateAccountResp() *CmdCreateAccountResp
type CmdDialogueReq ¶
type CmdDialogueReq struct {
Cmd string `json:"cmd"`
RequestId string `json:"requestId"`
SenderId uint64 `json:"senderId"`
SessionId uint64 `json:"sessionId"`
Content string `json:"content"`
}
func NewCmdDialogueReq ¶ added in v0.1.0
func NewCmdDialogueReq() *CmdDialogueReq
type CmdDialogueResp ¶
type CmdDialogueResp struct {
BaseRespCmd
RequestId string `json:"requestId"`
MsgId uint64 `json:"msgId"`
}
func NewCmdDialogueResp ¶ added in v0.1.0
func NewCmdDialogueResp() *CmdDialogueResp
type CmdMatchReq ¶
func NewCmdMatchReq ¶ added in v0.1.0
func NewCmdMatchReq() *CmdMatchReq
type CmdMatchResp ¶
type CmdMatchResp struct {
BaseRespCmd
PartnerId uint64 `json:"partnerId,omitempty"`
PartnerName string `json:"partnerName,omitempty"`
SessionId uint64 `json:"sessionId,omitempty"`
}
func NewCmdMatchResp ¶ added in v0.1.0
func NewCmdMatchResp() *CmdMatchResp
type CmdPingReq ¶
由broker发出
{
"cmd": "PING_REQ",
"accountId": 12000
}
func NewCmdPingReq ¶ added in v0.1.0
func NewCmdPingReq() *CmdPingReq
type CmdPingResp ¶
由Client发出
{
"cmd": "PING_RESP"
"accountId": 12000
}
func NewCmdPingResp ¶ added in v0.1.0
func NewCmdPingResp() *CmdPingResp
type CmdPushDialogueReq ¶
type CmdPushDialogueReq struct {
Cmd string `json:"cmd"`
MsgId uint64 `json:"msgId"`
SenderId uint64 `json:"senderId"`
SessionId uint64 `json:"sessionId"`
Content string `json:"content"`
}
func NewCmdPushDialogueReq ¶ added in v0.1.0
func NewCmdPushDialogueReq() *CmdPushDialogueReq
type CmdPushDialogueResp ¶
type CmdPushDialogueResp struct {
BaseRespCmd
}
func NewCmdPushDialogueResp ¶ added in v0.1.0
func NewCmdPushDialogueResp() *CmdPushDialogueResp
type CmdPushSignalReq ¶
type CmdPushSignalReq struct {
Cmd string `json:"cmd"`
SenderId uint64 `json:"senderId"`
SessionId uint64 `json:"sessionId"`
ReceiverId uint64 `json:"receiverId"`
SignalType string `json:"signalType"`
Data interface{} `json:"data"`
}
func NewCmdPushSignalReq ¶ added in v0.1.0
func NewCmdPushSignalReq() *CmdPushSignalReq
type CmdPushSignalResp ¶
type CmdPushSignalResp struct {
BaseRespCmd
}
func NewCmdPushSignalResp ¶ added in v0.1.0
func NewCmdPushSignalResp() *CmdPushSignalResp
type CmdPushViewedAckReq ¶
type CmdPushViewedAckReq struct {
Cmd string `json:"cmd"`
SessionId uint64 `json:"sessionId"`
AccountId uint64 `json:"accountId"`
MsgId uint64 `json:"msgId"`
}
func NewCmdPushViewedAckReq ¶ added in v0.1.0
func NewCmdPushViewedAckReq() *CmdPushViewedAckReq
type CmdReConnectReq ¶
type CmdReConnectReq struct {
Cmd string `json:"cmd"`
AccountId uint64 `json:"accountId"`
Token string `json:"token"`
}
func NewCmdReConnectReq ¶ added in v0.1.0
func NewCmdReConnectReq() *CmdReConnectReq
type CmdReConnectResp ¶
type CmdReConnectResp struct {
BaseRespCmd
}
func NewCmdReConnectResp ¶ added in v0.1.0
func NewCmdReConnectResp() *CmdReConnectResp
type CmdViewedAckReq ¶
type CmdViewedAckReq struct {
Cmd string `json:"cmd"`
SessionId uint64 `json:"sessionId"`
AccountId uint64 `json:"accountId"`
MsgId uint64 `json:"MsgId"`
}
func NewCmdViewedAckReq ¶ added in v0.1.0
func NewCmdViewedAckReq() *CmdViewedAckReq
type CmdViewedAckResp ¶
type CmdViewedAckResp struct {
BaseRespCmd
}
func NewCmdViewedAckResp ¶ added in v0.1.0
func NewCmdViewedAckResp() *CmdViewedAckResp
type InBox ¶
type OutBox ¶
type OutBox struct {
ID uint64 `gorm:"column:id" json:"id"`
SenderId uint64 `gorm:"column:sender_id" json:"sender_id"`
SessionId uint64 `gorm:"column:session_id" json:"session_id"`
Status int `gorm:"column:status" json:"status"`
MsgType int `gorm:"column:msg_type" json:"msg_type"`
Content string `gorm:"column:content" json:"content"`
CreatedAt time.Time `gorm:"column:created_at" json:"-"`
ModifiedAt time.Time `gorm:"column:modified_at" json:"-"`
}
type Session ¶
type SessionAccount ¶
type SessionAccount struct {
ID uint64 `gorm:"column:id" json:"id"`
SessionId uint64 `gorm:"column:session_id" json:"session_id"`
AccountId uint64 `gorm:"column:account_id" json:"account_id"`
}
func (SessionAccount) TableName ¶
func (SessionAccount) TableName() string
type SessionWrapper ¶ added in v0.1.0
func NewSessionWrapper ¶ added in v0.1.0
func NewSessionWrapper(s *melody.Session) *SessionWrapper
func (*SessionWrapper) Write ¶ added in v0.1.0
func (s *SessionWrapper) Write(obj any) error
Click to show internal directories.
Click to hide internal directories.