http

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllAsMiddleware

func AllAsMiddleware(ms ...any) []any

func AllAsRoute

func AllAsRoute(fs ...any) []any

func AsMiddleware

func AsMiddleware(f any) any

func AsRoute

func AsRoute(f any) any

AsRoute annotates the given constructor to state that it provides a route to the "handlers" group.

func NewHTTPRouter

func NewHTTPRouter(middlewares []Middleware, routes []Route, lc fx.Lifecycle, logger *zap.Logger) *mux.Router

func NewHTTPServer

func NewHTTPServer(lc fx.Lifecycle, logger *zap.Logger, c *conf.Config, r *mux.Router) *http.Server

Types

type Middleware

type Middleware interface {
	Middleware(next http.Handler) http.Handler
}

type Route

type Route interface {
	http.Handler

	// Pattern reports the path at which this is registered.
	Pattern() string
}

Route is an http.Handler that knows the mux pattern under which it will be registered.

Jump to

Keyboard shortcuts

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