Documentation ¶
Index ¶
- func H(h HandlerFunc) gin.HandlerFunc
- type Callback
- type Context
- func (c *Context) AbortBadRequest(mods ...ModErrorOption)
- func (c *Context) AbortForbidden(mods ...ModErrorOption)
- func (c *Context) AbortInternal(mods ...ModErrorOption)
- func (c *Context) AbortMethodNotAllowed(mods ...ModErrorOption)
- func (c *Context) AbortNotFound(mods ...ModErrorOption)
- func (c *Context) AbortUnauthorized(mods ...ModErrorOption)
- func (c *Context) AbortUnprocessable(mods ...ModErrorOption)
- func (c *Context) Collection(items []fractal.Any, transformer fractal.Transformer, callbacks ...Callback)
- func (c *Context) Error(opt *ErrorOption, status int)
- func (c *Context) ErrorBadRequest(mods ...ModErrorOption)
- func (c *Context) ErrorForbidden(mods ...ModErrorOption)
- func (c *Context) ErrorInternal(mods ...ModErrorOption)
- func (c *Context) ErrorMethodNotAllowed(mods ...ModErrorOption)
- func (c *Context) ErrorNotFound(mods ...ModErrorOption)
- func (c *Context) ErrorUnauthorized(mods ...ModErrorOption)
- func (c *Context) ErrorUnprocessable(mods ...ModErrorOption)
- func (c *Context) Item(item fractal.Any, transformer fractal.Transformer, callbacks ...Callback)
- func (c *Context) NoContent()
- func (c *Context) Paginator(paginator Paginator, transformer fractal.Transformer, callbacks ...Callback)
- type ErrorOption
- type HandlerFunc
- type ModErrorOption
- type Paginator
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
Context gin context with fractal extension
func (*Context) AbortBadRequest ¶
func (c *Context) AbortBadRequest(mods ...ModErrorOption)
AbortBadRequest return a 400 error and abort
func (*Context) AbortForbidden ¶
func (c *Context) AbortForbidden(mods ...ModErrorOption)
AbortForbidden return a 403 error and abort
func (*Context) AbortInternal ¶
func (c *Context) AbortInternal(mods ...ModErrorOption)
AbortInternal return a 500 error and abort
func (*Context) AbortMethodNotAllowed ¶
func (c *Context) AbortMethodNotAllowed(mods ...ModErrorOption)
AbortMethodNotAllowed return a 405 error and abort
func (*Context) AbortNotFound ¶
func (c *Context) AbortNotFound(mods ...ModErrorOption)
AbortNotFound return a 404 error and abort
func (*Context) AbortUnauthorized ¶
func (c *Context) AbortUnauthorized(mods ...ModErrorOption)
AbortUnauthorized return a 401 error and abort
func (*Context) AbortUnprocessable ¶
func (c *Context) AbortUnprocessable(mods ...ModErrorOption)
AbortUnprocessable return a 422 error and abort
func (*Context) Collection ¶
func (*Context) ErrorBadRequest ¶
func (c *Context) ErrorBadRequest(mods ...ModErrorOption)
ErrorBadRequest return a 400 error
func (*Context) ErrorForbidden ¶
func (c *Context) ErrorForbidden(mods ...ModErrorOption)
ErrorForbidden return a 403 error
func (*Context) ErrorInternal ¶
func (c *Context) ErrorInternal(mods ...ModErrorOption)
ErrorInternal return a 500 error
func (*Context) ErrorMethodNotAllowed ¶
func (c *Context) ErrorMethodNotAllowed(mods ...ModErrorOption)
ErrorMethodNotAllowed return a 405 error
func (*Context) ErrorNotFound ¶
func (c *Context) ErrorNotFound(mods ...ModErrorOption)
ErrorNotFound return a 404 error
func (*Context) ErrorUnauthorized ¶
func (c *Context) ErrorUnauthorized(mods ...ModErrorOption)
ErrorUnauthorized return a 401 error
func (*Context) ErrorUnprocessable ¶
func (c *Context) ErrorUnprocessable(mods ...ModErrorOption)
ErrorUnprocessable return a 422 error
type ErrorOption ¶
ErrorOption options for error
type ModErrorOption ¶
type ModErrorOption func(*ErrorOption)
ModErrorOption function to modify error option
func WithValidatorError ¶
func WithValidatorError(err error, req Request) ModErrorOption
WithError change error message by error