Versions in this module Expand all Collapse all v0 v0.1.0 Jan 3, 2017 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 Tombstone = internal + var UpdatedField = Field + func VerifyPassword(hash interface{}, password []byte) bool + type AllOf []FieldValidator + func (v *AllOf) Compile() (err error) + func (v AllOf) Validate(value interface{}) (interface{}, error) + type And []Expression + func (e And) Match(payload map[string]interface{}) bool + type AnyOf []FieldValidator + func (v *AnyOf) Compile() (err error) + func (v AnyOf) Validate(value interface{}) (interface{}, error) + type Array struct + MaxLen int + MinLen int + ValuesValidator FieldValidator + func (v *Array) Compile() (err error) + func (v Array) Validate(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() error + type Dict struct + KeysValidator FieldValidator + MaxLen int + MinLen int + ValuesValidator FieldValidator + func (v *Dict) Compile() (err error) + func (v Dict) Validate(value interface{}) (interface{}, error) + type Equal struct + Field string + Value Value + func (e Equal) Match(payload map[string]interface{}) bool + type ErrorMap map[string][]interface + func (e ErrorMap) Error() string + type Exist struct + Field string + func (e Exist) Match(payload map[string]interface{}) bool + type Expression interface + Match func(payload map[string]interface{}) bool + type Field struct + Default interface{} + Dependency *PreQuery + 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() error + type FieldHandler func(ctx context.Context, value interface{}, params map[string]interface{}) (interface{}, error) + type FieldSerializer interface + Serialize func(value interface{}) (interface{}, error) + type FieldValidator interface + Validate func(value interface{}) (interface{}, error) + type Fields map[string]Field + type Float struct + Allowed []float64 + Boundaries *Boundaries + func (v Float) Validate(value interface{}) (interface{}, error) + type GreaterOrEqual struct + Field string + Value float64 + func (e GreaterOrEqual) Match(payload map[string]interface{}) bool + type GreaterThan struct + Field string + Value float64 + func (e GreaterThan) Match(payload map[string]interface{}) bool + type IP struct + StoreBinary bool + func (v IP) Serialize(value interface{}) (interface{}, error) + func (v IP) Validate(value interface{}) (interface{}, error) + type In struct + Field string + Values []Value + func (e In) Match(payload map[string]interface{}) bool + type Integer struct + Allowed []int + Boundaries *Boundaries + func (v Integer) Validate(value interface{}) (interface{}, error) + type LowerOrEqual struct + Field string + Value float64 + func (e LowerOrEqual) Match(payload map[string]interface{}) bool + type LowerThan struct + Field string + Value float64 + func (e LowerThan) Match(payload map[string]interface{}) bool + type NotEqual struct + Field string + Value Value + func (e NotEqual) Match(payload map[string]interface{}) bool + type NotExist struct + Field string + func (e NotExist) Match(payload map[string]interface{}) bool + type NotIn struct + Field string + Values []Value + func (e NotIn) Match(payload map[string]interface{}) bool + type Null []FieldValidator + func (v Null) Validate(value interface{}) (interface{}, error) + type Object struct + Schema *Schema + func (v *Object) Compile() error + func (v Object) Validate(value interface{}) (interface{}, error) + type Or []Expression + func (e Or) Match(payload map[string]interface{}) bool + 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 PreQuery struct + func Q(q string) *PreQuery + type Query []Expression + func NewQuery(q map[string]interface{}, validator Validator) (Query, error) + func ParseQuery(query string, validator Validator) (Query, error) + func (e Query) Match(payload map[string]interface{}) bool + type Reference struct + Path string + func (v Reference) Validate(value interface{}) (interface{}, error) + type Schema struct + Description string + Fields Fields + MaxLen int + MinLen int + func (s Schema) Compile() 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() (err error) + func (v String) Validate(value interface{}) (interface{}, error) + type Time struct + TimeLayouts []string + func (v *Time) Compile() (err error) + func (v Time) Validate(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{}) + type Value interface