Documentation ¶
Index ¶
- Variables
- func DDBIfAnyValueChangedCondition(ifAttributeValuesChanged map[string]types.AttributeValue) (expression.ConditionBuilder, error)
- func DDBSetRevisionForUpdate(builder expression.UpdateBuilder) expression.UpdateBuilder
- func GetConfig(ctx context.Context) (aws.Config, error)
- func GetSQSClient(ctx context.Context) (*sqs.Client, error)
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyFields = errors.New("cannot generate a conditional expression for empty fields")
Functions ¶
func DDBIfAnyValueChangedCondition ¶
func DDBIfAnyValueChangedCondition(ifAttributeValuesChanged map[string]types.AttributeValue) (expression.ConditionBuilder, error)
DDBIfAnyValueChangedCondition creates a conditional update expression that will only allow a table item to update if one of the field values provided in ifAttributeValuesChanged is different than the currently-stored values. This facilitates updating certain attributes (not included in ifAttributeValuesChanged) only when when a subset of attributes (which are included in ifAttributeValuesChanged) actually have updates. The primary use-case for this functionality is managing a revision identifier attribute, which must be updated only when at least one other item attribute is modified, but should never be the sole update to an existing item.
Returns ErrEmptyFields when ifAttributeValuesChanged is an empty map.
func DDBSetRevisionForUpdate ¶
func DDBSetRevisionForUpdate(builder expression.UpdateBuilder) expression.UpdateBuilder
DDBSetRevisionForUpdate adds a DynamoDB SET operation to an UpdateBuilder, which sets the value of an item's "revision" attribute to a freshly-generated ULID string.
func GetConfig ¶
GetConfig returns an AWS SDK v2 Config with a custom resolver that resolves SDK requests to an endpoint at http://$LOCALSTACK_HOSTNAME:4566 when $LOCALSTACK_HOSTNAME is configured in the current environment. $EDGE_PORT will override port 4566 only when $LOCALSTACK_HOSTNAME is also set. If no $LOCALSTACK_HOSTNAME variable exists in the current environment, the resolver falls back to the SDK's default endpoint resolution behavior.
Types ¶
This section is empty.