Documentation
¶
Overview ¶
Package registrations provides a hierarchical namespace for denoting any kind of handlers to be registered on some target. Handlers are denoted by names evaluated by HandlerRegistrationHandler Such a registration handler is responsible vor a complete sub namespace and may delegate the evaluation to nested handler mounted on a sub namespace.
Index ¶
- func DecodeAnyConfig(config interface{}) (json.RawMessage, error)
- func DecodeConfig[T any](config interface{}, d ...Decoder) (*T, error)
- func DecodeDefaultedConfig[T any](config interface{}, d ...Decoder) (*T, error)
- type Decoder
- type HandlerConfig
- type HandlerInfo
- type HandlerInfos
- type HandlerRegistrationHandler
- type HandlerRegistrationRegistry
- type HandlerRegistrationRegistryAccess
- type NamePath
- type RegistrationHandlerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeAnyConfig ¶
func DecodeAnyConfig(config interface{}) (json.RawMessage, error)
func DecodeConfig ¶
func DecodeDefaultedConfig ¶
Types ¶
type Decoder ¶
type Decoder func(data []byte, unmarshaller runtime.Unmarshaler) (interface{}, error)
type HandlerConfig ¶
type HandlerConfig interface{}
type HandlerInfo ¶
type HandlerInfos ¶
type HandlerInfos []HandlerInfo
func NewLeafHandlerInfo ¶
func NewLeafHandlerInfo(short, desc string) HandlerInfos
func NewNodeHandlerInfo ¶
func NewNodeHandlerInfo(short, desc string) HandlerInfos
func (HandlerInfos) Description ¶
func (h HandlerInfos) Description(i int) string
func (HandlerInfos) Key ¶
func (h HandlerInfos) Key(i int) string
func (HandlerInfos) Size ¶
func (h HandlerInfos) Size() int
type HandlerRegistrationHandler ¶
type HandlerRegistrationHandler[T any, O any] interface { RegisterByName(handler string, target T, config HandlerConfig, opts ...O) (bool, error) GetHandlers(T) HandlerInfos }
type HandlerRegistrationRegistry ¶
type HandlerRegistrationRegistry[T any, O any] interface { HandlerRegistrationRegistryAccess[T, O] GetAllRegistrationHandlers() []*RegistrationHandlerInfo[T, O] Copy() HandlerRegistrationRegistry[T, O] }
func NewHandlerRegistrationRegistry ¶
func NewHandlerRegistrationRegistry[T any, O any](base ...HandlerRegistrationRegistry[T, O]) HandlerRegistrationRegistry[T, O]
type HandlerRegistrationRegistryAccess ¶ added in v0.4.1
type HandlerRegistrationRegistryAccess[T any, O any] interface { HandlerRegistrationHandler[T, O] RegisterRegistrationHandler(path string, handler HandlerRegistrationHandler[T, O]) GetRegistrationHandlers(name string) []*RegistrationHandlerInfo[T, O] }
type RegistrationHandlerInfo ¶
func NewRegistrationHandlerInfo ¶
func NewRegistrationHandlerInfo[T any, O any](path string, handler HandlerRegistrationHandler[T, O]) *RegistrationHandlerInfo[T, O]
func (*RegistrationHandlerInfo[T, O]) GetHandlers ¶
func (i *RegistrationHandlerInfo[T, O]) GetHandlers(target T) HandlerInfos
func (*RegistrationHandlerInfo[T, O]) RegisterByName ¶
func (i *RegistrationHandlerInfo[T, O]) RegisterByName(handler string, target T, config HandlerConfig, opts ...O) (bool, error)
Click to show internal directories.
Click to hide internal directories.