Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NoopHandler = NewHandler(ContextHandlerFunc(func(ctx context.Context) {}), NextKey)
NoopHandler is a handler that does nothing
Functions ¶
This section is empty.
Types ¶
type Builder ¶
Builder is a function that takes a list of "next" Handlers and returns a single Handler.
type ContextHandler ¶
ContextHandler is the interface for a "chunk" of reconciliation. It either returns, often by adjusting the current key's place in the queue (i.e. via requeue or done) or calls another handler in the chain.
type ContextHandlerFunc ¶
ContextHandlerFunc is a function type that implements ContextHandler
func (ContextHandlerFunc) Handle ¶
func (f ContextHandlerFunc) Handle(ctx context.Context)
type Handler ¶
type Handler struct {
ContextHandler
// contains filtered or unexported fields
}
Handler wraps a ContextHandler and adds a method to create a corresponding Builder. Handler has a Key id so that t can be dereferenced by handlers that branch into multiple options and need to choose a specific one.
func NewHandler ¶
func NewHandler(h ContextHandler, id Key) Handler
NewHandler assigns an id to a ContextHandler implementation and returns a Handler.
func NewHandlerFromFunc ¶
func NewHandlerFromFunc(h ContextHandlerFunc, id Key) Handler
NewHandlerFromFunc creates a new Handler from a ContextHandlerFunc.
type Handlers ¶
type Handlers []Handler
Handlers adds methods to a list of Handler objects and makes it easy to pick a Handler with a specific ID out of the list.
func (Handlers) Find ¶
Find returns the Handler for the given Key and a boolean that returns true if it was found or false otherwise.
func (Handlers) MustFind ¶
MustFind returns the Handler for the given Key and panics if none is found.