redispub

package
v1.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPublisherInitialization = errors.New("publisher: failed to initialize redis stream publisher")
	ErrPublishFailed           = errors.New("publisher: failed to publish messages")
	ErrNilRedisClient          = errors.New("publisher: redis client is required")
	ErrInvalidMaxStreamEntries = errors.New("publisher: maxStreamEntries cannot be negative")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	MaxStreamEntries int64
	Timeout          time.Duration
	Logger           watermill.LoggerAdapter
}

type Publisher

type Publisher interface {
	PublishToTopic(ctx context.Context, topic string, messageContents ...string) error
	Close() error
}

type RedisPublisher

type RedisPublisher struct {
	// contains filtered or unexported fields
}

func New

func New(redisClient goredis.UniversalClient, opts Options) (*RedisPublisher, error)

func (*RedisPublisher) Close

func (p *RedisPublisher) Close() error

func (*RedisPublisher) PublishToTopic

func (p *RedisPublisher) PublishToTopic(ctx context.Context, topic string, messageContents ...string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL