Documentation
¶
Index ¶
- type App
- func (app *App) DELETE(path string, handler func(ctx Context)) error
- func (app *App) GET(path string, handler func(ctx Context)) error
- func (app *App) Group(path string) Group
- func (app *App) HEAD(path string, handler func(ctx Context)) error
- func (app *App) OPTIONS(path string, handler func(ctx Context)) error
- func (app *App) PATCH(path string, handler func(ctx Context)) error
- func (app *App) POST(path string, handler func(ctx Context)) error
- func (app *App) PUT(path string, handler func(ctx Context)) error
- func (app *App) Routes() *router.Routes
- func (app *App) Serve(port string)
- type Context
- type CtxRequest
- type CtxRequestParams
- func (ctx *CtxRequestParams) Bool(param string) (bool, error)
- func (ctx *CtxRequestParams) Float(param string) (float64, error)
- func (ctx *CtxRequestParams) Int(param string) (int, error)
- func (ctx *CtxRequestParams) String(param string) (string, error)
- func (ctx *CtxRequestParams) UUID(param string) (string, error)
- type CtxResponse
- type ErrorParamNotFound
- type ErrorParamNotIsT
- type Group
- func (g *Group) DELETE(path string, handler func(ctx Context)) error
- func (g *Group) GET(path string, handler func(ctx Context)) error
- func (g *Group) Group(path string) Group
- func (g *Group) HEAD(path string, handler func(ctx Context)) error
- func (g *Group) OPTIONS(path string, handler func(ctx Context)) error
- func (g *Group) PATCH(path string, handler func(ctx Context)) error
- func (g *Group) POST(path string, handler func(ctx Context)) error
- func (g *Group) PUT(path string, handler func(ctx Context)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
type Context ¶
type Context struct { Response CtxResponse Request CtxRequest }
type CtxRequest ¶
type CtxRequest struct { Raw *http.Request Params CtxRequestParams }
func (*CtxRequest) Body ¶
func (ctx *CtxRequest) Body() ([]byte, error)
Body returns the body data of the Request.
type CtxRequestParams ¶
type CtxRequestParams struct {
// contains filtered or unexported fields
}
func (*CtxRequestParams) Bool ¶
func (ctx *CtxRequestParams) Bool(param string) (bool, error)
Bool checks if the param exists and casts it to a bool.
Parameters:
- param: the name of the parameter to retrieve.
Return type:
- bool: the value of the parameter as a bool.
- error: an error of type ErrorParamNotFound if the parameter does not exist.
func (*CtxRequestParams) Float ¶
func (ctx *CtxRequestParams) Float(param string) (float64, error)
Float checks if the param exists and casts it to a float.
Parameters:
- param: the name of the parameter to retrieve.
Return type:
- float64: the value of the parameter as a float.
- error: an error of type ErrorParamNotFound if the parameter does not exist.
func (*CtxRequestParams) Int ¶
func (ctx *CtxRequestParams) Int(param string) (int, error)
Int checks if the param exists and casts it to an int.
Parameters:
- param: the name of the parameter to retrieve.
Return type:
- int: the value of the parameter as an int.
- error: an error of type ErrorParamNotFound if the parameter does not exist.
func (*CtxRequestParams) String ¶
func (ctx *CtxRequestParams) String(param string) (string, error)
String returns the value of a specified parameter as a string.
Parameters:
- param: the name of the parameter to retrieve.
Return type:
- string: the value of the parameter as a string.
- error: an error of type ErrorParamNotFound if the parameter does not exist.
func (*CtxRequestParams) UUID ¶
func (ctx *CtxRequestParams) UUID(param string) (string, error)
UUID checks if the param exists and casts it to a uuid.
Parameters:
- param: the name of the parameter to retrieve.
Return type:
- string: the value of the parameter as a uuid.
- error: an error of type ErrorParamNotFound if the parameter does not exist.
type CtxResponse ¶
type CtxResponse struct {
Raw *http.ResponseWriter
}
func (*CtxResponse) Html ¶
func (ctx *CtxResponse) Html(data string)
func (*CtxResponse) Json ¶
func (ctx *CtxResponse) Json(data interface{})
func (*CtxResponse) Status ¶
func (ctx *CtxResponse) Status(code types.StatusCode)
func (*CtxResponse) Text ¶
func (ctx *CtxResponse) Text(data string)
type ErrorParamNotFound ¶
type ErrorParamNotFound struct {
Param string
}
func (ErrorParamNotFound) Error ¶
func (err ErrorParamNotFound) Error() string
type ErrorParamNotIsT ¶
func (ErrorParamNotIsT) Error ¶
func (err ErrorParamNotIsT) Error() string