Skip to content

发布订阅


RDb()

可以通过 tg.RDb() 去指定数据源,不传默认会读取 config/config.yaml 里的Redis配置

  • @param tg.RSource 数据源 tg.RSource{}
  • -------@param Addr 地址
  • -------@param Password 密码
  • -------@param DB 索引
  • -------@param PoolSize 最大连接池

Publish() 向指定频道发送消息

Publish(channel string, message interface{}) *redis.IntCmd
Publish(channel string, message interface{}) *redis.IntCmd

Subscribe() 订阅一个或多个频道

Subscribe(channel ...string) *redis.PubSub
Subscribe(channel ...string) *redis.PubSub

备案号:冀ICP备20015584号-5