messagequeue

package
v0.0.0-...-98cd694 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyTopicName is returned when a topic name is empty.
	ErrEmptyTopicName = errors.New("empty topic name")
)

Functions

This section is empty.

Types

type Consumer

type Consumer interface {
	Consume(stopChan chan bool, errors chan error)
}

Consumer produces events onto a queue.

type ConsumerProvider

type ConsumerProvider interface {
	ProvideConsumer(ctx context.Context, topic string, handlerFunc func(context.Context, []byte) error) (Consumer, error)
}

ConsumerProvider is a function that provides a Consumer for a given topic.

func NewNoopConsumerProvider

func NewNoopConsumerProvider() ConsumerProvider

NewNoopConsumerProvider is a noop ConsumerProvider.

type NoopConsumer

type NoopConsumer struct{}

NoopConsumer is a no-op messagequeue.Consumer.

func NewNoopConsumer

func NewNoopConsumer() *NoopConsumer

NewNoopConsumer is a noop Consumer.

func (*NoopConsumer) Consume

func (n *NoopConsumer) Consume(_ chan bool, _ chan error)

Consume does nothing.

type Publisher

type Publisher interface {
	Stop()
	Publish(ctx context.Context, data any) error
}

Publisher produces events onto a queue.

func NewNoopPublisher

func NewNoopPublisher() Publisher

NewNoopPublisher is a noop Publisher.

type PublisherProvider

type PublisherProvider interface {
	Close()
	ProvidePublisher(topic string) (Publisher, error)
}

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

func NewNoopPublisherProvider

func NewNoopPublisherProvider() PublisherProvider

NewNoopPublisherProvider is a noop PublisherProvider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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