Documentation ¶
Index ¶
- Constants
- Variables
- func AggregatorOperatorStrings() []string
- func CtxExtendPathAndSetElement(ctx context.Context, path string, element interface{}) context.Context
- func UnaryOperatorStrings() []string
- type Aggregator
- type AggregatorOperator
- func (i AggregatorOperator) IsAAggregatorOperator() bool
- func (i AggregatorOperator) MarshalGQL(w io.Writer)
- func (i AggregatorOperator) MarshalJSON() ([]byte, error)
- func (i AggregatorOperator) MarshalYAML() (interface{}, error)
- func (i AggregatorOperator) String() string
- func (i *AggregatorOperator) UnmarshalGQL(value interface{}) error
- func (i *AggregatorOperator) UnmarshalJSON(data []byte) error
- func (i *AggregatorOperator) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (AggregatorOperator) Values() []string
- type BExpressionCtxKey
- type BinaryExpression
- type BinaryExpressionUnion
- type Comparison
- type ErrUnionExpression
- type Literal
- type LiteralBool
- type MockVisitor
- func (_m *MockVisitor) EXPECT() *MockVisitor_Expecter
- func (_m *MockVisitor) EnterExpressionElement(ctx context.Context, element VisitableElement) error
- func (_m *MockVisitor) LeaveExpressionElement(ctx context.Context, element VisitableElement)
- func (_m *MockVisitor) Literal(ctx context.Context, l interface{}) error
- type MockVisitor_EnterExpressionElement_Call
- func (_c *MockVisitor_EnterExpressionElement_Call) Return(_a0 error) *MockVisitor_EnterExpressionElement_Call
- func (_c *MockVisitor_EnterExpressionElement_Call) Run(run func(ctx context.Context, element VisitableElement)) *MockVisitor_EnterExpressionElement_Call
- func (_c *MockVisitor_EnterExpressionElement_Call) RunAndReturn(run func(context.Context, VisitableElement) error) *MockVisitor_EnterExpressionElement_Call
- type MockVisitor_Expecter
- func (_e *MockVisitor_Expecter) EnterExpressionElement(ctx interface{}, element interface{}) *MockVisitor_EnterExpressionElement_Call
- func (_e *MockVisitor_Expecter) LeaveExpressionElement(ctx interface{}, element interface{}) *MockVisitor_LeaveExpressionElement_Call
- func (_e *MockVisitor_Expecter) Literal(ctx interface{}, l interface{}) *MockVisitor_Literal_Call
- type MockVisitor_LeaveExpressionElement_Call
- func (_c *MockVisitor_LeaveExpressionElement_Call) Return() *MockVisitor_LeaveExpressionElement_Call
- func (_c *MockVisitor_LeaveExpressionElement_Call) Run(run func(ctx context.Context, element VisitableElement)) *MockVisitor_LeaveExpressionElement_Call
- func (_c *MockVisitor_LeaveExpressionElement_Call) RunAndReturn(run func(context.Context, VisitableElement)) *MockVisitor_LeaveExpressionElement_Call
- type MockVisitor_Literal_Call
- func (_c *MockVisitor_Literal_Call) Return(_a0 error) *MockVisitor_Literal_Call
- func (_c *MockVisitor_Literal_Call) Run(run func(ctx context.Context, l interface{})) *MockVisitor_Literal_Call
- func (_c *MockVisitor_Literal_Call) RunAndReturn(run func(context.Context, interface{}) error) *MockVisitor_Literal_Call
- type UnaryExpression
- type UnaryOperator
- func (i UnaryOperator) IsAUnaryOperator() bool
- func (i UnaryOperator) MarshalGQL(w io.Writer)
- func (i UnaryOperator) MarshalJSON() ([]byte, error)
- func (i UnaryOperator) MarshalYAML() (interface{}, error)
- func (i UnaryOperator) String() string
- func (i *UnaryOperator) UnmarshalGQL(value interface{}) error
- func (i *UnaryOperator) UnmarshalJSON(data []byte) error
- func (i *UnaryOperator) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (UnaryOperator) Values() []string
- type Validatable
- type VisitableElement
- type Visitor
Constants ¶
const ( BExpressionPath = BExpressionCtxKey("BExpressionPath") BExpressionElement = BExpressionCtxKey("BExpressionElement") )
Variables ¶
var (
BinaryExpressionUnionError = NewUnionExpressionError("BinaryExpression", []string{"Literal", "Comparison", "Aggregator", "UnaryExpression"})
)
var ErrEmptyOperands = errors.New("at least one operand must be set")
Functions ¶
func AggregatorOperatorStrings ¶
func AggregatorOperatorStrings() []string
AggregatorOperatorStrings returns a slice of all String values of the enum
func UnaryOperatorStrings ¶
func UnaryOperatorStrings() []string
UnaryOperatorStrings returns a slice of all String values of the enum
Types ¶
type Aggregator ¶
type Aggregator[T Comparison] struct { Operator AggregatorOperator `json:"operator" yaml:"operator" gqlgen:"operator"` Operands []BinaryExpression[T] `json:"operands" yaml:"operands" gqlgen:"operands"` }
func (*Aggregator[T]) Accept ¶
func (a *Aggregator[T]) Accept(ctx context.Context, visitor Visitor) error
func (*Aggregator[T]) IsBinaryExpression ¶
func (a *Aggregator[T]) IsBinaryExpression()
type AggregatorOperator ¶
type AggregatorOperator int
const ( AggregatorOperatorAnd AggregatorOperator = iota AggregatorOperatorOr )
func AggregatorOperatorString ¶
func AggregatorOperatorString(s string) (AggregatorOperator, error)
AggregatorOperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func AggregatorOperatorValues ¶
func AggregatorOperatorValues() []AggregatorOperator
AggregatorOperatorValues returns all values of the enum
func (AggregatorOperator) IsAAggregatorOperator ¶
func (i AggregatorOperator) IsAAggregatorOperator() bool
IsAAggregatorOperator returns "true" if the value is listed in the enum definition. "false" otherwise
func (AggregatorOperator) MarshalGQL ¶
func (i AggregatorOperator) MarshalGQL(w io.Writer)
MarshalGQL implements the graphql.Marshaler interface for AggregatorOperator
func (AggregatorOperator) MarshalJSON ¶
func (i AggregatorOperator) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for AggregatorOperator
func (AggregatorOperator) MarshalYAML ¶
func (i AggregatorOperator) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for AggregatorOperator
func (AggregatorOperator) String ¶
func (i AggregatorOperator) String() string
func (*AggregatorOperator) UnmarshalGQL ¶
func (i *AggregatorOperator) UnmarshalGQL(value interface{}) error
UnmarshalGQL implements the graphql.Unmarshaler interface for AggregatorOperator
func (*AggregatorOperator) UnmarshalJSON ¶
func (i *AggregatorOperator) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for AggregatorOperator
func (*AggregatorOperator) UnmarshalYAML ¶
func (i *AggregatorOperator) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for AggregatorOperator
func (AggregatorOperator) Values ¶
func (AggregatorOperator) Values() []string
type BExpressionCtxKey ¶
type BExpressionCtxKey string
type BinaryExpression ¶
type BinaryExpression[T Comparison] struct { Literal *bool `json:"literal,omitempty" yaml:"literal,omitempty" gqlgen:"literal"` Comparison T `json:"comparison,omitempty" yaml:"comparison,omitempty" gqlgen:"comparison"` Aggregator *Aggregator[T] `json:"aggregator,omitempty" yaml:"aggregator,omitempty" gqlgen:"aggregator"` UnaryExpression *UnaryExpression[T] `json:"unaryExpression,omitempty" yaml:"unaryExpression,omitempty" gqlgen:"unaryExpression"` }
func (*BinaryExpression[T]) Accept ¶
func (b *BinaryExpression[T]) Accept(ctx context.Context, visitor Visitor) error
func (*BinaryExpression[T]) ToGql ¶
func (b *BinaryExpression[T]) ToGql() (BinaryExpressionUnion, error)
type BinaryExpressionUnion ¶
type BinaryExpressionUnion interface {
IsBinaryExpression()
}
type Comparison ¶
type Comparison interface { Validatable VisitableElement ToGql() (BinaryExpressionUnion, error) }
type ErrUnionExpression ¶
func NewUnionExpressionError ¶
func NewUnionExpressionError(elementType string, elementChildTypes []string) *ErrUnionExpression
func (*ErrUnionExpression) Error ¶
func (e *ErrUnionExpression) Error() string
type LiteralBool ¶
func (*LiteralBool) IsBinaryExpression ¶
func (l *LiteralBool) IsBinaryExpression()
type MockVisitor ¶
MockVisitor is an autogenerated mock type for the Visitor type
func NewMockVisitor ¶
func NewMockVisitor(t interface { mock.TestingT Cleanup(func()) }) *MockVisitor
NewMockVisitor creates a new instance of MockVisitor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockVisitor) EXPECT ¶
func (_m *MockVisitor) EXPECT() *MockVisitor_Expecter
func (*MockVisitor) EnterExpressionElement ¶
func (_m *MockVisitor) EnterExpressionElement(ctx context.Context, element VisitableElement) error
EnterExpressionElement provides a mock function with given fields: ctx, element
func (*MockVisitor) LeaveExpressionElement ¶
func (_m *MockVisitor) LeaveExpressionElement(ctx context.Context, element VisitableElement)
LeaveExpressionElement provides a mock function with given fields: ctx, element
type MockVisitor_EnterExpressionElement_Call ¶
MockVisitor_EnterExpressionElement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnterExpressionElement'
func (*MockVisitor_EnterExpressionElement_Call) Return ¶
func (_c *MockVisitor_EnterExpressionElement_Call) Return(_a0 error) *MockVisitor_EnterExpressionElement_Call
func (*MockVisitor_EnterExpressionElement_Call) Run ¶
func (_c *MockVisitor_EnterExpressionElement_Call) Run(run func(ctx context.Context, element VisitableElement)) *MockVisitor_EnterExpressionElement_Call
func (*MockVisitor_EnterExpressionElement_Call) RunAndReturn ¶
func (_c *MockVisitor_EnterExpressionElement_Call) RunAndReturn(run func(context.Context, VisitableElement) error) *MockVisitor_EnterExpressionElement_Call
type MockVisitor_Expecter ¶
type MockVisitor_Expecter struct {
// contains filtered or unexported fields
}
func (*MockVisitor_Expecter) EnterExpressionElement ¶
func (_e *MockVisitor_Expecter) EnterExpressionElement(ctx interface{}, element interface{}) *MockVisitor_EnterExpressionElement_Call
EnterExpressionElement is a helper method to define mock.On call
- ctx context.Context
- element VisitableElement
func (*MockVisitor_Expecter) LeaveExpressionElement ¶
func (_e *MockVisitor_Expecter) LeaveExpressionElement(ctx interface{}, element interface{}) *MockVisitor_LeaveExpressionElement_Call
LeaveExpressionElement is a helper method to define mock.On call
- ctx context.Context
- element VisitableElement
func (*MockVisitor_Expecter) Literal ¶
func (_e *MockVisitor_Expecter) Literal(ctx interface{}, l interface{}) *MockVisitor_Literal_Call
Literal is a helper method to define mock.On call
- ctx context.Context
- l interface{}
type MockVisitor_LeaveExpressionElement_Call ¶
MockVisitor_LeaveExpressionElement_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LeaveExpressionElement'
func (*MockVisitor_LeaveExpressionElement_Call) Return ¶
func (_c *MockVisitor_LeaveExpressionElement_Call) Return() *MockVisitor_LeaveExpressionElement_Call
func (*MockVisitor_LeaveExpressionElement_Call) Run ¶
func (_c *MockVisitor_LeaveExpressionElement_Call) Run(run func(ctx context.Context, element VisitableElement)) *MockVisitor_LeaveExpressionElement_Call
func (*MockVisitor_LeaveExpressionElement_Call) RunAndReturn ¶
func (_c *MockVisitor_LeaveExpressionElement_Call) RunAndReturn(run func(context.Context, VisitableElement)) *MockVisitor_LeaveExpressionElement_Call
type MockVisitor_Literal_Call ¶
MockVisitor_Literal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Literal'
func (*MockVisitor_Literal_Call) Return ¶
func (_c *MockVisitor_Literal_Call) Return(_a0 error) *MockVisitor_Literal_Call
func (*MockVisitor_Literal_Call) Run ¶
func (_c *MockVisitor_Literal_Call) Run(run func(ctx context.Context, l interface{})) *MockVisitor_Literal_Call
func (*MockVisitor_Literal_Call) RunAndReturn ¶
func (_c *MockVisitor_Literal_Call) RunAndReturn(run func(context.Context, interface{}) error) *MockVisitor_Literal_Call
type UnaryExpression ¶
type UnaryExpression[T Comparison] struct { Operator UnaryOperator `json:"operator" yaml:"operator" gqlgen:"operator"` Operand BinaryExpression[T] `json:"expression" yaml:"expression" gqlgen:"expression"` }
func (*UnaryExpression[T]) Accept ¶
func (n *UnaryExpression[T]) Accept(ctx context.Context, visitor Visitor) error
func (*UnaryExpression[T]) IsBinaryExpression ¶
func (n *UnaryExpression[T]) IsBinaryExpression()
type UnaryOperator ¶
type UnaryOperator int
const (
UnaryOperatorNot UnaryOperator = iota
)
func UnaryOperatorString ¶
func UnaryOperatorString(s string) (UnaryOperator, error)
UnaryOperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func UnaryOperatorValues ¶
func UnaryOperatorValues() []UnaryOperator
UnaryOperatorValues returns all values of the enum
func (UnaryOperator) IsAUnaryOperator ¶
func (i UnaryOperator) IsAUnaryOperator() bool
IsAUnaryOperator returns "true" if the value is listed in the enum definition. "false" otherwise
func (UnaryOperator) MarshalGQL ¶
func (i UnaryOperator) MarshalGQL(w io.Writer)
MarshalGQL implements the graphql.Marshaler interface for UnaryOperator
func (UnaryOperator) MarshalJSON ¶
func (i UnaryOperator) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for UnaryOperator
func (UnaryOperator) MarshalYAML ¶
func (i UnaryOperator) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for UnaryOperator
func (UnaryOperator) String ¶
func (i UnaryOperator) String() string
func (*UnaryOperator) UnmarshalGQL ¶
func (i *UnaryOperator) UnmarshalGQL(value interface{}) error
UnmarshalGQL implements the graphql.Unmarshaler interface for UnaryOperator
func (*UnaryOperator) UnmarshalJSON ¶
func (i *UnaryOperator) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for UnaryOperator
func (*UnaryOperator) UnmarshalYAML ¶
func (i *UnaryOperator) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for UnaryOperator
func (UnaryOperator) Values ¶
func (UnaryOperator) Values() []string