notifier

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Notifier

type Notifier interface {
	// Notify publishes data to the notifier
	// after decorating it with additional details
	Notify(
		cx context.Context, data interface{},
	) error
}

func NewNoopNotifier

func NewNoopNotifier() Notifier

func NewNotifier

func NewNotifier(
	connstr string,
	subject string,
	options ...Option,
) (Notifier, error)

NewNotifier returns a default implementation of Notifier, which relies on NATS to publish the events. Any future implementation should name itself as `New<type>Notifier`

type Option

type Option func(*natsNotifier)

func WithBufferedWriter

func WithBufferedWriter(
	logger log.Logger,
	bufferSize int,
	parallelism int,
	periodicity time.Duration,
) Option

func WithMessageEncoder

func WithMessageEncoder(fn Encoder) Option

func WithSubjectPrefix

func WithSubjectPrefix(prefix string) Option

Jump to

Keyboard shortcuts

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