Documentation
¶
Index ¶
- Variables
- type Context
- type ErrorCategory
- func (c ErrorCategory) Err(validatorName string, group, key string, line, column int, message string) *ValidationError
- func (c ErrorCategory) ErrForField(validatorName, errName string, field model.Field, line, column int, ...) *ValidationError
- func (c ErrorCategory) ErrSlice(validatorName, errName string, field model.Field, line, column int, ...) []ValidationError
- func (c ErrorCategory) ErrWithName(validatorName, errName, group, key string, line, column int, message string) *ValidationError
- type Level
- type Location
- type Options
- type Rule
- type ValidationError
- type ValidationErrors
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnknownKey = NewErrorCategory("unknown-key", LevelError) RequiredKey = NewErrorCategory("required-key", LevelError) KeyConflict = NewErrorCategory("key-conflict", LevelError) InvalidValue = NewErrorCategory("invalid-value", LevelError) DeprecatedKey = NewErrorCategory("deprecated-key", LevelWarning) UnsatisfiedDependency = NewErrorCategory("unsatisfied-dependency", LevelError) InvalidReference = NewErrorCategory("invalid-reference", LevelError) )
Functions ¶
This section is empty.
Types ¶
type ErrorCategory ¶
func NewErrorCategory ¶
func NewErrorCategory(name string, level Level) ErrorCategory
func (ErrorCategory) Err ¶
func (c ErrorCategory) Err(validatorName string, group, key string, line, column int, message string) *ValidationError
func (ErrorCategory) ErrForField ¶
func (c ErrorCategory) ErrForField(validatorName, errName string, field model.Field, line, column int, message string) *ValidationError
func (ErrorCategory) ErrSlice ¶
func (c ErrorCategory) ErrSlice(validatorName, errName string, field model.Field, line, column int, message string) []ValidationError
func (ErrorCategory) ErrWithName ¶
func (c ErrorCategory) ErrWithName(validatorName, errName, group, key string, line, column int, message string) *ValidationError
type ValidationError ¶
type ValidationError struct {
ErrorCategory
Location
Error error
ValidatorName string
Group string
Key string
ErrorName string
}
func (ValidationError) String ¶
func (err ValidationError) String() string
type ValidationErrors ¶
type ValidationErrors map[string][]ValidationError
func (ValidationErrors) AddError ¶
func (errors ValidationErrors) AddError(filePath string, err ...ValidationError)
func (ValidationErrors) HasErrors ¶
func (errors ValidationErrors) HasErrors() bool
func (ValidationErrors) Merge ¶
func (errors ValidationErrors) Merge(other ValidationErrors) ValidationErrors
func (ValidationErrors) WhereLevel ¶
func (errors ValidationErrors) WhereLevel(level Level) []ValidationError
Click to show internal directories.
Click to hide internal directories.