httpErrors

package
v0.0.0-...-3bf3187 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadRequest       string = "BAD_REQUEST"
	NotFound         string = "NOT_FOUND"
	NotRequiredField string = "NOT_REQUIRED_FIELD"
	BadQueryParams   string = "BAD_QUERY_PARAMS"
	RequestTimeOut   string = "REQUEST_TIMEOUT"
	InternalServer   string = "INTERNAL_SERVER_ERROR"
)

Functions

func ErrResponseWithLog

func ErrResponseWithLog(ctx echo.Context, logger logger.Logger, err error) error

func GetIPAddress

func GetIPAddress(c echo.Context) string

Get user ip address

func GetRequestID

func GetRequestID(c echo.Context) string

Get request id from echo context

Types

type ErrorMessage

type ErrorMessage struct {
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
}

func ErrResponse

func ErrResponse(err error) (int, *ErrorMessage)

func NewErrorMessage

func NewErrorMessage(message string, code int) (int, *ErrorMessage)

NewErrorMessage

Jump to

Keyboard shortcuts

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