utils

package
v0.0.0-...-cf0febb Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanCPF

func CleanCPF(cpf string) string

func GetHTTPCode

func GetHTTPCode(err error) int

func ToJSON

func ToJSON(v interface{}) []byte

Types

type Error

type Error struct {
	HTTPCode int         `mapstructure:"code" json:"-"`
	Message  string      `mapstructure:"message" json:"message,omitempty"`
	Detail   interface{} `mapstructure:"detail,omitempty" swaggerignore:"true" json:"detail,omitempty"`
}

func GetError

func GetError(err error) *Error

func NewError

func NewError(httpCode int, message string, detail interface{}) *Error

func (*Error) Error

func (e *Error) Error() string

type Validator

type Validator interface {
	Validate(i interface{}) error
}

func NewValidator

func NewValidator() Validator

Jump to

Keyboard shortcuts

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