route

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 2 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Route
	Fallback(handler contractshttp.HandlerFunc)
	GlobalMiddleware(middlewares ...contractshttp.Middleware)
	Run(host ...string) error
	RunTLS(host ...string) error
	RunTLSWithCert(host, certFile, keyFile string) error
	ServeHTTP(writer http.ResponseWriter, request *http.Request)
}

type GroupFunc

type GroupFunc func(routes Route)

type Route

type Route interface {
	Group(handler GroupFunc)
	Prefix(addr string) Route
	Middleware(middlewares ...contractshttp.Middleware) Route

	Any(relativePath string, handler contractshttp.HandlerFunc)
	Get(relativePath string, handler contractshttp.HandlerFunc)
	Post(relativePath string, handler contractshttp.HandlerFunc)
	Delete(relativePath string, handler contractshttp.HandlerFunc)
	Patch(relativePath string, handler contractshttp.HandlerFunc)
	Put(relativePath string, handler contractshttp.HandlerFunc)
	Options(relativePath string, handler contractshttp.HandlerFunc)
	Resource(relativePath string, controller contractshttp.ResourceController)

	Static(relativePath, root string)
	StaticFile(relativePath, filepath string)
	StaticFS(relativePath string, fs http.FileSystem)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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