Versions in this module Expand all Collapse all v0 v0.2.1 May 22, 2024 v0.2.0 Mar 25, 2024 v0.1.0 Jan 12, 2023 Changes in this version + const ErrCodeInternal + const ErrCodeSuccess + const ErrCodeTooManyRequests + const ErrCodeValidation + func MustServe(config Config, factory RouteFactory, mws ...middlewares.Middleware) + func MustServeFromViper(factory RouteFactory, middlewares ...middlewares.Middleware) + func ResponseCsv(c *gin.Context, filename string, content [][]string) + func ResponseError(c *gin.Context, err error) + func ResponseSuccess(c *gin.Context, data interface{}) + func Wrap(controller func(c *gin.Context) (interface{}, error)) gin.HandlerFunc + type BusinessError struct + Code int + Data interface{} + Message string + func ErrInternal(err error) *BusinessError + func ErrTooManyRequests(err error) *BusinessError + func ErrValidation(err error) *BusinessError + func NewBusinessError(code int, message string, data interface{}) *BusinessError + func Success(data interface{}) *BusinessError + func (err *BusinessError) Error() string + type Config struct + CorsOrigins []string + Endpoint string + Logger bool + RecoveryDisabled bool + type RouteFactory func(router *gin.Engine)