conditionexpression

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeNameToValueName

func AttributeNameToValueName(path *expressionutils.OperationPath, attributeName string) string

func Marshal

func Marshal(item ExpressionItem, attributeNames map[string]string, attributeValues map[string]types.AttributeValue) (*string, error)

func MarshalOperand

func MarshalOperand(path *expressionutils.OperationPath, valueNamePostfix string, operand interface{}, attributeNames map[string]string, attributeValues map[string]interface{}) string

func MarshalValue

func MarshalValue(path *expressionutils.OperationPath, valueNamePostfix string, value interface{}, attributeValues map[string]interface{}) string

Types

type AndBinaryConditionOperator

type AndBinaryConditionOperator struct {
	BinaryCondition
}

func And

func And(leftCondition ConditionItem, rightCondition ConditionItem) *AndBinaryConditionOperator

And creates a AndBinaryConditionOperator object to and concat two condition expressions representing `lh AND rh` DynamoDB expression

func (*AndBinaryConditionOperator) Marshal

func (o *AndBinaryConditionOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type AttributeExistsOperation

type AttributeExistsOperation struct {
	Path expressionutils.AttributePath
}

AttributeExistsOperation represents an `attribute_exists (path)` DynamoDB expression

func Exists

Exists creates an AttributeExistsOperation object to represent an `attribute_exists (path)` DynamoDB expression

func (*AttributeExistsOperation) IsConditionExpressionItem

func (o *AttributeExistsOperation) IsConditionExpressionItem()

func (*AttributeExistsOperation) Marshal

func (o *AttributeExistsOperation) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type AttributeNotExistsOperation

type AttributeNotExistsOperation struct {
	Path expressionutils.AttributePath
}

AttributeNotExistsOperation represents an `attribute_not_exists (path)` DynamoDB expression

func NotExists

NotExists creates an AttributeNotExistsOperation object to represent an `attribute_not_exists (path)` DynamoDB expression

func (*AttributeNotExistsOperation) IsConditionExpressionItem

func (o *AttributeNotExistsOperation) IsConditionExpressionItem()

func (*AttributeNotExistsOperation) Marshal

func (o *AttributeNotExistsOperation) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type AttributeType

type AttributeType string
const (
	AttributeTypeString      AttributeType = "S"
	AttributeTypeStringSet   AttributeType = "SS"
	AttributeTypeNumber      AttributeType = "N"
	AttributeTypeNumberSet   AttributeType = "NS"
	AttributeTypeBinary      AttributeType = "B"
	AttributeTypeBinarySet   AttributeType = "BS"
	AttributeTypeBoolean     AttributeType = "BOOL"
	AttributeTypeBooleanNull AttributeType = "NULL"
	AttributeTypeList        AttributeType = "L"
	AttributeTypeMap         AttributeType = "M"
)

type AttributeTypeOperation

type AttributeTypeOperation struct {
	Path expressionutils.AttributePath
	Type AttributeType
}

AttributeTypeOperation represents an `attribute_type (path, type)` DynamoDB expression

func Type

Type creates an AttributeTypeOperation object to represent an `attribute_type (path, type)` DynamoDB expression

func (*AttributeTypeOperation) Marshal

func (o *AttributeTypeOperation) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type BeginsWithOperation

type BeginsWithOperation struct {
	Path   expressionutils.AttributePath
	Substr string
}

BeginsWithOperation represents a `begins_with (path, substr)` DynamoDB expression

func BeginsWith

func BeginsWith(path expressionutils.AttributePath, substr string) *BeginsWithOperation

BeginsWith creates a BeginsWithOperation object to represent a `begins_with (path, substr)` DynamoDB expression

func (*BeginsWithOperation) IsConditionExpressionItem

func (o *BeginsWithOperation) IsConditionExpressionItem()

func (*BeginsWithOperation) IsRangeKeyConditionExpressionItem

func (o *BeginsWithOperation) IsRangeKeyConditionExpressionItem()

func (*BeginsWithOperation) Marshal

func (o *BeginsWithOperation) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type BetweenComparisonOperator

type BetweenComparisonOperator struct {
	LeftOperand         expressionutils.AttributePath
	RightSmallerOperand interface{}
	RightBiggerOperand  interface{}
}

func Between

func Between(attribute expressionutils.AttributePath, value0 interface{}, value1 interface{}) *BetweenComparisonOperator

Between creates a BetweenComparisonOperator object to represent `a BETWEEN b AND c` DynamoDB expression

func (*BetweenComparisonOperator) IsConditionExpressionItem

func (o *BetweenComparisonOperator) IsConditionExpressionItem()

func (*BetweenComparisonOperator) IsRangeKeyConditionExpressionItem

func (o *BetweenComparisonOperator) IsRangeKeyConditionExpressionItem()

func (*BetweenComparisonOperator) Marshal

func (o *BetweenComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type BinaryComparisonOperator

type BinaryComparisonOperator struct {
	LeftOperand  interface{}
	RightOperand interface{}
}

func (*BinaryComparisonOperator) IsConditionExpressionItem

func (o *BinaryComparisonOperator) IsConditionExpressionItem()

func (*BinaryComparisonOperator) IsRangeKeyConditionExpressionItem

func (o *BinaryComparisonOperator) IsRangeKeyConditionExpressionItem()

type BinaryCondition

type BinaryCondition struct {
	LeftCondition  ConditionItem
	RightCondition ConditionItem
}

func (*BinaryCondition) IsConditionExpressionItem

func (*BinaryCondition) IsConditionExpressionItem()

type BinaryConditionOperation

type BinaryConditionOperation string
const (
	AndConditionOperation BinaryConditionOperation = "AND"
	OrConditionOperation  BinaryConditionOperation = "OR"
)

type Comparator

type Comparator string
const (
	EqualComparator              Comparator = "="
	NotEqualComparator           Comparator = "<>"
	LessThanComparator           Comparator = "<"
	LessOrEqualThanComparator    Comparator = "<="
	GreaterThanComparator        Comparator = ">"
	GreaterOrEqualThanComparator Comparator = ">="
)

type ConditionItem

type ConditionItem interface {
	ExpressionItem
	IsConditionExpressionItem()
}

type ContainsOperation

type ContainsOperation struct {
	Path  expressionutils.AttributePath
	Value interface{}
}

ContainsOperation represents a `contains (path, operand)` DynamoDB expression Value must be a string if the attribute is a string. Otherwise, if the attribute is a set value must be of same type as the elements in the set

func Contains

func Contains(attribute expressionutils.AttributePath, value interface{}) *ContainsOperation

Contains creates a ContainsOperation object to represent a `contains (path, operand)` DynamoDB expression value must be a string if the attribute is a string. Otherwise, if the attribute is a set value must be of same type as the elements in the set

func (*ContainsOperation) IsConditionExpressionItem

func (o *ContainsOperation) IsConditionExpressionItem()

func (*ContainsOperation) Marshal

func (o *ContainsOperation) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type EqualComparisonOperator

type EqualComparisonOperator struct {
	BinaryComparisonOperator
}

func Equal

func Equal(leftOperand interface{}, rightOperand interface{}) *EqualComparisonOperator

Equal create an EqualComparisonOperator object to represent a `lh = rh` DynamoDB expression

func (*EqualComparisonOperator) Marshal

func (o *EqualComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type ExpressionItem

type ExpressionItem interface {
	Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string
}

type ExpressionOperand

type ExpressionOperand interface {
	Marshal(attributeNames map[string]string) string
}

type GreaterOrEqualThanComparisonOperator

type GreaterOrEqualThanComparisonOperator struct {
	BinaryComparisonOperator
}

func GreaterOrEqualThan

func GreaterOrEqualThan(leftOperand interface{}, rightOperand interface{}) *GreaterOrEqualThanComparisonOperator

GreaterOrEqualThan creates a GreaterOrEqualComparisonOperator object to represent a `lh >= rh` DynamoDB

func (*GreaterOrEqualThanComparisonOperator) Marshal

func (o *GreaterOrEqualThanComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type GreaterThanComparisonOperator

type GreaterThanComparisonOperator struct {
	BinaryComparisonOperator
}

func GreaterThan

func GreaterThan(leftOperand interface{}, rightOperand interface{}) *GreaterThanComparisonOperator

GreaterThan creates a GreaterThanComparisonOperator object to represent a `lh > rh` DynamoDB expression

func (*GreaterThanComparisonOperator) Marshal

func (o *GreaterThanComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type InComparisonOperator

type InComparisonOperator struct {
	LeftOperand   expressionutils.AttributePath
	RightOperands []interface{}
}

func In

func In(attribute expressionutils.AttributePath, collection ...interface{}) *InComparisonOperator

In creates a InComparisonOperator object to represent `lh IN (rh...)` DynamoDB expression

func (*InComparisonOperator) IsConditionExpressionItem

func (o *InComparisonOperator) IsConditionExpressionItem()

func (*InComparisonOperator) Marshal

func (o *InComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type LessOrEqualThanComparisonOperator

type LessOrEqualThanComparisonOperator struct {
	BinaryComparisonOperator
}

func LessOrEqualThan

func LessOrEqualThan(leftOperand interface{}, rightOperand interface{}) *LessOrEqualThanComparisonOperator

LessOrEqualThan creates a LessOrEqualComparisonOperator object to represent a `lh <= rh` DynamoDB expression

func (*LessOrEqualThanComparisonOperator) Marshal

func (o *LessOrEqualThanComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type LessThanComparisonOperator

type LessThanComparisonOperator struct {
	BinaryComparisonOperator
}

func LessThan

func LessThan(leftOperand interface{}, rightOperand interface{}) *LessThanComparisonOperator

LessThan creates a LessThanComparisonOperator object to represent a `lh < rh` DynamoDB expression

func (*LessThanComparisonOperator) Marshal

func (o *LessThanComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type NotCondition

type NotCondition struct {
	Condition ConditionItem
}

func Not

func Not(condition ConditionItem) *NotCondition

Not create a NotCondition object representing a `NOT condition` DynamoDB expression

func (*NotCondition) IsConditionExpressionItem

func (o *NotCondition) IsConditionExpressionItem()

func (*NotCondition) Marshal

func (o *NotCondition) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type NotEqualComparisonOperator

type NotEqualComparisonOperator struct {
	BinaryComparisonOperator
}

func NotEqual

func NotEqual(leftOperand interface{}, rightOperand interface{}) *NotEqualComparisonOperator

NotEqual creates a NotEqualComparisonOperator object to represent a `lh <> rh` DynamoDB expression

func (*NotEqualComparisonOperator) Marshal

func (o *NotEqualComparisonOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type OrBinaryConditionOperator

type OrBinaryConditionOperator struct {
	BinaryCondition
}

func Or

func Or(leftCondition ConditionItem, rightCondition ConditionItem) *OrBinaryConditionOperator

Or creates a OrBinaryConditionOperator object to and concat two condition expressions representing `lh OR rh` DynamoDB expression

func (*OrBinaryConditionOperator) Marshal

func (o *OrBinaryConditionOperator) Marshal(path *expressionutils.OperationPath, attributeNames map[string]string, attributeValues map[string]interface{}) string

type RangeKeyConditionExpressionItem

type RangeKeyConditionExpressionItem interface {
	ConditionItem
	IsRangeKeyConditionExpressionItem()
}

type SizeOperand

type SizeOperand struct {
	Path expressionutils.AttributePath
}

SizeOperand represents a `size (path)` DynamoDB expression

func Size

Size creates a SizeOperand object to represent a `size (path)` DynamoDB expression

func (*SizeOperand) Marshal

func (o *SizeOperand) Marshal(attributeNames map[string]string) string

Jump to

Keyboard shortcuts

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