middleware

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 2 Imported by: 0

README

Middleware

Commander middleware could manipulate/preform actions during various events inside commander. Middleware has to be given to Commander via it's controller. A middleware controller is responsible for the initialization of the event subscriptions. Check out the available middleware events. If you are missing a middleware event feel free to open a PR.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeforeConsumeHandlerFunc added in v0.6.0

type BeforeConsumeHandlerFunc = types.HandlerFunc

BeforeConsumeHandlerFunc represents the function method called and returned by a middleware client

type BeforeProduceHandlerFunc added in v0.6.0

type BeforeProduceHandlerFunc = func(*types.Message)

BeforeProduceHandlerFunc represents the function method called and returned by a middleware client

type Client

type Client interface {
	WrapBeforeConsume(BeforeConsumeHandlerFunc) BeforeConsumeHandlerFunc
	WrapBeforeProduce(BeforeProduceHandlerFunc) BeforeProduceHandlerFunc
}

Client middleware interface

type ConsumeController added in v0.6.0

type ConsumeController interface {
	BeforeConsume(types.HandlerFunc) types.HandlerFunc
}

ConsumeController middleware controller

type ProduceController added in v0.6.0

type ProduceController interface {
	BeforeProduce(*types.Message) *types.Message
}

ProduceController middleware controller

type UseImpl added in v0.6.0

type UseImpl interface {
	Use(interface{})
}

UseImpl exposed usage interface. The interface could not be called Use due to type reference issues.

func NewClient

func NewClient() UseImpl

NewClient constructs a new middleware client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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