json

package
v0.0.0-...-84e4e40 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultJoiner = joiner{}

DefaultJoiner if the default implementation of the PathBuilder interface.

Functions

func DefaultFormatter

func DefaultFormatter(e validation.Error) string

DefaultFormatter is the default validation error message formatter.

func New

func New(errors validation.Errors, formatter Formatter, joiner Joiner) json.Marshaler

New creates new json serializable error from validation errors.

Types

type Formatter

type Formatter func(validation.Error) string

Formatter represents valdation error message formatter.

type Joiner

type Joiner interface {
	Struct(base, child string) string
	Slice(base string, index int) string
}

Joiner defines interface for building path to an item in the validation errors tree.

Jump to

Keyboard shortcuts

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