route

package
v1.0.0-...-a0f063d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupFunc

type GroupFunc func(routes IRoute)

type IRoute

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

	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)
}

type IRouteEngine

type IRouteEngine interface {
	IRoute
	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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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