Documentation ¶
Overview ¶
Package utils provides utilities to handle common activities such as logging, error handling, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log *log.MyLogger
Log serves as a wrapper around the underlying logging implementation to provide a consistent logging framework independent of underlying logger
View Source
var LogMiddleware echo.MiddlewareFunc
LogMiddleware serves as a wrapper around the underlying middleware logging implementation to provide a consistent logging framework independent of underlying logger
Functions ¶
Types ¶
type Error ¶
type Error struct {
Errors map[string]interface{} `json:"errors"`
}
func NewValidatorError ¶
func NewValidatorError(vErrors []ValidationError) Error
func ResourceNotFound ¶
func ResourceNotFound() Error
func Unauthorized ¶
func Unauthorized() Error
type ValidationError ¶
type ValidationError struct { Message string Field string Condition string ConditionParameters string ReceivedValue interface{} }
ValidationError represents a structured validation error object to be used on responses
func GetValidationErrors ¶
func GetValidationErrors(err validator.ValidationErrors) []ValidationError
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator defines the structure of the Validator object
func NewValidator ¶
func NewValidator() *Validator
NewValidator returns create a new validator object
Click to show internal directories.
Click to hide internal directories.