pubsub

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc added in v0.24.0

type HandlerFunc func(ctx context.Context, message []byte) error

HandlerFunc is pubsub subscriber handler function.

type PubSub

type PubSub interface {
	// Use to add pubsub middlewares.
	Use(middlewares ...func(HandlerFunc) HandlerFunc)
	// Publish message to specific topic/channel.
	Publish(ctx context.Context, topic string, message []byte) error
	// Subscribe to specific topic/channel.
	Subscribe(ctx context.Context, topic string, handlerFunc HandlerFunc) error
	// Close pubsub client connection.
	Close() error
}

PubSub is pubsub interface.

See usage example in example folder.

Directories

Path Synopsis
Package google is a wrapper of the original "cloud.google.com/go/pubsub" library.
Package google is a wrapper of the original "cloud.google.com/go/pubsub" library.
Package kafka is a wrapper of the original "github.com/segmentio/kafka-go" library.
Package kafka is a wrapper of the original "github.com/segmentio/kafka-go" library.
Package mock_pubsub is a generated GoMock package.
Package mock_pubsub is a generated GoMock package.
Package nop is no-operation pubsub.
Package nop is no-operation pubsub.
Package nsq is a wrapper of the original "github.com/nsqio/go-nsq" library.
Package nsq is a wrapper of the original "github.com/nsqio/go-nsq" library.
Package rabbitmq is a wrapper of the original "github.com/streadway/amqp" library.
Package rabbitmq is a wrapper of the original "github.com/streadway/amqp" library.
Package redis is a wrapper of the original "github.com/redis/go-redis" library.
Package redis is a wrapper of the original "github.com/redis/go-redis" library.

Jump to

Keyboard shortcuts

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