middleware

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware func(ctx context.Context, next Next) context.Context

Middleware is the signature of the function that needs to be implemented to use middleware functionnality

You can call the next middleware during the execution of the defined middleware in order to wrap code execution (for example, to time execution, or recover in case of panic).

func Logging

func Logging(logger log.Interface) Middleware

Logging is a middleware that logs messages in reception and in publication

func Recovery

func Recovery(logger log.Interface) Middleware

Recovery is a middleware that recovers from panic in middlewares coming after it and user code from subscription.

type Next

type Next func(ctx context.Context)

Next represents the next middleware that can be executed during the previous middleware. If this is already the last middleware, it will execute the appropriate autogenerated code for reception/sending of messages.

Jump to

Keyboard shortcuts

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