datacomparison

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LiteralUnionErr = base.NewUnionExpressionError("dataComparison.Literal", []string{"bool", "int", "float", "string", "timestamp"})
View Source
var OperandUnionError = base.NewUnionExpressionError("data_comparison.Operand", []string{"Reference", "Literal"})

Functions

func ComparisonOperatorStrings

func ComparisonOperatorStrings() []string

ComparisonOperatorStrings returns a slice of all String values of the enum

func EntityTypeStrings

func EntityTypeStrings() []string

EntityTypeStrings returns a slice of all String values of the enum

Types

type ComparisonOperator

type ComparisonOperator int
const (
	ComparisonOperatorEqual ComparisonOperator = iota
	ComparisonOperatorNotEqual
	ComparisonOperatorLessThan
	ComparisonOperatorLessThanOrEqual
	ComparisonOperatorGreaterThan
	ComparisonOperatorGreaterThanOrEqual
)

func ComparisonOperatorString

func ComparisonOperatorString(s string) (ComparisonOperator, error)

ComparisonOperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ComparisonOperatorValues

func ComparisonOperatorValues() []ComparisonOperator

ComparisonOperatorValues returns all values of the enum

func (ComparisonOperator) IsAComparisonOperator

func (i ComparisonOperator) IsAComparisonOperator() bool

IsAComparisonOperator returns "true" if the value is listed in the enum definition. "false" otherwise

func (ComparisonOperator) MarshalGQL

func (i ComparisonOperator) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for ComparisonOperator

func (ComparisonOperator) MarshalJSON

func (i ComparisonOperator) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ComparisonOperator

func (ComparisonOperator) MarshalYAML

func (i ComparisonOperator) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for ComparisonOperator

func (ComparisonOperator) String

func (i ComparisonOperator) String() string

func (*ComparisonOperator) UnmarshalGQL

func (i *ComparisonOperator) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for ComparisonOperator

func (*ComparisonOperator) UnmarshalJSON

func (i *ComparisonOperator) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ComparisonOperator

func (*ComparisonOperator) UnmarshalYAML

func (i *ComparisonOperator) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for ComparisonOperator

func (ComparisonOperator) Values

func (ComparisonOperator) Values() []string

type DataComparison

type DataComparison struct {
	Operator     ComparisonOperator `json:"operator" yaml:"operator" gqlgen:"operator"`
	LeftOperand  Operand            `json:"leftOperand,omitempty" yaml:"leftOperand,omitempty" gqlgen:"leftOperand"`
	RightOperand Operand            `json:"rightOperand,omitempty" yaml:"rightOperand,omitempty" gqlgen:"rightOperand"`
}

func (*DataComparison) Accept

func (d *DataComparison) Accept(ctx context.Context, visitor base.Visitor) error

func (*DataComparison) IsBinaryExpression

func (d *DataComparison) IsBinaryExpression()

func (*DataComparison) ToGql

func (*DataComparison) Validate

func (d *DataComparison) Validate(ctx context.Context) error

type DataComparisonOperand

type DataComparisonOperand interface {
	IsDataComparisonOperand()
}

type EntityType

type EntityType int
const (
	EntityTypeDataObject EntityType = iota
	EntityTypeColumnReferenceByName
)

func EntityTypeString

func EntityTypeString(s string) (EntityType, error)

EntityTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func EntityTypeValues

func EntityTypeValues() []EntityType

EntityTypeValues returns all values of the enum

func (EntityType) IsAEntityType

func (i EntityType) IsAEntityType() bool

IsAEntityType returns "true" if the value is listed in the enum definition. "false" otherwise

func (EntityType) MarshalGQL

func (i EntityType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface for EntityType

func (EntityType) MarshalJSON

func (i EntityType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for EntityType

func (EntityType) MarshalYAML

func (i EntityType) MarshalYAML() (interface{}, error)

MarshalYAML implements a YAML Marshaler for EntityType

func (EntityType) String

func (i EntityType) String() string

func (*EntityType) UnmarshalGQL

func (i *EntityType) UnmarshalGQL(value interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface for EntityType

func (*EntityType) UnmarshalJSON

func (i *EntityType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for EntityType

func (*EntityType) UnmarshalYAML

func (i *EntityType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements a YAML Unmarshaler for EntityType

func (EntityType) Values

func (EntityType) Values() []string

type Literal

type Literal struct {
	Bool      *bool      `json:"bool,omitempty" yaml:"bool,omitempty" gqlgen:"bool"`
	Int       *int       `json:"int,omitempty" yaml:"int,omitempty" gqlgen:"int"`
	Float     *float64   `json:"float,omitempty" yaml:"float,omitempty" gqlgen:"float"`
	Str       *string    `json:"string,omitempty" yaml:"string,omitempty" gqlgen:"string"`
	Timestamp *time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty" gqlgen:"timestamp"`
}

func (*Literal) Accept

func (l *Literal) Accept(ctx context.Context, visitor base.Visitor) error

func (*Literal) ToGql

func (l *Literal) ToGql() (DataComparisonOperand, error)

func (*Literal) Validate

func (l *Literal) Validate(_ context.Context) error

type LiteralBool

type LiteralBool base.Literal[bool]

func (*LiteralBool) IsDataComparisonOperand

func (l *LiteralBool) IsDataComparisonOperand()

type LiteralFloat

type LiteralFloat base.Literal[float64]

func (*LiteralFloat) IsDataComparisonOperand

func (l *LiteralFloat) IsDataComparisonOperand()

type LiteralInt

type LiteralInt base.Literal[int]

func (*LiteralInt) IsDataComparisonOperand

func (l *LiteralInt) IsDataComparisonOperand()

type LiteralString

type LiteralString base.Literal[string]

func (*LiteralString) IsDataComparisonOperand

func (l *LiteralString) IsDataComparisonOperand()

type LiteralTime

type LiteralTime base.Literal[time.Time]

func (*LiteralTime) IsDataComparisonOperand

func (l *LiteralTime) IsDataComparisonOperand()

type Operand

type Operand struct {
	Reference *Reference `json:"reference,omitempty" yaml:"reference,omitempty" gqlgen:"reference"`
	Literal   *Literal   `json:"literal,omitempty" yaml:"literal,omitempty" gqlgen:"literal"`
}

func (*Operand) Accept

func (o *Operand) Accept(ctx context.Context, visitor base.Visitor) error

func (*Operand) ToGql

func (o *Operand) ToGql() (DataComparisonOperand, error)

func (*Operand) Validate

func (o *Operand) Validate(ctx context.Context) error

type Reference

type Reference struct {
	EntityType EntityType `json:"entityType,omitempty" yaml:"entityType,omitempty" gqlgen:"entityType"`
	EntityID   string     `json:"entityId,omitempty" yaml:"entityId,omitempty" gqlgen:"entityId"`
}

func (*Reference) Accept

func (r *Reference) Accept(ctx context.Context, visitor base.Visitor) error

func (*Reference) IsDataComparisonOperand

func (r *Reference) IsDataComparisonOperand()

func (*Reference) Validate

func (r *Reference) Validate(_ context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL