Versions in this module Expand all Collapse all v0 v0.7.23 Oct 8, 2026 v0.7.22 Oct 2, 2026 v0.7.21 Oct 2, 2026 Changes in this version + var ErrBackendUnavailable = errors.New("pubsub: backend unavailable") + var ErrClosed = errors.New("pubsub: closed") + func NewClient(cfg ClientConfig) (redis.UniversalClient, error) + type Backend int + const BackendMemory + const BackendRedis + const BackendValkey + func ParseBackend(s string) Backend + func (b Backend) String() string + type ClientConfig struct + Addrs []string + DB int + Password string + TLS bool + Username string + type Config struct + Addrs []string + Backend string + DB int + Password string + TLS bool + Username string + type Logger interface + Error func(err error, msg string, keysAndValues ...any) + type MemoryPubSub struct + func NewMemoryPubSub() *MemoryPubSub + func (m *MemoryPubSub) Close() error + func (m *MemoryPubSub) HealthProbe(_ context.Context) error + func (m *MemoryPubSub) Publish(_ context.Context, topic string, payload []byte) error + func (m *MemoryPubSub) Subscribe(_ context.Context, topic string) (Subscription, error) + type PubSub interface + Close func() error + HealthProbe func(ctx context.Context) error + Publish func(ctx context.Context, topic string, payload []byte) error + Subscribe func(ctx context.Context, topic string) (Subscription, error) + func NewRedisPubSub(client redis.UniversalClient, prefix string, log Logger) (PubSub, error) + func NewValkeyPubSub(client redis.UniversalClient, prefix string, log Logger) (PubSub, error) + type Service struct + func New(backend Backend, redisClient redis.UniversalClient, log Logger) *Service + func (s *Service) NewPubSub(prefix string) (PubSub, error) + type Subscription interface + C func() <-chan []byte + Close func() error