register

package
v0.0.0-...-4214274 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHandlerAlreadyRegistered = errors.New("an Handler with this name is already Registered")

ErrHandlerAlreadyRegistered is an error when trying to add Handlers that already is Registered

View Source
var ErrHandlerNotRegistered = errors.New("the Handler asked for is not Registered")

ErrHandlerNotRegistered is an error that is thrown when trying to find an Handler that does not exist

View Source
var HandlerRegister map[string]func() handlers.Handler

HandlerRegister is used to keep track of all available Handlers that a processor can use To have a processor use a custom Handler It need to be Register with RegisterHandler

Functions

func GetHandler

func GetHandler(name string) (handlers.Handler, error)

GetHandler is used to extract a Registered Handler, should return a NEW Copy of an Handler

func Register

func Register(name string, f func() handlers.Handler) error

Register is used to register an Handler. If a Handler with that name already exists it will return an ErrHandlerAlreadyRegistered

Types

This section is empty.

Jump to

Keyboard shortcuts

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