Documentation
¶
Overview ¶
Package messagequeue provides message queue publisher and consumer interfaces with implementations for Google Pub/Sub, Redis, and Amazon SQS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyTopicName is returned when a topic name is empty. ErrEmptyTopicName = platformerrors.New("empty topic name") )
Functions ¶
This section is empty.
Types ¶
type ConsumerFunc ¶
ConsumerFunc is a function type that handles consumed messages.
type ConsumerProvider ¶
type ConsumerProvider interface {
ProvideConsumer(ctx context.Context, topic string, handlerFunc ConsumerFunc) (Consumer, error)
}
ConsumerProvider is a function that provides a Consumer for a given topic.
type Publisher ¶
type Publisher interface {
// Stop halts all publishing.
Stop()
// Publish writes a message onto a message queue.
Publish(ctx context.Context, data any) error
// PublishAsync writes a message onto a message queue, but logs any encountered errors instead of returning them.
PublishAsync(ctx context.Context, data any)
}
Publisher produces events onto a queue.
Click to show internal directories.
Click to hide internal directories.