router

package
v0.0.0-...-35a4376 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPRouter

type HTTPRouter interface {
	http.Handler

	Init() HTTPRouter

	UseMiddlewares(middlewares ...Middleware)
	MountRoutes(handlers ...RouteHandler)
}

func NewHTTPRouter

func NewHTTPRouter[Router HTTPRouter](options ...Option) HTTPRouter

type Middleware

type Middleware func(http.Handler) http.Handler

type Middlewares

type Middlewares []Middleware

type Option

type Option func(router HTTPRouter)

func WithMiddlewares

func WithMiddlewares(middlewares ...Middleware) Option

func WithMountRaw

func WithMountRaw[Router HTTPRouter](customRoutes func(r Router)) Option

func WithRouteHandlers

func WithRouteHandlers(handlers ...RouteHandler) Option

type PathsExclude

type PathsExclude []string

func (PathsExclude) Excluded

func (e PathsExclude) Excluded(u *url.URL) bool

type RouteHandler

type RouteHandler func() (method http_method.HTTPMethod, pattern string, handler http.HandlerFunc)

type RouteHandlers

type RouteHandlers []RouteHandler

type Server

type Server struct {
	*http.Server
}

func NewServer

func NewServer(router HTTPRouter) *Server

func (Server) Type

func (s Server) Type() string

Directories

Path Synopsis
middleware

Jump to

Keyboard shortcuts

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