Documentation ¶
Index ¶
- func EncodePointerReference(reference string) string
- type Array
- type ArrayParsable
- type ArrayParser
- type Bool
- type ErrorReporter
- type Float64
- type Int
- type MetaReporter
- type Normalizable
- type Normalizer
- type Object
- type ObjectParsable
- type ObjectParser
- type Origin
- type OriginReporter
- type ParameterSource
- type PointerSource
- type Source
- type SourceReporter
- type String
- type StringArray
- type Time
- type Validatable
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePointerReference ¶
Types ¶
type ArrayParsable ¶
type ArrayParsable interface {
Parse(parser ArrayParser)
}
type ArrayParser ¶
type ArrayParser interface { OriginReporter SourceReporter MetaReporter ErrorReporter Exists() bool Parse(arrayParsable ArrayParsable) error References() []int ReferenceExists(reference int) bool Bool(reference int) *bool Float64(reference int) *float64 Int(reference int) *int String(reference int) *string StringArray(reference int) *[]string Time(reference int, layout string) *time.Time Object(reference int) *map[string]interface{} Array(reference int) *[]interface{} Interface(reference int) *interface{} NotParsed() error WithOrigin(origin Origin) ArrayParser WithSource(source Source) ArrayParser WithMeta(meta interface{}) ArrayParser WithReferenceObjectParser(reference int) ObjectParser WithReferenceArrayParser(reference int) ArrayParser }
type ErrorReporter ¶ added in v1.24.0
type Float64 ¶
type Float64 interface { Exists() Float64 NotExists() Float64 EqualTo(value float64) Float64 NotEqualTo(value float64) Float64 LessThan(limit float64) Float64 LessThanOrEqualTo(limit float64) Float64 GreaterThan(limit float64) Float64 GreaterThanOrEqualTo(limit float64) Float64 InRange(lowerLimit float64, upperLimit float64) Float64 OneOf(allowedValues ...float64) Float64 NotOneOf(disallowedValues ...float64) Float64 Using(using func(value float64, errorReporter ErrorReporter)) Float64 }
type Int ¶
type Int interface { Exists() Int NotExists() Int EqualTo(value int) Int NotEqualTo(value int) Int LessThan(limit int) Int LessThanOrEqualTo(limit int) Int GreaterThan(limit int) Int GreaterThanOrEqualTo(limit int) Int InRange(lowerLimit int, upperLimit int) Int OneOf(allowedValues ...int) Int NotOneOf(disallowedValues ...int) Int Using(using func(value int, errorReporter ErrorReporter)) Int }
type MetaReporter ¶ added in v1.24.0
type MetaReporter interface { HasMeta() bool Meta() interface{} }
type Normalizable ¶
type Normalizable interface {
Normalize(normalizer Normalizer)
}
type Normalizer ¶
type Normalizer interface { OriginReporter SourceReporter MetaReporter ErrorReporter Normalize(normalizable Normalizable) error WithOrigin(origin Origin) Normalizer WithSource(source Source) Normalizer WithMeta(meta interface{}) Normalizer WithReference(reference string) Normalizer }
type ObjectParsable ¶
type ObjectParsable interface {
Parse(parser ObjectParser)
}
type ObjectParser ¶
type ObjectParser interface { OriginReporter SourceReporter MetaReporter ErrorReporter Exists() bool Parse(objectParsable ObjectParsable) error References() []string ReferenceExists(reference string) bool Bool(reference string) *bool Float64(reference string) *float64 Int(reference string) *int String(reference string) *string StringArray(reference string) *[]string Time(reference string, layout string) *time.Time Object(reference string) *map[string]interface{} Array(reference string) *[]interface{} Interface(reference string) *interface{} NotParsed() error WithOrigin(origin Origin) ObjectParser WithSource(source Source) ObjectParser WithMeta(meta interface{}) ObjectParser WithReferenceObjectParser(reference string) ObjectParser WithReferenceArrayParser(reference string) ArrayParser }
type OriginReporter ¶ added in v1.24.0
type OriginReporter interface {
Origin() Origin
}
type ParameterSource ¶
type ParameterSource struct {
// contains filtered or unexported fields
}
func NewParameterSource ¶
func NewParameterSource() *ParameterSource
func (*ParameterSource) Parameter ¶
func (p *ParameterSource) Parameter() string
func (*ParameterSource) Pointer ¶
func (p *ParameterSource) Pointer() string
func (*ParameterSource) WithReference ¶
func (p *ParameterSource) WithReference(reference string) Source
type PointerSource ¶
type PointerSource struct {
// contains filtered or unexported fields
}
func NewPointerSource ¶
func NewPointerSource() *PointerSource
func (*PointerSource) Parameter ¶
func (p *PointerSource) Parameter() string
func (*PointerSource) Pointer ¶
func (p *PointerSource) Pointer() string
func (*PointerSource) WithReference ¶
func (p *PointerSource) WithReference(reference string) Source
type SourceReporter ¶ added in v1.24.0
type String ¶
type String interface { Exists() String NotExists() String Empty() String NotEmpty() String EqualTo(value string) String NotEqualTo(value string) String LengthEqualTo(limit int) String LengthNotEqualTo(limit int) String LengthLessThan(limit int) String LengthLessThanOrEqualTo(limit int) String LengthGreaterThan(limit int) String LengthGreaterThanOrEqualTo(limit int) String LengthInRange(lowerLimit int, upperLimit int) String OneOf(allowedValues ...string) String NotOneOf(disallowedValues ...string) String Matches(expression *regexp.Regexp) String NotMatches(expression *regexp.Regexp) String Using(using func(value string, errorReporter ErrorReporter)) String AsTime(layout string) Time }
type StringArray ¶
type StringArray interface { Exists() StringArray NotExists() StringArray Empty() StringArray NotEmpty() StringArray LengthEqualTo(limit int) StringArray LengthNotEqualTo(limit int) StringArray LengthLessThan(limit int) StringArray LengthLessThanOrEqualTo(limit int) StringArray LengthGreaterThan(limit int) StringArray LengthGreaterThanOrEqualTo(limit int) StringArray LengthInRange(lowerLimit int, upperLimit int) StringArray EachNotEmpty() StringArray EachOneOf(allowedValues ...string) StringArray EachNotOneOf(disallowedValues ...string) StringArray EachMatches(expression *regexp.Regexp) StringArray EachNotMatches(expression *regexp.Regexp) StringArray Using(using func(value []string, errorReporter ErrorReporter)) StringArray }
type Validatable ¶
type Validatable interface {
Validate(validator Validator)
}
type Validator ¶
type Validator interface { OriginReporter SourceReporter MetaReporter ErrorReporter Validate(validatable Validatable) error Bool(reference string, value *bool) Bool Float64(reference string, value *float64) Float64 Int(reference string, value *int) Int String(reference string, value *string) String StringArray(reference string, value *[]string) StringArray Time(reference string, value *time.Time) Time Object(reference string, value *map[string]interface{}) Object Array(reference string, value *[]interface{}) Array WithOrigin(origin Origin) Validator WithSource(source Source) Validator WithMeta(meta interface{}) Validator WithReference(reference string) Validator }
Click to show internal directories.
Click to hide internal directories.