Documentation ¶
Index ¶
- func IsBoolean(key string, value interface{}) error
- func IsDecimal(key string, value interface{}) error
- func IsDecimalBetweenZeroAndOne(key string, value interface{}) error
- func IsDecimalWithInclusiveBounds(key string, value interface{}, minValue float64, maxValue float64) error
- func IsInteger(key string, value interface{}) error
- func IsIntegerWithInclusiveBounds(key string, value interface{}, minValue int64, maxValue int64) error
- func IsNonNegativeDecimal(key string, value interface{}) error
- func IsNonNegativeInteger(key string, value interface{}) error
- func IsReadableFile(key string, value interface{}) error
- func IsString(key string, value interface{}) error
- type MissingSpecificationError
- type SpecValidator
- type Specification
- type Specifications
- type ValidSpecificationError
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNonNegativeDecimal ¶
func IsNonNegativeInteger ¶
func IsReadableFile ¶
Types ¶
type MissingSpecificationError ¶
type MissingSpecificationError struct {
// contains filtered or unexported fields
}
func NewSpecificationMissingError ¶
func NewSpecificationMissingError(key string) *MissingSpecificationError
func (*MissingSpecificationError) Error ¶
func (m *MissingSpecificationError) Error() string
func (*MissingSpecificationError) IsValid ¶
func (m *MissingSpecificationError) IsValid() bool
type SpecValidator ¶
type Specification ¶
type Specification struct { Key string Validator SpecValidator DefaultValue interface{} IsOptional bool }
type Specifications ¶
type Specifications map[string]Specification
func NewSpecifications ¶
func NewSpecifications() *Specifications
func (Specifications) Add ¶
func (s Specifications) Add(spec Specification) Specifications
func (Specifications) HasEntry ¶
func (s Specifications) HasEntry(key string) bool
func (Specifications) Keys ¶
func (s Specifications) Keys() []string
func (Specifications) Validate ¶
func (s Specifications) Validate(key string, value interface{}) error
type ValidSpecificationError ¶
type ValidSpecificationError struct {
// contains filtered or unexported fields
}
func NewInvalidSpecificationError ¶
func NewInvalidSpecificationError(message string) *ValidSpecificationError
func NewValidSpecificationError ¶
func NewValidSpecificationError(key string, value interface{}) *ValidSpecificationError
func (*ValidSpecificationError) Error ¶
func (m *ValidSpecificationError) Error() string
func (*ValidSpecificationError) IsValid ¶
func (m *ValidSpecificationError) IsValid() bool
type ValidationError ¶
Click to show internal directories.
Click to hide internal directories.