Documentation ¶
Index ¶
- Variables
- func CONNECT(path string, h HandlerFuncType)
- func DELETE(path string, h HandlerFuncType)
- func GET(path string, h HandlerFuncType)
- func HEAD(path string, h HandlerFuncType)
- func OPTIONS(path string, h HandlerFuncType)
- func PATCH(path string, h HandlerFuncType)
- func POST(path string, h HandlerFuncType)
- func PUT(path string, h HandlerFuncType)
- func Run(addr string)
- func Set404(h HandlerFuncType)
- func SetNotFoundHandler(h HandlerFuncType)
- func TRACE(path string, h HandlerFuncType)
- type Context
- type HandlerFuncType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MethodGET GET MethodGET methodType = "GET" // MethodHEAD HEAD MethodHEAD methodType = "HEAD" // MethodPOST POST MethodPOST methodType = "POST" // MethodPUT PUT MethodPUT methodType = "PUT" // MethodDELETE DELETE MethodDELETE methodType = "DELETE" // MethodCONNECT CONNECT MethodCONNECT methodType = "CONNECT" // MethodOPTIONS OPTIONS MethodOPTIONS methodType = "OPTIONS" // MethodTRACE TRACE MethodTRACE methodType = "TRACE" // MethodPATCH PATCH MethodPATCH methodType = "PATCH" )
methods
Functions ¶
func CONNECT ¶
func CONNECT(path string, h HandlerFuncType)
CONNECT handles a page when the method is CONNECT
func DELETE ¶
func DELETE(path string, h HandlerFuncType)
DELETE handles a page when the method is DELETE
func OPTIONS ¶
func OPTIONS(path string, h HandlerFuncType)
OPTIONS handles a page when the method is OPTIONS
func PATCH ¶
func PATCH(path string, h HandlerFuncType)
PATCH handles a page when the method is PATCH
func Set404 ¶
func Set404(h HandlerFuncType)
Set404 shows a page that shows what you programmed when the path is not declared
func SetNotFoundHandler ¶
func SetNotFoundHandler(h HandlerFuncType)
SetNotFoundHandler shows a page that shows what you programmed when the path is not declared It the same with Set404 function.
func TRACE ¶
func TRACE(path string, h HandlerFuncType)
TRACE handles a page when the method is TRACE
Types ¶
type Context ¶
type Context struct { // Request is the same with *http.Request Request *http.Request // ToText makes html to text/plain ToText func(int, string) (int, string) // SetHeader sets the header value corresponding to the key SetHeader func(string, string) // GetFormValue gets the form value corresponding to the key GetFormValue func(string) string // GetFormFile gets the form file corresponding to the key GetFormFile func(string) (multipart.File, *multipart.FileHeader, error) }
Context context
type HandlerFuncType ¶
Click to show internal directories.
Click to hide internal directories.