Documentation ¶
Overview ¶
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Code generated by mkunion. DO NOT EDIT.
Index ¶
- func AndShape() shape.Shape
- func AndToJSON(x *And) ([]byte, error)
- func BindValueShape() shape.Shape
- func BindValueToJSON(x *BindValue) ([]byte, error)
- func BindableShape() shape.Shape
- func BindableToJSON(x Bindable) ([]byte, error)
- func CompareShape() shape.Shape
- func CompareToJSON(x *Compare) ([]byte, error)
- func Evaluate[A any](predicate Predicate, data A, bind ParamBinds) bool
- func EvaluateEqual[A any](data A, location string, value any) bool
- func EvaluateEqualPrimitive(record schema.Schema, location string, value any) bool
- func EvaluateSchema(predicate Predicate, data schema.Schema, bind ParamBinds) bool
- func EvaluateShape(predicate Predicate, s shape.Shape, data schema.Schema, bind ParamBinds) bool
- func GetValue(x Bindable, params ParamBinds, data schema.Schema) (schema.Schema, bool)
- func LiteralShape() shape.Shape
- func LiteralToJSON(x *Literal) ([]byte, error)
- func LocatableShape() shape.Shape
- func LocatableToJSON(x *Locatable) ([]byte, error)
- func MatchBindable[TOut any](x Bindable, f1 func(x *BindValue) TOut, f2 func(x *Literal) TOut, ...) TOut
- func MatchBindableR2[TOut1, TOut2 any](x Bindable, f1 func(x *BindValue) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MatchPredicate[TOut any](x Predicate, f1 func(x *And) TOut, f2 func(x *Or) TOut, f3 func(x *Not) TOut, ...) TOut
- func MatchPredicateR2[TOut1, TOut2 any](x Predicate, f1 func(x *And) (TOut1, TOut2), f2 func(x *Or) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchBindable[TOut any](x Bindable, f1 func(x *BindValue) TOut, f2 func(x *Literal) TOut, ...) TOut
- func MustMatchBindableR0(x Bindable, f1 func(x *BindValue), f2 func(x *Literal), f3 func(x *Locatable))
- func MustMatchBindableR2[TOut1, TOut2 any](x Bindable, f1 func(x *BindValue) (TOut1, TOut2), ...) (TOut1, TOut2)
- func MustMatchPredicate[TOut any](x Predicate, f1 func(x *And) TOut, f2 func(x *Or) TOut, f3 func(x *Not) TOut, ...) TOut
- func MustMatchPredicateR0(x Predicate, f1 func(x *And), f2 func(x *Or), f3 func(x *Not), ...)
- func MustMatchPredicateR2[TOut1, TOut2 any](x Predicate, f1 func(x *And) (TOut1, TOut2), f2 func(x *Or) (TOut1, TOut2), ...) (TOut1, TOut2)
- func NotShape() shape.Shape
- func NotToJSON(x *Not) ([]byte, error)
- func OrShape() shape.Shape
- func OrToJSON(x *Or) ([]byte, error)
- func ParamBindsShape() shape.Shape
- func PredicateShape() shape.Shape
- func PredicateToJSON(x Predicate) ([]byte, error)
- func WherePredicatesShape() shape.Shape
- type And
- type BindName
- type BindValue
- type Bindable
- type BindableUnionJSON
- type BindableVisitor
- type Comparable
- type Compare
- type Condition
- type Expression
- type Literal
- type Locatable
- type Not
- type Or
- type OrCondition
- type ParamBinds
- type Predicate
- type PredicateUnionJSON
- type PredicateVisitor
- type Value
- type WherePredicates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindValueShape ¶ added in v1.21.0
func BindValueToJSON ¶ added in v1.21.0
func BindableShape ¶ added in v1.21.0
func BindableToJSON ¶ added in v1.21.0
func CompareShape ¶ added in v1.21.0
func CompareToJSON ¶ added in v1.21.0
func EvaluateEqualPrimitive ¶ added in v1.21.0
func EvaluateSchema ¶ added in v1.21.0
func EvaluateSchema(predicate Predicate, data schema.Schema, bind ParamBinds) bool
func EvaluateShape ¶ added in v1.21.0
func LiteralShape ¶ added in v1.21.0
func LiteralToJSON ¶ added in v1.21.0
func LocatableShape ¶ added in v1.21.0
func LocatableToJSON ¶ added in v1.21.0
func MatchBindable ¶ added in v1.21.0
func MatchBindableR2 ¶ added in v1.21.0
func MatchPredicate ¶ added in v1.21.0
func MatchPredicateR2 ¶ added in v1.21.0
func MustMatchBindable ¶ added in v1.21.0
func MustMatchBindableR0 ¶ added in v1.21.0
func MustMatchBindableR2 ¶ added in v1.21.0
func MustMatchPredicate ¶ added in v1.21.0
func MustMatchPredicateR0 ¶ added in v1.21.0
func MustMatchPredicateR2 ¶ added in v1.21.0
func ParamBindsShape ¶ added in v1.21.0
func PredicateShape ¶ added in v1.21.0
func PredicateToJSON ¶ added in v1.21.0
func WherePredicatesShape ¶ added in v1.21.0
Types ¶
type And ¶
type And struct {
L []Predicate
}
func AndFromJSON ¶ added in v1.21.0
func (*And) AcceptPredicate ¶ added in v1.21.0
func (r *And) AcceptPredicate(v PredicateVisitor) any
func (*And) MarshalJSON ¶ added in v1.21.0
func (*And) UnmarshalJSON ¶ added in v1.21.0
type BindValue ¶
type BindValue struct{ BindName BindName }
func BindValueFromJSON ¶ added in v1.21.0
func (*BindValue) AcceptBindable ¶ added in v1.21.0
func (r *BindValue) AcceptBindable(v BindableVisitor) any
func (*BindValue) MarshalJSON ¶ added in v1.21.0
func (*BindValue) UnmarshalJSON ¶ added in v1.21.0
type Bindable ¶ added in v1.21.0
type Bindable interface {
AcceptBindable(g BindableVisitor) any
}
func BindableFromJSON ¶ added in v1.21.0
type BindableUnionJSON ¶ added in v1.21.0
type BindableUnionJSON struct { Type string `json:"$type,omitempty"` BindValue json.RawMessage `json:"predicate.BindValue,omitempty"` Literal json.RawMessage `json:"predicate.Literal,omitempty"` Locatable json.RawMessage `json:"predicate.Locatable,omitempty"` }
type BindableVisitor ¶ added in v1.21.0
type Comparable ¶
type Comparable struct { Location string `( @Location` Operator string ` @( "<>" | "<=" | ">=" | "=" | "<" | ">" | "!=" )` BindName Value ` @@)` }
func (Comparable) ToPredicate ¶
func (a Comparable) ToPredicate() (Predicate, error)
type Compare ¶
func CompareFromJSON ¶ added in v1.21.0
func (*Compare) AcceptPredicate ¶ added in v1.21.0
func (r *Compare) AcceptPredicate(v PredicateVisitor) any
func (*Compare) MarshalJSON ¶ added in v1.21.0
func (*Compare) UnmarshalJSON ¶ added in v1.21.0
type Condition ¶
type Condition struct { Operand *Comparable ` @@` Not *Condition `| "NOT" @@` }
func (*Condition) ToPredicate ¶
type Expression ¶
type Expression struct {
Or []*OrCondition `@@ ( "OR" @@ )*`
}
func (Expression) ToPredicate ¶
func (e Expression) ToPredicate() (Predicate, error)
type Literal ¶
func LiteralFromJSON ¶ added in v1.21.0
func (*Literal) AcceptBindable ¶ added in v1.21.0
func (r *Literal) AcceptBindable(v BindableVisitor) any
func (*Literal) MarshalJSON ¶ added in v1.21.0
func (*Literal) UnmarshalJSON ¶ added in v1.21.0
type Locatable ¶
type Locatable struct{ Location string }
func LocatableFromJSON ¶ added in v1.21.0
func (*Locatable) AcceptBindable ¶ added in v1.21.0
func (r *Locatable) AcceptBindable(v BindableVisitor) any
func (*Locatable) MarshalJSON ¶ added in v1.21.0
func (*Locatable) UnmarshalJSON ¶ added in v1.21.0
type Not ¶
type Not struct {
P Predicate
}
func NotFromJSON ¶ added in v1.21.0
func (*Not) AcceptPredicate ¶ added in v1.21.0
func (r *Not) AcceptPredicate(v PredicateVisitor) any
func (*Not) MarshalJSON ¶ added in v1.21.0
func (*Not) UnmarshalJSON ¶ added in v1.21.0
type Or ¶
type Or struct {
L []Predicate
}
func OrFromJSON ¶ added in v1.21.0
func (*Or) AcceptPredicate ¶ added in v1.21.0
func (r *Or) AcceptPredicate(v PredicateVisitor) any
func (*Or) MarshalJSON ¶ added in v1.21.0
func (*Or) UnmarshalJSON ¶ added in v1.21.0
type OrCondition ¶
type OrCondition struct {
And []*Condition `@@ ( "AND" @@ )*`
}
func (*OrCondition) ToPredicate ¶
func (c *OrCondition) ToPredicate() (Predicate, error)
type ParamBinds ¶
func (*ParamBinds) MarshalJSON ¶ added in v1.20.2
func (r *ParamBinds) MarshalJSON() ([]byte, error)
func (*ParamBinds) UnmarshalJSON ¶ added in v1.20.2
func (r *ParamBinds) UnmarshalJSON(data []byte) error
type Predicate ¶ added in v1.21.0
type Predicate interface {
AcceptPredicate(g PredicateVisitor) any
}
func PredicateFromJSON ¶ added in v1.21.0
type PredicateUnionJSON ¶ added in v1.21.0
type PredicateUnionJSON struct { Type string `json:"$type,omitempty"` And json.RawMessage `json:"predicate.And,omitempty"` Or json.RawMessage `json:"predicate.Or,omitempty"` Not json.RawMessage `json:"predicate.Not,omitempty"` Compare json.RawMessage `json:"predicate.Compare,omitempty"` }
type PredicateVisitor ¶ added in v1.21.0
type Value ¶
type Value struct { BindName *string `( @Bind` Number *float64 `| @Number` String *string `| @String` Bool *string `| @("TRUE" | "FALSE" | "true" | "false") ` Location *string `| @Location )` }
func (Value) ToBindable ¶
type WherePredicates ¶
type WherePredicates struct { Predicate Predicate Params ParamBinds }
func MustWhere ¶
func MustWhere(query string, params ParamBinds) *WherePredicates
func Where ¶
func Where(query string, params ParamBinds) (*WherePredicates, error)
func (*WherePredicates) MarshalJSON ¶ added in v1.20.2
func (r *WherePredicates) MarshalJSON() ([]byte, error)
func (*WherePredicates) UnmarshalJSON ¶ added in v1.20.2
func (r *WherePredicates) UnmarshalJSON(data []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.