middleware

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyHandlerMiddleware

ApplyHandlerMiddleware applies a series of middleware functions to an inbound message handler function. It takes an inbound message handler function `h` and a variadic list of middleware functions `middleware`. Each middleware function is applied to the handler function in the order they are provided. The resulting handler function with all the middleware applied is returned.

func ApplyPublisherMiddleware

func ApplyPublisherMiddleware(p goqueue.PublisherFunc, middlewares ...goqueue.PublisherMiddlewareFunc) goqueue.PublisherFunc

ApplyPublisherMiddleware applies the given publisher middleware functions to the provided publisher function. It iterates over the middleware functions and applies them in the order they are provided. The resulting publisher function is returned.

func HelloWorldMiddlewareExecuteAfterInboundMessageHandler

func HelloWorldMiddlewareExecuteAfterInboundMessageHandler() goqueue.InboundMessageHandlerMiddlewareFunc

HelloWorldMiddlewareExecuteAfterInboundMessageHandler returns an inbound message handler middleware function. It wraps the provided `next` inbound message handler function and executes some additional logic after it. The additional logic includes logging any error that occurred during the execution of the `next` function and logging a message indicating that the middleware has been executed.

func HelloWorldMiddlewareExecuteAfterPublisher

func HelloWorldMiddlewareExecuteAfterPublisher() goqueue.PublisherMiddlewareFunc

HelloWorldMiddlewareExecuteAfterPublisher returns a PublisherMiddlewareFunc that executes after the publisher function. It logs any error that occurs during publishing and logs a message indicating that the last middleware has been executed.

func HelloWorldMiddlewareExecuteBeforeInboundMessageHandler

func HelloWorldMiddlewareExecuteBeforeInboundMessageHandler() goqueue.InboundMessageHandlerMiddlewareFunc

HelloWorldMiddlewareExecuteBeforeInboundMessageHandler returns a middleware function that logs a message before executing the handler.

func HelloWorldMiddlewareExecuteBeforePublisher

func HelloWorldMiddlewareExecuteBeforePublisher() goqueue.PublisherMiddlewareFunc

HelloWorldMiddlewareExecuteBeforePublisher is a function that returns a PublisherMiddlewareFunc. It wraps the provided PublisherFunc with a middleware that logs a message before executing the next function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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