Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaMQServer ¶
type KafkaMQServer struct {
// contains filtered or unexported fields
}
func NewKafkaMQServer ¶
func NewKafkaMQServer(c KafkaMQServerConfig, logger log.Logger) (*KafkaMQServer, error)
func (*KafkaMQServer) Consumer ¶
func (l *KafkaMQServer) Consumer() *kafka.Consumer
Consumer kafka消费者
func (*KafkaMQServer) Produce ¶
func (l *KafkaMQServer) Produce(msg *kafka.Message) error
Produce kafka消息
func (*KafkaMQServer) Producer ¶
func (l *KafkaMQServer) Producer() *kafka.Producer
Producer kafka生产者
type KafkaMQServerConfig ¶
type Message ¶
type Message struct { // 消息表现形式, 弹窗、提醒、通知 MsgType MessageType `json:"msgType"` // 消息内容json Content any `json:"content"` // 消息标题 Title string `json:"title"` // 消息业务类型 Biz string `json:"biz"` // 用户ID UserId uint32 `json:"userId"` }
type MessageType ¶
type MessageType int32
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
type WebsocketServer ¶
type WebsocketServer struct { StopCh chan struct{} // contains filtered or unexported fields }
func NewWebsocketServer ¶
func NewWebsocketServer(addr string) *WebsocketServer
func (*WebsocketServer) RegisterMessageHandler ¶
func (l *WebsocketServer) RegisterMessageHandler(handler func(msg *Message))
RegisterMessageHandler 注册消息处理器
func (*WebsocketServer) SendMessage ¶
func (l *WebsocketServer) SendMessage(message *Message)
SendMessage 发送消息
Click to show internal directories.
Click to hide internal directories.