global

package
v2.40.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewMiddlewares = map[string]NewMiddleware{}

NewMiddlewares contains all the registered new middleware functions.

View Source
var Services = map[string]NewService{}

Services is a map of service name and its new function.

Functions

func Register

func Register(name string, newFunc NewService)

Register registers a new HTTP services with name and new function.

func RegisterMiddleware

func RegisterMiddleware(name string, n NewMiddleware)

RegisterMiddleware registers a new HTTP middleware and its new function.

Types

type Middleware

type Middleware func(h http.Handler) http.Handler

Middleware is a middleware http handler.

type NewMiddleware

type NewMiddleware func(conf map[string]interface{}) (Middleware, int, error)

NewMiddleware is the function that HTTP middlewares need to register at init time.

type NewService

type NewService func(conf map[string]interface{}, log *zerolog.Logger) (Service, error)

NewService is the function that HTTP services need to register at init time.

type Service

type Service interface {
	Handler() http.Handler
	Prefix() string
	Close() error
	// List of url relative to the prefix to be unprotected by the authentication
	// middleware. To be seen if we need url-verb fine grained skip checks like
	// GET is public and POST is not.
	Unprotected() []string
}

Service represents a HTTP service.

Jump to

Keyboard shortcuts

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