utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrResponseWithLog added in v1.1.0

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

Error response with logging error for echo context

func GetConfigPath

func GetConfigPath(configPath string) string

func GetCtxWithReqID added in v1.1.0

func GetCtxWithReqID(c echo.Context) (context.Context, context.CancelFunc)

Get ctx with timeout and request id from echo context

func GetIPAddress added in v1.1.0

func GetIPAddress(c echo.Context) string

Get user ip address

func GetRequestCtx added in v1.1.0

func GetRequestCtx(c echo.Context) context.Context

Get context with request id

func GetRequestID added in v1.1.0

func GetRequestID(c echo.Context) string

Get request id from echo context

func LogResponseError added in v1.1.0

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

Error response with logging error for echo context

func ReadRequest added in v1.1.1

func ReadRequest(ctx echo.Context, request interface{}) error

Read request body and validate

func ValidateStruct

func ValidateStruct(ctx context.Context, s interface{}) error

Validate struct fields

Types

type ReqIDCtxKey added in v1.1.0

type ReqIDCtxKey struct{}

ReqIDCtxKey is a key used for the Request ID in context

Jump to

Keyboard shortcuts

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