router

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function struct {
	// contains filtered or unexported fields
}

func (*Function) Accept

func (r *Function) Accept(mediaTypes ...string) *Function

func (*Function) Attribute

func (r *Function) Attribute(name string, val any) *Function

func (*Function) AttributeMap

func (r *Function) AttributeMap(attrs map[string]any) *Function

func (*Function) ContentType

func (r *Function) ContentType(mediaTypes ...string) *Function

func (*Function) UseMiddleware

func (r *Function) UseMiddleware(function middleware.Function, options ...middleware.Option) *Function

type Mapping

type Mapping struct {
	// contains filtered or unexported fields
}

func NewMapping

func NewMapping(pattern string, opts ...MappingOption) *Mapping

func (*Mapping) Accepts

func (r *Mapping) Accepts() []string

func (*Mapping) Attributes

func (r *Mapping) Attributes() map[string]any

func (*Mapping) ContentTypes

func (r *Mapping) ContentTypes() []string

func (*Mapping) Methods

func (r *Mapping) Methods() []http.Method

func (*Mapping) Pattern

func (r *Mapping) Pattern() string

type MappingOption

type MappingOption func(mapping *Mapping)

func WithAccepts

func WithAccepts(accepts ...string) MappingOption

func WithContentTypes

func WithContentTypes(contentTypes ...string) MappingOption

func WithMethod

func WithMethod(methods ...http.Method) MappingOption

type MappingRegistry

type MappingRegistry struct {
}

func (*MappingRegistry) GetHandler

func (r *MappingRegistry) GetHandler(ctx http.Context) (http.HandlerChain, bool)

func (*MappingRegistry) Handlers

func (r *MappingRegistry) Handlers() map[*Mapping]any

func (*MappingRegistry) Register

func (r *MappingRegistry) Register(mapping *Mapping, handler http.Handler, middlewares ...*middleware.Middleware)

func (*MappingRegistry) Unregister

func (r *MappingRegistry) Unregister(mapping *Mapping)

type Router

type Router interface {
	Routes() *Routes
}

type Routes

type Routes struct {
	// contains filtered or unexported fields
}

func Route

func Route() *Routes

func RouteWith

func RouteWith(pattern string) *Routes

func (*Routes) Accept

func (r *Routes) Accept(mediaTypes ...string) *Routes

func (*Routes) Attribute

func (r *Routes) Attribute(name string, val any) *Routes

func (*Routes) AttributeMap

func (r *Routes) AttributeMap(attrs map[string]any) *Routes

func (*Routes) ContentType

func (r *Routes) ContentType(mediaTypes ...string) *Routes

func (*Routes) DELETE

func (r *Routes) DELETE(pattern string, handler http.Handler) *Function

func (*Routes) GET

func (r *Routes) GET(pattern string, handler http.Handler) *Function

func (*Routes) HEAD

func (r *Routes) HEAD(pattern string, handler http.Handler) *Function

func (*Routes) Nest

func (r *Routes) Nest(pattern string) *Routes

func (*Routes) OPTIONS

func (r *Routes) OPTIONS(pattern string, handler http.Handler) *Function

func (*Routes) PATCH

func (r *Routes) PATCH(pattern string, handler http.Handler) *Function

func (*Routes) POST

func (r *Routes) POST(pattern string, handler http.Handler) *Function

func (*Routes) Route

func (r *Routes) Route(method http.Method, handler http.Handler) *Function

func (*Routes) UseMiddleware

func (r *Routes) UseMiddleware(function middleware.Function, options ...middleware.Option) *Routes

Jump to

Keyboard shortcuts

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