serves

package
v0.0.0-...-f2d4f82 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Endpoints []Endpoint //nolint:gochecknoglobals

Functions

func FilterEndpoints

func FilterEndpoints[T Endpoint](filter func(e T) bool) []T

func HTTPEndpointSortByPathLen

func HTTPEndpointSortByPathLen(a, b *HTTPEndpoint) bool

func RegisterEndpoints

func RegisterEndpoints(eps ...Endpoint)

Types

type Endpoint

type Endpoint interface {
	String() string
}

type EndpointDesc

type EndpointDesc struct {
	Name                   string
	Description            string
	Selector               string
	Tags                   []string
	Metas                  map[string]string
	Disabled               bool
	DeprecationDescription string
}

func (EndpointDesc) String

func (e EndpointDesc) String() string

type HTTPEndpoint

type HTTPEndpoint struct {
	EndpointDesc

	Method      string
	Path        string
	Handler     http.Handler
	HandlerFunc func(http.ResponseWriter, *http.Request)
	Middleware  func(http.Handler) http.Handler

	Children []*HTTPEndpoint

	Methods     []string
	Middlewares []func(http.Handler) http.Handler
}

func (*HTTPEndpoint) GetEndpointDesc

func (e *HTTPEndpoint) GetEndpointDesc() *EndpointDesc

func (*HTTPEndpoint) Normalize

func (e *HTTPEndpoint) Normalize()

func (HTTPEndpoint) String

func (e HTTPEndpoint) String() string

func (*HTTPEndpoint) Validate

func (e *HTTPEndpoint) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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