package
1.6.4
Repository: https://github.com/aldelo/common.git
Documentation: pkg.go.dev

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CrudUniqueModel defines the unique model for the crud object Specifically, an interface{} representing the crud object is passed in, and the crud object's fields with its tag name matching UniqueTagName is discovered, then the subject field's value is appended to the crud object's PK value to comprise the unique key index value.
No description provided by the author
DynamoDB struct encapsulates the AWS DynamoDB access functionality Notes: 1.
DynamoDBConditionExpressionSet struct defines the condition expression and its attribute values if any.
DynamoDBError struct contains special status info including error and retry advise.
DynamoDBMultiGetRequestResponse struct defines container for request response properties, including for pointer to ResultItemsSlice, ItemsCount in ResultItemsSlice, and the associated Table Name, each Request Response is for a specific Table Name.
DynamoDBProjectedAttributesSet struct defines a set of projected attributes and its table name.
DynamoDBTableKeys struct defines the PK and SK fields to be used in key search (Always PK and SK) important if dynamodb table is defined as PK and SK together, then to search, MUST use PK and SK together or error will trigger ResultItemPtr = optional, used with TransactionGetItems() to denote output unmarshal object target.
No description provided by the author
DynamoDBTransactionReads defines a set of get item search keys, with each holding result items slice pointer, !!! NOTE = When Participate in Slice, Table Name CAN Duplicate since DynamoDBTransactionReads holds slice rather than map, and result processing key lookup is by PK SK rather than table name !!!.
DynamoDBTransactionWritePutItemsSet contains Slice of Put Items that are Struct (Value), NOT pointers to Structs, each DynamoDBTransactionWritePutItemsSet struct contains the same set of PutItems in terms of data schema.
DynamoDBTransactionWrites defines one or more items to put, update or delete notes 1.
DynamoDBUnprocessedItemsAndKeys defines struct to slices of items and keys.
DynamoDBUpdateItemInput defines a single item update instruction important if dynamodb table is defined as PK and SK together, then to search, MUST use PK and SK together or error will trigger parameters: pkValue = required, value of partition key to seek skValue = optional, value of sort key to seek; set to blank if value not provided updateExpression = required, ATTRIBUTES ARE CASE SENSITIVE; set remove add or delete action expression, see Rules URL for full detail Rules: 1) https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.UpdateExpressions.html Usage Syntax: 1) Action Keywords are: set, add, remove, delete 2) Each Action Keyword May Appear in UpdateExpression Only Once 3) Each Action Keyword Grouping May Contain One or More Actions, Such as 'set price=:p, age=:age, etc' (each action separated by comma) 4) Each Action Keyword Always Begin with Action Keyword itself, such as 'set ...', 'add ...', etc 5) If Attribute is Numeric, Action Can Perform + or - Operation in Expression, such as 'set age=age-:newAge, price=price+:price, etc' 6) If Attribute is Slice, Action Can Perform Slice Element Operation in Expression, such as 'set age[2]=:newData, etc' 7) When Attribute Name is Reserved Keyword, Use ExpressionAttributeNames to Define #xyz to Alias a) Use the #xyz in the KeyConditionExpression such as #yr = :year (:year is Defined ExpressionAttributeValue) 8) When Attribute is a List, Use list_append(a, b, ...) in Expression to append elements (list_append() is case sensitive) a) set #ri = list_append(#ri, :vals) where :vals represents one or more of elements to add as in L 9) if_not_exists(path, value) a) Avoids existing attribute if already exists b) set price = if_not_exists(price, :p) c) if_not_exists is case sensitive; path is the existing attribute to check 10) Action Type Purposes a) SET = add one or more attributes to an item; overrides existing attributes in item with new values; if attribute is number, able to perform + or - operations b) REMOVE = remove one or more attributes from an item, to remove multiple attributes, separate by comma; remove element from list use xyz[1] index notation c) ADD = adds a new attribute and its values to an item; if attribute is number and already exists, value will add up or subtract d) DELETE = supports only on set data types; deletes one or more elements from a set, such as 'delete color :c' 11) Example a) set age=:age, name=:name, etc b) set age=age-:age, num=num+:num, etc conditionExpress = optional, ATTRIBUTES ARE CASE SENSITIVE; sets conditions for this condition expression, set to blank if not used Usage Syntax: 1) "size(info.actors) >= :num" a) When Length of Actors Attribute Value is Equal or Greater Than :num, ONLY THEN UpdateExpression is Performed 2) ExpressionAttributeName and ExpressionAttributeValue is Still Defined within ExpressionAttributeNames and ExpressionAttributeValues Where Applicable expressionAttributeNames = optional, ATTRIBUTES ARE CASE SENSITIVE; set nil if not used, must define for attribute names that are reserved keywords such as year, data etc.
No description provided by the author
No description provided by the author
No description provided by the author