decoder

package
v0.0.0-...-0fda810 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Unwrap = errors.Unwrap

Functions

func Decode

func Decode(item Validatable, data io.Reader) error

Decode is used to unmarshall the given data into an object

func IsValidationError

func IsValidationError(err error) bool

IsValidationError checkIfAnError is a validation error

func NewValidationError

func NewValidationError(message string) error

NewValidationError creates a new ValidationError

func Wrap

func Wrap(errorContext string, err error) error

Wrap adds extra information related

Types

type Validatable

type Validatable interface {
	Validate() error
}

Validatable represents an item that has constraints on what a correct structure is an imposes these constraints through the Validate method

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError represents an issue with value setting on a struct

func (*ValidationError) Error

func (v *ValidationError) Error() string

Jump to

Keyboard shortcuts

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