Documentation
¶
Index ¶
- type Account
- type BaseRespCmd
- type BizHub
- func (h *BizHub) GetAllClient() []*Client
- func (h *BizHub) GetSession(accountId uint64) (*melody.Session, bool)
- func (h *BizHub) RemoveClient(accountId uint64)
- func (h *BizHub) SetClient(nickName string, accountId uint64, session *melody.Session)
- func (h *BizHub) SetLastPong(accountId uint64, t time.Time)
- 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
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 ¶
type CmdCreateAccountResp ¶
type CmdCreateAccountResp struct {
BaseRespCmd
NickName string `json:"nickName"`
AccountId uint64 `json:"accountId"`
Token string `json:"token"`
}
type CmdDialogueReq ¶
type CmdDialogueResp ¶
type CmdDialogueResp struct {
BaseRespCmd
RequestId string `json:"requestId"`
MsgId uint64 `json:"msgId"`
}
type CmdMatchReq ¶
type CmdMatchResp ¶
type CmdMatchResp struct {
BaseRespCmd
PartnerId uint64 `json:"partnerId,omitempty"`
PartnerName string `json:"partnerName,omitempty"`
SessionId uint64 `json:"sessionId,omitempty"`
}
type CmdPushDialogueReq ¶
type CmdPushDialogueResp ¶
type CmdPushDialogueResp struct {
BaseRespCmd
}
type CmdPushSignalReq ¶
type CmdPushSignalResp ¶
type CmdPushSignalResp struct {
BaseRespCmd
}
type CmdPushViewedAckReq ¶
type CmdReConnectReq ¶
type CmdReConnectResp ¶
type CmdReConnectResp struct {
BaseRespCmd
}
type CmdViewedAckReq ¶
type CmdViewedAckResp ¶
type CmdViewedAckResp struct {
BaseRespCmd
}
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
Click to show internal directories.
Click to hide internal directories.