Documentation ¶
Index ¶
- Variables
- func Bind[TIn any](s Server, handler func(*gin.Context, TIn) error) gin.HandlerFunc
- func Created[TOut any](s Server, ctx *gin.Context, data TOut, location string, args ...any) error
- func File(ctx *gin.Context, filepath string) error
- func HandleError(s Server, ctx *gin.Context, err error)
- func NoContent(ctx *gin.Context) error
- func Ok[TOut any](ctx *gin.Context, data TOut) error
- func Send(s Server, handler func(*gin.Context) error) gin.HandlerFunc
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnexpected = apperr.New("unexpected_error") // Error returned when an infrastructure error occurs
Functions ¶
func Bind ¶
Bind the request to the given TIn and handle errors if any by setting the appropriate status.
func HandleError ¶ added in v1.1.0
Handle the given non-nil error and sets the status code based on error type.
Types ¶
Click to show internal directories.
Click to hide internal directories.