Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface {
// Request returns `*http.Request`.
Request() *http.Request
// Get retrieves data from the context.
Get(key any) any
// Set saves data in the context.
Set(key any, val any)
// Response returns `http.ResponseWriter`.
Response() http.ResponseWriter
// NoContent sends a response with no body and a status code.
NoContent(code int) error
// String sends a string response with status code.
String(code int, s string) error
// JSON sends a JSON response with status code.
JSON(code int, data any) error
// Bind binds path params, query params and the request body into provided type `i`. The default binder
// binds body based on Content-Type header.
Bind(i any) error
// Error sends an error back to the client.
Error(code int, err error)
// Done returns a channel that's closed when work done on behalf of this
// context should be canceled.
Done() <-chan any
}
type HandlerFunc ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
Click to show internal directories.
Click to hide internal directories.