middleware

package
v0.2.82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleErrors

func HandleErrors() gin.HandlerFunc

Handle returns middleware that returns json error messages when request ended with non-200

func HandleLogging added in v0.1.285

func HandleLogging(config *config.Config) gin.HandlerFunc

func HandleRequestId

func HandleRequestId() gin.HandlerFunc

Adds request id to logs, fills in logger

func HandleTimeout

func HandleTimeout(timeout time.Duration) gin.HandlerFunc

Starts a separate goroutine to process the c.Next() callback If it returns within timeout does nothing

Types

type ErrorInfo

type ErrorInfo struct {
	Code    int
	Message string
}

func (ErrorInfo) Error

func (self ErrorInfo) Error() string

type ErrorResponse

type ErrorResponse struct {
	RequestId string
	Timestamp time.Time
	Errors    []ErrorInfo
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL