validate

package
v0.0.0-...-9ed9871 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidID = errors.New("id is not in its proper form")

Functions

func Cause

func Cause(err error) error

func Check

func Check(val any) error

func CheckID

func CheckID(id string) error

func Email

func Email(email string) error

func GenerateID

func GenerateID() string

func NewRequestError

func NewRequestError(err error, status int) error

Types

type ErrorResponse

type ErrorResponse struct {
	Error  string `json:"error"`
	Fields string `json:"fields,omitempty"`
}

type FieldError

type FieldError struct {
	Field string `json:"field"`
	Error string `json:"error"`
}

type FieldErrors

type FieldErrors []FieldError

func (*FieldErrors) Error

func (fe *FieldErrors) Error() string

type RequestError

type RequestError struct {
	Err    error
	Status int
	Fields error
}

func (*RequestError) Error

func (e *RequestError) Error() string

Jump to

Keyboard shortcuts

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