Documentation
¶
Overview ¶
Package goserver provide request router with middleware
Index ¶
Constants ¶
View Source
const ( GET = "GET" POST = "POST" PUT = "PUT" DELETE = "DELETE" PATCH = "PATCH" OPTIONS = "OPTIONS" )
HTTP methods constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiddlewareFunc ¶
MiddlewareFunc handles middleware logics
type Params ¶
type Params []Param
Params slice returned from request context
func ParamsFromContext ¶
ParamsFromContext return parameters from request context
type Server ¶
type Server interface {
POST(path string, f http.HandlerFunc)
GET(path string, f http.HandlerFunc)
PUT(path string, f http.HandlerFunc)
DELETE(path string, f http.HandlerFunc)
PATCH(path string, f http.HandlerFunc)
OPTIONS(path string, f http.HandlerFunc)
USE(method, path string, fs ...MiddlewareFunc)
ServeHTTP(http.ResponseWriter, *http.Request)
ServeFiles(path string, strip bool)
NotFound(http.Handler)
NotAllowed(http.Handler)
}
Server interface
Click to show internal directories.
Click to hide internal directories.