Documentation
¶
Overview ¶
schema/array/rules.go
schema/array/schema.go
schema/array/validate.go
Index ¶
- Constants
- type ItemValidator
- type Schema
- func (s *Schema[E]) Custom(ruleValue ruleset.RuleFn[[]E]) *Schema[E]
- func (s *Schema[E]) Default(value []E) *Schema[E]
- func (s *Schema[E]) DefaultFunc(fn func() []E) *Schema[E]
- func (s *Schema[E]) Eq(length int) *Schema[E]
- func (s *Schema[E]) Gt(length int) *Schema[E]
- func (s *Schema[E]) Gte(length int) *Schema[E]
- func (s *Schema[E]) Items(validator ItemValidator[E]) *Schema[E]
- func (s *Schema[E]) Len(length int) *Schema[E]
- func (s *Schema[E]) Lt(length int) *Schema[E]
- func (s *Schema[E]) Lte(length int) *Schema[E]
- func (s *Schema[E]) Max(length int) *Schema[E]
- func (s *Schema[E]) Min(length int) *Schema[E]
- func (s *Schema[E]) Ne(length int) *Schema[E]
- func (s *Schema[E]) OutputType() reflect.Type
- func (s *Schema[E]) Required() *Schema[E]
- func (s *Schema[E]) Unique() *Schema[E]
- func (s *Schema[E]) UniqueByEqual(equal func(left E, right E) bool) *Schema[E]
- func (s *Schema[E]) UniqueByHash(hash func(value E) string) *Schema[E]
- func (s *Schema[E]) Validate(input any, optionList ...schema.Option) ([]E, error)
- func (s *Schema[E]) ValidateAny(input any, options schema.Options) (any, error)
Constants ¶
View Source
const ( CodeRequired = "array.required" CodeType = "array.type" CodeMin = "array.min" CodeMax = "array.max" CodeItem = "array.item" CodeLen = "array.len" CodeEq = "array.eq" CodeNe = "array.ne" CodeGt = "array.gt" CodeGte = "array.gte" CodeLt = "array.lt" CodeLte = "array.lte" CodeUnique = "array.unique" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ItemValidator ¶
type Schema ¶
type Schema[E any] struct { // contains filtered or unexported fields }
func (*Schema[E]) DefaultFunc ¶
func (*Schema[E]) Items ¶
func (s *Schema[E]) Items(validator ItemValidator[E]) *Schema[E]
func (*Schema[E]) OutputType ¶
func (*Schema[E]) UniqueByEqual ¶
func (*Schema[E]) UniqueByHash ¶
Click to show internal directories.
Click to hide internal directories.