golang-im聊天
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

21 lines
468 B

  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. }