golang-im聊天
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920
  1. package mq
  2. import (
  3. "gim/pkg/db"
  4. "gim/pkg/gerrors"
  5. )
  6. const (
  7. PushRoomTopic = "push_room_topic" // 房间消息队列
  8. PushRoomPriorityTopic = "push_room_priority_topic" // 房间优先级消息队列
  9. PushAllTopic = "push_all_topic" // 全服消息队列
  10. )
  11. func Publish(topic string, bytes []byte) error {
  12. _, err := db.RedisCli.Publish(topic, bytes).Result()
  13. if err != nil {
  14. return gerrors.WrapError(err)
  15. }
  16. return nil
  17. }