package cache import "github.com/go-redis/redis" func (p *RedisCache) Publish(channel string, message interface{}) (int64, error) { if p.isCluster { return p.cluster.Publish(channel, message).Result() } return p.client.Publish(channel, message).Result() } func (p *RedisCache) Subscribe(channels ...string) *redis.PubSub { if p.isCluster { return p.cluster.Subscribe(channels...) } return p.client.Subscribe(channels...) }