Documentation ¶
Index ¶
- func RegisterRobot(i IRobot)
- func RegisterServerConsume(i IServerConsume)
- func RegisterServerEvent(i IServerEvent)
- func RegisterServerSubscribe(i IServerSubscribe)
- func RegisterSession(i ISession)
- func RegisterTalkMessage(i ITalkMessage)
- func RegisterTalkRecords(i ITalkRecords)
- type IRobot
- type IServerConsume
- type IServerEvent
- type IServerSubscribe
- type ISession
- type ITalkMessage
- type ITalkRecords
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRobot ¶
func RegisterRobot(i IRobot)
func RegisterServerConsume ¶
func RegisterServerConsume(i IServerConsume)
func RegisterServerEvent ¶
func RegisterServerEvent(i IServerEvent)
func RegisterServerSubscribe ¶
func RegisterServerSubscribe(i IServerSubscribe)
func RegisterSession ¶
func RegisterSession(i ISession)
func RegisterTalkMessage ¶
func RegisterTalkMessage(i ITalkMessage)
func RegisterTalkRecords ¶
func RegisterTalkRecords(i ITalkRecords)
Types ¶
type IServerConsume ¶
func ServerConsume ¶
func ServerConsume() IServerConsume
type IServerEvent ¶
type IServerEvent interface { Call(ctx context.Context, client socket.IClient, event string, data []byte) // 连接成功回调事件 OnOpen(client socket.IClient) // 消息回调事件 OnMessage(client socket.IClient, message []byte) // 连接关闭回调事件 OnClose(client socket.IClient, code int, text string) }
func ServerEvent ¶
func ServerEvent() IServerEvent
type IServerSubscribe ¶
type IServerSubscribe interface { // 初始化连接 Conn(w http.ResponseWriter, r *http.Request) error NewClient(uid int, conn socket.IConn) error // Start 启动服务 Start(ctx context.Context, eg *errgroup.Group) // 注册健康上报 SetupHealthSubscribe(ctx context.Context) error // 注册消息订阅 SetupMessageSubscribe(ctx context.Context) error }
func ServerSubscribe ¶
func ServerSubscribe() IServerSubscribe
type ITalkMessage ¶
type ITalkMessage interface { // 文本消息 SendText(ctx context.Context, uid int, req *model.TextMessageReq) error // 代码消息 SendCode(ctx context.Context, uid int, req *model.CodeMessageReq) error }
func TalkMessage ¶
func TalkMessage() ITalkMessage
type ITalkRecords ¶
type ITalkRecords interface { GetTalkRecord(ctx context.Context, recordId int) (*model.TalkRecordsItem, error) HandleTalkRecords(ctx context.Context, items []*model.TalkRecordsItem) ([]*model.TalkRecordsItem, error) }
func TalkRecords ¶
func TalkRecords() ITalkRecords
Click to show internal directories.
Click to hide internal directories.