utils

package
v0.0.0-...-c75f73b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeTableNameForSpanner

func ChangeTableNameForSpanner(tableName string) string

ChangeTableNameForSpanner - ReplaceAll the hyphens (-) with underscore for given table name https://cloud.google.com/spanner/docs/data-definition-language#naming_conventions

func ConvertDynamoTypeToSpannerType

func ConvertDynamoTypeToSpannerType(dynamoType string) string

Convert DynamoDB data types to equivalent Spanner types

func CreateConditionExpression

func CreateConditionExpression(condtionExpression string, expressionAttr map[string]interface{}) (*models.Eval, error)

CreateConditionExpression - create evelute condition from condition

func EvaluateExpression

func EvaluateExpression(expression *models.Eval) (bool, error)

EvaluateExpression - evalute expression

func GetFieldNameFromConditionalExpression

func GetFieldNameFromConditionalExpression(conditionalExpression string) string

GetFieldNameFromConditionalExpression returns the field name from conditional expression

func GetStringInBetween

func GetStringInBetween(str string, start string, end string) (result string)

GetStringInBetween Returns empty string if no start string found

func ParseBeginsWith

func ParseBeginsWith(rangeExpression string) (string, string, string)

ParseBeginsWith ..

func ParseListRemoveTarget

func ParseListRemoveTarget(target string) (string, int)

parseListRemoveTarget parses a list attribute target and its index from the action value. It returns the attribute name and index. Example: listAttr[2]

func RemoveDuplicatesByteSlice

func RemoveDuplicatesByteSlice(input [][]byte) [][]byte

RemoveDuplicatesByteSlice removes duplicates from a [][]byte

func RemoveDuplicatesFloat

func RemoveDuplicatesFloat(input []float64) []float64

RemoveDuplicatesFloat removes duplicates from a []float64

func RemoveDuplicatesString

func RemoveDuplicatesString(input []string) []string

RemoveDuplicatesString removes duplicates from a []string

func RemoveListElement

func RemoveListElement(list []interface{}, idx int) []interface{}

removeListElement removes an element from a list at the specified index. If the index is invalid, it returns the original list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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