http

package
v1.9.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactoryMethod added in v1.6.0

type FactoryMethod func(metadata middleware.Metadata) (httpMiddleware.Middleware, error)

FactoryMethod is the method creating middleware from metadata.

type Registry

type Registry struct {
	Logger logger.Logger
	// contains filtered or unexported fields
}

Registry is the interface for callers to get registered HTTP middleware.

var DefaultRegistry *Registry

DefaultRegistry is the singleton with the registry.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns a new HTTP middleware registry.

func (*Registry) Create

func (p *Registry) Create(name, version string, metadata middleware.Metadata) (httpMiddleware.Middleware, error)

Create instantiates a HTTP middleware based on `name`.

func (*Registry) RegisterComponent added in v1.9.0

func (p *Registry) RegisterComponent(componentFactory func(logger.Logger) FactoryMethod, names ...string)

RegisterComponent adds a new HTTP middleware to the registry.

Jump to

Keyboard shortcuts

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