router

package
v1.0.0-beta.168 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DLQMetrics

func DLQMetrics(metricMeter metric.Meter, prefix string, log *slog.Logger) (func(message.HandlerFunc) message.HandlerFunc, error)

func HandlerMetrics

func HandlerMetrics(metricMeter metric.Meter, prefix string, log *slog.Logger) (func(message.HandlerFunc) message.HandlerFunc, error)

func NewDefaultRouter

func NewDefaultRouter(opts Options) (*message.Router, error)

NewDefaultRouter creates a new router with the default middlewares, in case your consumer would mandate a different setup, feel free to create your own router

func RestoreContext

func RestoreContext(h message.HandlerFunc) message.HandlerFunc

RestoreContext ensures that the original context is restored after the handler is done processing the message.

This helps with https://github.com/ThreeDotsLabs/watermill/issues/467

Types

type Options

type Options struct {
	Subscriber  message.Subscriber
	Publisher   message.Publisher
	Logger      *slog.Logger
	MetricMeter metric.Meter

	Config config.ConsumerConfiguration
}

func (*Options) Validate

func (o *Options) Validate() error

Jump to

Keyboard shortcuts

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