route

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 2 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

type GroupFunc

type GroupFunc func(routes Route)

type Route

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

	Any(relativePath string, handler httpcontract.HandlerFunc)
	Get(relativePath string, handler httpcontract.HandlerFunc)
	Post(relativePath string, handler httpcontract.HandlerFunc)
	Delete(relativePath string, handler httpcontract.HandlerFunc)
	Patch(relativePath string, handler httpcontract.HandlerFunc)
	Put(relativePath string, handler httpcontract.HandlerFunc)
	Options(relativePath string, handler httpcontract.HandlerFunc)

	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