Documentation ¶
Index ¶
- func AbortJSON(ctx *gin.Context, statusCode int, verdict string, message string, ...)
- func Authenticate(verifier auth.Verifier) gin.HandlerFunc
- func MaxBody(maxBytes int64) gin.HandlerFunc
- func Recovery() gin.HandlerFunc
- func RegisterTagNameFunc() bool
- func RequestIDMiddleware() gin.HandlerFunc
- func RequestTimeMiddleware() gin.HandlerFunc
- func SendError(ctx *gin.Context, _ error)
- func SendInvalidParameters(ctx *gin.Context, names []string)
- func SendJSON(ctx *gin.Context, statusCode int, verdict string, message string, ...)
- func SendSuccess(ctx *gin.Context, message string, data interface{})
- func SendValidationError(ctx *gin.Context, err error)
- func Setup()
- func Start(ctx context.Context, engine *gin.Engine, address string, options ...OptionFunc) error
- func TracingMiddleware(service string, opts ...otelgin.Option) gin.HandlerFunc
- type Field
- type Fields
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authenticate ¶
func Authenticate(verifier auth.Verifier) gin.HandlerFunc
Authenticate authenticate user
func Recovery ¶
func Recovery() gin.HandlerFunc
Recovery returns a middleware for a given writer that recovers from any panics and calls the provided handle func to handle it
func RegisterTagNameFunc ¶
func RegisterTagNameFunc() bool
RegisterTagNameFunc registers tags function
func RequestIDMiddleware ¶
func RequestIDMiddleware() gin.HandlerFunc
RequestIDMiddleware adds X-Request-ID value to request, response and save to context variable
func RequestTimeMiddleware ¶
func RequestTimeMiddleware() gin.HandlerFunc
RequestTimeMiddleware logs request time
func SendInvalidParameters ¶
SendInvalidParameters sends invalid parameters
func SendSuccess ¶
SendSuccess sends success response
func SendValidationError ¶
SendValidationError sends validation error response to client
func TracingMiddleware ¶
func TracingMiddleware(service string, opts ...otelgin.Option) gin.HandlerFunc
TracingMiddleware adds tracing into gin's middlewares by using otelgin.Middleware function
Types ¶
type Field ¶
func GetUnmarshalErrorParameters ¶
GetUnmarshalErrorParameters returns list of invalid parameters
type Fields ¶
type Fields []*Field
func GetInvalidParameters ¶
GetInvalidParameters gets list of invalid parameters