registrations

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerConfig

type HandlerConfig interface{}

type HandlerRegistrationHandler

type HandlerRegistrationHandler[T any, O any] interface {
	RegisterByName(handler string, target T, config HandlerConfig, opts ...O) (bool, error)
}

type HandlerRegistrationRegistry

type HandlerRegistrationRegistry[T any, O any] interface {
	HandlerRegistrationHandler[T, O]
	RegisterRegistrationHandler(path string, handler HandlerRegistrationHandler[T, O])
	GetRegistrationHandlers(name string) []*RegistrationHandlerInfo[T, O]
}

func NewHandlerRegistrationRegistry

func NewHandlerRegistrationRegistry[T any, O any](base ...HandlerRegistrationRegistry[T, O]) HandlerRegistrationRegistry[T, O]

type NamePath

type NamePath []string

func NewNamePath

func NewNamePath(path string) NamePath

func (NamePath) Compare

func (p NamePath) Compare(o NamePath) int

func (NamePath) IsPrefixOf

func (p NamePath) IsPrefixOf(o NamePath) bool

type RegistrationHandlerInfo

type RegistrationHandlerInfo[T any, O any] struct {
	// contains filtered or unexported fields
}

func NewRegistrationHandlerInfo

func NewRegistrationHandlerInfo[T any, O any](path string, handler HandlerRegistrationHandler[T, O]) *RegistrationHandlerInfo[T, O]

func (*RegistrationHandlerInfo[T, O]) RegisterByName

func (i *RegistrationHandlerInfo[T, O]) RegisterByName(handler string, target T, config HandlerConfig, opts ...O) (bool, error)

Jump to

Keyboard shortcuts

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