messagequeue

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: AGPL-3.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 Consumer

type Consumer interface {
	Consume(ctx context.Context, stopChan chan bool, errors chan error)
}

Consumer produces events onto a queue.

type ConsumerFunc

type ConsumerFunc func(context.Context, []byte) error

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.

type PublisherProvider

type PublisherProvider interface {
	Close()
	Ping(ctx context.Context) error
	ProvidePublisher(ctx context.Context, topic string) (Publisher, error)
}

PublisherProvider is a function that provides a Publisher for a given topic.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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