Documentation
¶
Index ¶
- Constants
- func EncodeRoomKey(t, room string) string
- type Endpoint
- type EndpointContainer
- type Info
- type LogicHandler
- func (h *LogicHandler) Connect(ctx context.Context, server string, token []byte) (memberId uint64, key string, roomId string, accepts []int32, hb int64, ...)
- func (h *LogicHandler) Disconnect(ctx context.Context, memberId uint64, key, server string) (has bool, err error)
- func (h *LogicHandler) HandleChat(ctx context.Context, m *protocol.Message) (ackMsg *protocol.Message, err error)
- func (h *LogicHandler) HandleGroupChat(ctx context.Context, memberId uint64, m *protocol.Message) (ackMsg *protocol.Message, err error)
- func (h *LogicHandler) Heartbeat(ctx context.Context, memberId uint64, key, server string) (err error)
- func (h *LogicHandler) NodeInstance(ctx context.Context) (string, error)
- func (h *LogicHandler) Receive(ctx context.Context, memberId uint64, m *protocol.Message) (ackMsg *protocol.Message, err error)
- func (h *LogicHandler) RenewOnline(ctx context.Context, server string, roomCount map[string]int32) (map[string]int32, error)
- type LogicRepo
- type NodeInstance
- type Online
Constants ¶
View Source
const (
PlatformWeb = "web"
)
Variables ¶
This section is empty.
Functions ¶
func EncodeRoomKey ¶
Types ¶
type EndpointContainer ¶
type EndpointContainer struct {
// contains filtered or unexported fields
}
type LogicHandler ¶
type LogicHandler struct {
// contains filtered or unexported fields
}
func NewLogicHandler ¶
func NewLogicHandler(c *conf.Config, f *loadbalance.WatchBalancerFactory, repo LogicRepo) (*LogicHandler, error)
func (*LogicHandler) Connect ¶
func (h *LogicHandler) Connect(ctx context.Context, server string, token []byte) (memberId uint64, key string, roomId string, accepts []int32, hb int64, err error)
Connect 验证用户数据
func (*LogicHandler) Disconnect ¶
func (*LogicHandler) HandleChat ¶
func (*LogicHandler) HandleGroupChat ¶
func (*LogicHandler) NodeInstance ¶
func (h *LogicHandler) NodeInstance(ctx context.Context) (string, error)
type LogicRepo ¶
type LogicRepo interface { AddMapping(ctx context.Context, memberId uint64, key, server string) error ExpireMapping(ctx context.Context, memberId uint64, key string) (has bool, err error) DelMapping(ctx context.Context, memberId uint64, key, server string) (bool, error) //GetMapping(ctx context.Context, memberId uint64) (map[string]string, error) PushOfflineMsg(ctx context.Context, op int32, mids []uint64, msg []byte) error ServersByKeys(ctx context.Context, keys []string) ([]string, error) KeysByMids(ctx context.Context, mids []uint64) (map[string]string, []uint64, []uint64, error) AddServerOnline(ctx context.Context, server string, online *Online) error ServerOnline(ctx context.Context, server string) (*Online, error) DelServerOnline(ctx context.Context, server string) error StoreChatMessage(ctx context.Context, seq uint32, chatMessage *protocol.ChatSendMessage) error StoreGroupChatMessage(ctx context.Context, seq uint32, groupChatMessage *protocol.GroupChatMessage) ([]uint64, error) DeleteGroupChatOfflineMessage(ctx context.Context, groupId, userId, messageId uint64) error //PushChatMessageToKafka(ctx context.Context, chatMessage *protocol.ChatSendMessage) PushMessage(ctx context.Context, dm *protocol.DispatcherMessage) }
type NodeInstance ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.