pubsub

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Publisher)

Option is a function to set options to Publisher.

func WithDefaultOrderingKey

func WithDefaultOrderingKey(key string) Option

WithDefaultOrderingKey setups the default ordering key.

func WithMetaOrderingKey

func WithMetaOrderingKey(key string) Option

WithMetaOrderingKey setups the metadata key to get the ordering key.

type Publisher

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

Publisher handles the pubsub topic messages.

func New

func New(topic *pubsub.Topic, opts ...Option) *Publisher

New returns a new Publisher instance.

func (Publisher) Publish

func (p Publisher) Publish(ctx context.Context, msg messenger.Message) error

Publish publishes the given message to the pubsub topic.

Jump to

Keyboard shortcuts

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