Versions in this module Expand all Collapse all v0 v0.1.0 Apr 2, 2023 Changes in this version + var CreatedField = Field + var IDField = Field + var NewID = func(ctx context.Context, value interface{}) interface{} + var Now = func(ctx context.Context, value interface{}) interface{} + var PasswordField = Field + var SerialID = Field + var Tombstone = internal + var UpdatedField = Field + func VerifyPassword(hash interface{}, password []byte) bool + type AllOf []FieldValidator + func (v AllOf) Compile(rc ReferenceChecker) (err error) + func (v AllOf) GetField(name string) *Field + func (v AllOf) Validate(value interface{}) (interface{}, error) + func (v AllOf) ValidateQuery(value interface{}) (interface{}, error) + type AnyOf []FieldValidator + func (v AnyOf) Compile(rc ReferenceChecker) error + func (v AnyOf) GetField(name string) *Field + func (v AnyOf) LessFunc() LessFunc + func (v AnyOf) Serialize(value interface{}) (interface{}, error) + func (v AnyOf) Validate(value interface{}) (interface{}, error) + func (v AnyOf) ValidateQuery(value interface{}) (interface{}, error) + type Array struct + MaxLen int + MinLen int + Values Field + func (v *Array) Compile(rc ReferenceChecker) (err error) + func (v Array) GetField(name string) *Field + func (v Array) Validate(value interface{}) (interface{}, error) + func (v Array) ValidateQuery(value interface{}) (interface{}, error) + type Bool struct + func (v Bool) Validate(value interface{}) (interface{}, error) + type Boundaries struct + Max float64 + Min float64 + type Compiler interface + Compile func(rc ReferenceChecker) error + type Connection struct + Field string + Path string + Validator Validator + func (v *Connection) Validate(value interface{}) (interface{}, error) + type Dict struct + KeysValidator FieldValidator + MaxLen int + MinLen int + Values Field + func (v *Dict) Compile(rc ReferenceChecker) (err error) + func (v Dict) GetField(name string) *Field + func (v Dict) Validate(value interface{}) (interface{}, error) + type ErrorMap map[string][]interface + func (err ErrorMap) Error() string + func (err ErrorMap) Merge(other ErrorMap) + type ErrorSlice []error + func (err ErrorSlice) Append(other error) ErrorSlice + func (err ErrorSlice) Error() string + type Field struct + Default interface{} + Dependency Predicate + Description string + Filterable bool + Handler FieldHandler + Hidden bool + OnInit func(ctx context.Context, value interface{}) interface{} + OnUpdate func(ctx context.Context, value interface{}) interface{} + Params Params + ReadOnly bool + Required bool + Schema *Schema + Sortable bool + Validator FieldValidator + func (f Field) Compile(rc ReferenceChecker) error + type FieldComparator interface + LessFunc func() LessFunc + type FieldGetter interface + GetField func(name string) *Field + type FieldHandler func(ctx context.Context, value interface{}, params map[string]interface{}) (interface{}, error) + type FieldQueryValidator interface + ValidateQuery func(value interface{}) (interface{}, error) + type FieldSerializer interface + Serialize func(value interface{}) (interface{}, error) + type FieldValidator interface + Validate func(value interface{}) (interface{}, error) + type FieldValidatorFunc func(value interface{}) (interface{}, error) + func (f FieldValidatorFunc) Validate(value interface{}) (interface{}, error) + type Fields map[string]Field + type Float struct + Allowed []float64 + Boundaries *Boundaries + func (v Float) LessFunc() LessFunc + func (v Float) Validate(value interface{}) (interface{}, error) + func (v Float) ValidateQuery(value interface{}) (interface{}, error) + type IP struct + StoreBinary bool + func (v IP) Serialize(value interface{}) (interface{}, error) + func (v IP) Validate(value interface{}) (interface{}, error) + type Integer struct + Allowed []int + Boundaries *Boundaries + func (v Integer) LessFunc() LessFunc + func (v Integer) Validate(value interface{}) (interface{}, error) + func (v Integer) ValidateQuery(value interface{}) (interface{}, error) + type LessFunc func(value, other interface{}) bool + type Null []FieldValidator + func (v Null) Validate(value interface{}) (interface{}, error) + type Object struct + Schema *Schema + func (v *Object) Compile(rc ReferenceChecker) error + func (v Object) GetField(name string) *Field + func (v Object) Validate(value interface{}) (interface{}, error) + type Param struct + Description string + Validator FieldValidator + type Params map[string]Param + type Password struct + Cost int + MaxLen int + MinLen int + func (v Password) Validate(value interface{}) (interface{}, error) + type Predicate interface + Match func(payload map[string]interface{}) bool + Prepare func(v Validator) error + func Q() Predicate + type Reference struct + Path string + SchemaValidator Validator + func (r *Reference) Compile(rc ReferenceChecker) error + func (r Reference) GetField(name string) *Field + func (r Reference) Validate(value interface{}) (interface{}, error) + type ReferenceChecker interface + ReferenceChecker func(path string) (FieldValidator, Validator) + type ReferenceCheckerFunc func(path string) FieldValidator + func (f ReferenceCheckerFunc) ReferenceChecker(path string) FieldValidator + type Schema struct + Description string + Fields Fields + MaxLen int + MinLen int + func (s Schema) Compile(rc ReferenceChecker) error + func (s Schema) GetField(name string) *Field + func (s Schema) Prepare(ctx context.Context, payload map[string]interface{}, ...) (changes map[string]interface{}, base map[string]interface{}) + func (s Schema) Validate(changes map[string]interface{}, base map[string]interface{}) (doc map[string]interface{}, errs map[string][]interface{}) + type String struct + Allowed []string + MaxLen int + MinLen int + Regexp string + func (v *String) Compile(rc ReferenceChecker) (err error) + func (v String) Validate(value interface{}) (interface{}, error) + func (v String) ValidateQuery(value interface{}) (interface{}, error) + type Time struct + TimeLayouts []string + func (v *Time) Compile(rc ReferenceChecker) error + func (v Time) LessFunc() LessFunc + func (v Time) Validate(value interface{}) (interface{}, error) + func (v Time) ValidateQuery(value interface{}) (interface{}, error) + type URL struct + AllowLocale bool + AllowNonHTTP bool + AllowRelative bool + AllowedSchemes []string + func (v URL) Validate(value interface{}) (interface{}, error) + type Validator interface + GetField func(name string) *Field + Prepare func(ctx context.Context, payload map[string]interface{}, ...) (changes map[string]interface{}, base map[string]interface{}) + Validate func(changes map[string]interface{}, base map[string]interface{}) (doc map[string]interface{}, errs map[string][]interface{})