Documentation
¶
Index ¶
- type AnySchema
- func (self *AnySchema) Enum(values ...any) *AnySchema
- func (self AnySchema) MarshalJSON() ([]byte, error)
- func (self *AnySchema) Required() *AnySchema
- func (self *AnySchema) Rule(key string, value any, rule RuleFn) *AnySchema
- func (self AnySchema) Type() string
- func (self AnySchema) Validate(value any) error
- type Error
- type FloatSchema
- func (self *FloatSchema) Enum(values ...float64) *FloatSchema
- func (self FloatSchema) MarshalJSON() ([]byte, error)
- func (self *FloatSchema) Max(max float64) *FloatSchema
- func (self *FloatSchema) Min(min float64) *FloatSchema
- func (self *FloatSchema) Required() *FloatSchema
- func (self *FloatSchema) Rule(key string, value any, rule RuleFn) *FloatSchema
- func (FloatSchema) Type() string
- func (self FloatSchema) Validate(value any) error
- type IntSchema
- func (self *IntSchema) Enum(values ...int) *IntSchema
- func (self IntSchema) MarshalJSON() ([]byte, error)
- func (self *IntSchema) Max(max int) *IntSchema
- func (self *IntSchema) Min(min int) *IntSchema
- func (self *IntSchema) Required() *IntSchema
- func (self *IntSchema) Rule(key string, value any, rule RuleFn) *IntSchema
- func (self IntSchema) Type() string
- func (self IntSchema) Validate(value any) error
- type ObjectSchema
- func (self *ObjectSchema) Field(key string, schema Schema) *ObjectSchema
- func (self ObjectSchema) MarshalJSON() ([]byte, error)
- func (self *ObjectSchema) Required() *ObjectSchema
- func (self *ObjectSchema) Rule(key string, value any, rule RuleFn) *ObjectSchema
- func (self ObjectSchema) Type() string
- func (self ObjectSchema) Validate(value any) error
- type Rule
- type RuleFn
- type Schema
- type StringSchema
- func (self *StringSchema) Email() *StringSchema
- func (self *StringSchema) Enum(values ...string) *StringSchema
- func (self StringSchema) MarshalJSON() ([]byte, error)
- func (self *StringSchema) Max(max int) *StringSchema
- func (self *StringSchema) Min(min int) *StringSchema
- func (self *StringSchema) Regex(re *regexp.Regexp) *StringSchema
- func (self *StringSchema) Required() *StringSchema
- func (self *StringSchema) Rule(key string, value any, rule RuleFn) *StringSchema
- func (self StringSchema) Type() string
- func (self *StringSchema) URL() *StringSchema
- func (self *StringSchema) UUID() *StringSchema
- func (self StringSchema) Validate(value any) error
- type TimeSchema
- func (self *TimeSchema) Layout(layout string) *TimeSchema
- func (self TimeSchema) MarshalJSON() ([]byte, error)
- func (self *TimeSchema) Max(max time.Time) *TimeSchema
- func (self *TimeSchema) Min(min time.Time) *TimeSchema
- func (self *TimeSchema) Required() *TimeSchema
- func (self *TimeSchema) Rule(key string, value any, rule RuleFn) *TimeSchema
- func (self TimeSchema) Type() string
- func (self TimeSchema) Validate(value any) error
- type UnionSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnySchema ¶
type AnySchema struct {
// contains filtered or unexported fields
}
func (AnySchema) MarshalJSON ¶
type Error ¶
type FloatSchema ¶
type FloatSchema struct {
// contains filtered or unexported fields
}
func Float ¶
func Float() *FloatSchema
func (*FloatSchema) Enum ¶
func (self *FloatSchema) Enum(values ...float64) *FloatSchema
func (FloatSchema) MarshalJSON ¶
func (self FloatSchema) MarshalJSON() ([]byte, error)
func (*FloatSchema) Max ¶
func (self *FloatSchema) Max(max float64) *FloatSchema
func (*FloatSchema) Min ¶
func (self *FloatSchema) Min(min float64) *FloatSchema
func (*FloatSchema) Required ¶
func (self *FloatSchema) Required() *FloatSchema
func (*FloatSchema) Rule ¶
func (self *FloatSchema) Rule(key string, value any, rule RuleFn) *FloatSchema
func (FloatSchema) Type ¶
func (FloatSchema) Type() string
func (FloatSchema) Validate ¶
func (self FloatSchema) Validate(value any) error
type IntSchema ¶
type IntSchema struct {
// contains filtered or unexported fields
}
func (IntSchema) MarshalJSON ¶
type ObjectSchema ¶
type ObjectSchema struct {
// contains filtered or unexported fields
}
func Object ¶
func Object() *ObjectSchema
func (*ObjectSchema) Field ¶
func (self *ObjectSchema) Field(key string, schema Schema) *ObjectSchema
func (ObjectSchema) MarshalJSON ¶
func (self ObjectSchema) MarshalJSON() ([]byte, error)
func (*ObjectSchema) Required ¶
func (self *ObjectSchema) Required() *ObjectSchema
func (*ObjectSchema) Rule ¶
func (self *ObjectSchema) Rule(key string, value any, rule RuleFn) *ObjectSchema
func (ObjectSchema) Type ¶
func (self ObjectSchema) Type() string
func (ObjectSchema) Validate ¶
func (self ObjectSchema) Validate(value any) error
type StringSchema ¶
type StringSchema struct {
// contains filtered or unexported fields
}
func String ¶
func String() *StringSchema
func (*StringSchema) Email ¶
func (self *StringSchema) Email() *StringSchema
func (*StringSchema) Enum ¶
func (self *StringSchema) Enum(values ...string) *StringSchema
func (StringSchema) MarshalJSON ¶
func (self StringSchema) MarshalJSON() ([]byte, error)
func (*StringSchema) Max ¶
func (self *StringSchema) Max(max int) *StringSchema
func (*StringSchema) Min ¶
func (self *StringSchema) Min(min int) *StringSchema
func (*StringSchema) Regex ¶
func (self *StringSchema) Regex(re *regexp.Regexp) *StringSchema
func (*StringSchema) Required ¶
func (self *StringSchema) Required() *StringSchema
func (*StringSchema) Rule ¶
func (self *StringSchema) Rule(key string, value any, rule RuleFn) *StringSchema
func (StringSchema) Type ¶
func (self StringSchema) Type() string
func (*StringSchema) URL ¶
func (self *StringSchema) URL() *StringSchema
func (*StringSchema) UUID ¶
func (self *StringSchema) UUID() *StringSchema
func (StringSchema) Validate ¶
func (self StringSchema) Validate(value any) error
type TimeSchema ¶
type TimeSchema struct {
// contains filtered or unexported fields
}
func Time ¶
func Time() *TimeSchema
func (*TimeSchema) Layout ¶
func (self *TimeSchema) Layout(layout string) *TimeSchema
func (TimeSchema) MarshalJSON ¶
func (self TimeSchema) MarshalJSON() ([]byte, error)
func (*TimeSchema) Max ¶
func (self *TimeSchema) Max(max time.Time) *TimeSchema
func (*TimeSchema) Min ¶
func (self *TimeSchema) Min(min time.Time) *TimeSchema
func (*TimeSchema) Required ¶
func (self *TimeSchema) Required() *TimeSchema
func (*TimeSchema) Rule ¶
func (self *TimeSchema) Rule(key string, value any, rule RuleFn) *TimeSchema
func (TimeSchema) Type ¶
func (self TimeSchema) Type() string
func (TimeSchema) Validate ¶
func (self TimeSchema) Validate(value any) error
type UnionSchema ¶
type UnionSchema struct {
// contains filtered or unexported fields
}
func Union ¶
func Union(anyOf ...Schema) *UnionSchema
func (UnionSchema) MarshalJSON ¶
func (self UnionSchema) MarshalJSON() ([]byte, error)
func (*UnionSchema) Rule ¶
func (self *UnionSchema) Rule(key string, value any, rule RuleFn) *UnionSchema
func (UnionSchema) Type ¶
func (self UnionSchema) Type() string
func (UnionSchema) Validate ¶
func (self UnionSchema) Validate(value any) error
Click to show internal directories.
Click to hide internal directories.