route

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 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 GroupFunc

type GroupFunc func(router Router)

type Route

type Route interface {
	Router
	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 Router added in v1.13.1

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

	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