dynamodb

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 14 Imported by: 0

README

'Prom' for AWS DynamoDB (https://github.com/aws/aws-sdk-go/tree/main/service/dynamodb)

PkgGoDev

Supported/Tested libraries/drivers+version: github.com/aws/aws-sdk-go v1.44.44.

Usage:

import (
    "github.com/aws/aws-sdk-go/aws"
    "github.com/aws/aws-sdk-go/aws/credentials"
    "github.com/btnguyen2k/prom/dynamodb"
)

// credentials from env.AWS_ACCESS_KEY_ID & env.AWS_SECRET_ACCESS_KEY & env.AWS_SESSION_TOKEN
cfg := &aws.Config{
    Region:      aws.String(region),
    Credentials: credentials.NewEnvCredentials(),
}
timeoutMs := 10000
awsDynamodbConnect, err := dynamodb.NewAwsDynamodbConnect(cfg, nil, nil, timeoutMs)
if err != nil {
    panic(err)
}

// from now on, the AwsDynamodbConnect instance can be shared & used by all goroutines within the application

See more:

Documentation

Index

Constants

View Source
const (
	// AwsDynamodbNoIndex indicates that no index will be used
	AwsDynamodbNoIndex = ""

	// AwsAttrTypeString is alias name of AWS DynamoDB attribute type "string"
	AwsAttrTypeString = "S"

	// AwsAttrTypeNumber is alias name of AWS DynamoDB attribute type "number"
	AwsAttrTypeNumber = "N"

	// AwsAttrTypeBinary is alias name of AWS DynamoDB attribute type "binary"
	AwsAttrTypeBinary = "B"

	// AwsKeyTypePartition is alias name of AWS DynamoDB key type "partition"
	AwsKeyTypePartition = "HASH"

	// AwsKeyTypeSort is alias name of AWS DynamoDB key type "sort/range"
	AwsKeyTypeSort = "RANGE"
)

Variables

View Source
var (
	// ErrTimeout is returned by AwsDynamodbWaitForTableStatus or AwsDynamodbWaitForGsiStatus to indicate that timeout occurred before we reach the desired status.
	ErrTimeout = errors.New("timeout while waiting for status")
)

Functions

func AwsDynamodbEqualsBuilder

func AwsDynamodbEqualsBuilder(condition map[string]interface{}) *expression.ConditionBuilder

AwsDynamodbEqualsBuilder builds a expression.ConditionBuilder with condition attr1=value1 AND attr1=value1 AND...

Parameters:

  • condition: format {attribute-name:attribute-value}

func AwsDynamodbExistsAllBuilder

func AwsDynamodbExistsAllBuilder(attrs []string) *expression.ConditionBuilder

AwsDynamodbExistsAllBuilder builds an expression.ConditionBuilder where all attributes must exist.

func AwsDynamodbNotExistsAllBuilder

func AwsDynamodbNotExistsAllBuilder(attrs []string) *expression.ConditionBuilder

AwsDynamodbNotExistsAllBuilder builds a expression.ConditionBuilder where all attributes must not exist.

func AwsDynamodbToAttributeSet

func AwsDynamodbToAttributeSet(v interface{}) *dynamodb.AttributeValue

AwsDynamodbToAttributeSet converts a Go value to DynamoDB's set.

func AwsDynamodbToAttributeValue

func AwsDynamodbToAttributeValue(v interface{}) *dynamodb.AttributeValue

AwsDynamodbToAttributeValue converts a Go value to DynamoDB's attribute value.

func AwsDynamodbWaitForGsiStatus

func AwsDynamodbWaitForGsiStatus(adc *AwsDynamodbConnect, tableName, gsiName string, statusList []string, delay, timeout time.Duration) error

AwsDynamodbWaitForGsiStatus periodically checks if table's GSI status reaches a desired value, or timeout.

  • statusList: list of desired statuses. This function returns nil if one of the desired statuses is reached.
  • delay: sleep for this amount of time after each status check. Supplied value of 0 or negative means 'no sleep'.
  • timeout: the total time should not exceed this amount. If timeout occur, this function returns ErrTimeout. Supplied value of 0 or negative means 'no timeout'!

Available since v0.2.14

func AwsDynamodbWaitForTableStatus

func AwsDynamodbWaitForTableStatus(adc *AwsDynamodbConnect, tableName string, statusList []string, delay, timeout time.Duration) error

AwsDynamodbWaitForTableStatus periodically checks if table's status reaches a desired value, or timeout.

  • statusList: list of desired statuses. This function returns nil if one of the desired statuses is reached.
  • delay: sleep for this amount of time after each status check. Supplied value of 0 or negative means 'no sleep'.
  • timeout: the total time should not exceed this amount. If timeout occur, this function returns ErrTimeout. Supplied value of 0 or negative means 'no timeout'!

Available since v0.2.14

func AwsIgnoreErrorIfMatched

func AwsIgnoreErrorIfMatched(err error, excludeCodeList ...string) error

AwsIgnoreErrorIfMatched returns nil if err is an awserr.Error and its code is in the "exclude" list.

func AwsIgnoreTransactErrorIfMatched

func AwsIgnoreTransactErrorIfMatched(err error, excludeCodeList ...string) error

AwsIgnoreTransactErrorIfMatched returns nil if err is a *dynamodb.TransactionCanceledException and its reason's code is in the "exclude" list.

Available since v0.3.0

func IsAwsError

func IsAwsError(err error, awsErrCode string) bool

IsAwsError returns true if err is an awserr.Error and its code equals to awsErrCode.

Available: since v0.2.5

Types

type AwsDynamodbConnect

type AwsDynamodbConnect struct {
	// contains filtered or unexported fields
}

AwsDynamodbConnect holds an AWS DynamoDB client (https://github.com/aws/aws-sdk-go/tree/master/service/dynamodb) that can be shared within the application.

func NewAwsDynamodbConnect

func NewAwsDynamodbConnect(cfg *aws.Config, sess *session.Session, db *dynamodb.DynamoDB, defaultTimeoutMs int) (*AwsDynamodbConnect, error)

NewAwsDynamodbConnect constructs a new AwsDynamodbConnect instance.

Parameters:

  • cfg : aws.Config instance
  • sess : session.Session instance
  • db : dynamodb.DynamoDB instance
  • defaultTimeoutMs: default timeout for db operations, in milliseconds

Return: the AwsDynamodbConnect instance and error (if any). Note:

  • if db is nil, the instance is built from session
  • if session is nil, the instance is built from config
  • at least one of {config, session, db} must not be nil
  • (since v0.3.0) an in-memory implementation of IMetricsLogger is registered with the instance

func (*AwsDynamodbConnect) AddValuesToAttributes

func (adc *AwsDynamodbConnect) AddValuesToAttributes(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValues map[string]interface{}) (*dynamodb.UpdateItemOutput, error)

AddValuesToAttributes adds values to one or more attributes of matched items.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsAndValuesToAdd: list of attributes and values to add

This function invokes UpdateItem's ADD expression and passes the argument "attrsAndValuesToAdd" along the function call.

func (*AwsDynamodbConnect) AddValuesToSet

func (adc *AwsDynamodbConnect) AddValuesToSet(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToAdd map[string]interface{}) (*dynamodb.UpdateItemOutput, error)

AddValuesToSet adds entry to one or more set-type attributes of matched items.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsAndValuesToAdd: attributes and values to add

This function is exclusive for set-type attributes. It invokes UpdateItem's ADD expression and passes the argument "attrsAndValuesToAdd" along the function call.

func (*AwsDynamodbConnect) BuildCreateGlobalSecondaryIndexAction

func (adc *AwsDynamodbConnect) BuildCreateGlobalSecondaryIndexAction(indexName, projectionType string, rcu, wcu int64, keyAttrs []AwsDynamodbNameAndType) *dynamodb.CreateGlobalSecondaryIndexAction

BuildCreateGlobalSecondaryIndexAction is a convenient function to build a dynamodb.CreateGlobalSecondaryIndexAction instance.

Parameters:

  • indexName : name of the index to be created
  • projectionType: specify attributes that are copied from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
  • rcu : ReadCapacityUnits (0 means PAY_PER_REQUEST)
  • wcu : WriteCapacityUnits (0 means PAY_PER_REQUEST)
  • keyAttrs : GSI key schema, where key-type is either "HASH" or "RANGE"

Available since v0.3.0

func (*AwsDynamodbConnect) BuildDeleteItemInput

func (adc *AwsDynamodbConnect) BuildDeleteItemInput(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder) (*dynamodb.DeleteItemInput, error)

BuildDeleteItemInput is a helper function to build dynamodb.DeleteItemInput.

Available: since v0.2.6

func (*AwsDynamodbConnect) BuildGetItemInput

func (adc *AwsDynamodbConnect) BuildGetItemInput(table string, keyFilter map[string]interface{}) (*dynamodb.GetItemInput, error)

BuildGetItemInput is a helper function to build dynamodb.GetItemInput.

Notes:

  • All projected attributes will be fetched.
  • ConsistentRead is not set.

Available: since v0.2.6

func (*AwsDynamodbConnect) BuildPutItemInput

func (adc *AwsDynamodbConnect) BuildPutItemInput(table string, item map[string]*dynamodb.AttributeValue, condition *expression.ConditionBuilder) (*dynamodb.PutItemInput, error)

BuildPutItemInput is a helper function to build dynamodb.PutItemInput.

Available: since v0.2.6

func (*AwsDynamodbConnect) BuildQueryInput

func (adc *AwsDynamodbConnect) BuildQueryInput(table string, keyFilter, nonKeyFilter *expression.ConditionBuilder, indexName string, exclusiveStartKey map[string]*dynamodb.AttributeValue) (*dynamodb.QueryInput, error)

BuildQueryInput is a helper function to build dynamodb.QueryInput.

Notes:

  • Only projected attributes will be fetched.
  • ConsistentRead is not set.
  • Limit number of processed items to 100.

Available: since v0.2.6

func (*AwsDynamodbConnect) BuildScanInput

func (adc *AwsDynamodbConnect) BuildScanInput(table string, filter *expression.ConditionBuilder, indexName string, exclusiveStartKey map[string]*dynamodb.AttributeValue) (*dynamodb.ScanInput, error)

BuildScanInput is a helper function to build dynamodb.ScanInput.

Notes: default options

  • Only projected attributes will be fetched.
  • ConsistentRead is not set.
  • Limit number of processed items to 100.

Available: since v0.2.6

func (*AwsDynamodbConnect) BuildTxAddValuesToAttributes

func (adc *AwsDynamodbConnect) BuildTxAddValuesToAttributes(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToAdd map[string]interface{}) (*dynamodb.TransactWriteItem, error)

BuildTxAddValuesToAttributes builds a 'dynamodb.TransactWriteItem' that adds values to one or more attributes of matched items.

Parameters: see AddValuesToAttributes

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxAddValuesToSet

func (adc *AwsDynamodbConnect) BuildTxAddValuesToSet(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToAdd map[string]interface{}) (*dynamodb.TransactWriteItem, error)

BuildTxAddValuesToSet builds a 'dynamodb.TransactWriteItem' that adds entry to one or more set-type attributes of matched items.

Parameters: see AddValuesToSet

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxDelete

func (adc *AwsDynamodbConnect) BuildTxDelete(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder) (*dynamodb.TransactWriteItem, error)

BuildTxDelete builds a 'dynamodb.TransactWriteItem' with "delete" operation.

Parameters: see DeleteItem

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxDeleteValuesFromSet

func (adc *AwsDynamodbConnect) BuildTxDeleteValuesFromSet(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToDelete map[string]interface{}) (*dynamodb.TransactWriteItem, error)

BuildTxDeleteValuesFromSet builds a 'dynamodb.TransactWriteItem' that deletes entry from one or more set-type attributes of matched items.

Parameters: see DeleteValuesFromSet

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxGet

func (adc *AwsDynamodbConnect) BuildTxGet(table string, keyFilter map[string]interface{}) (*dynamodb.TransactGetItem, error)

BuildTxGet builds a 'dynamodb.TransactGetItem' with "get item" operation.

Parameters: see GetItem

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxPut

func (adc *AwsDynamodbConnect) BuildTxPut(table string, item interface{}, condition *expression.ConditionBuilder) (*dynamodb.TransactWriteItem, error)

BuildTxPut builds a 'dynamodb.TransactWriteItem' with "insert or replace" operation.

Parameters: see PutItem

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxPutIfNotExist

func (adc *AwsDynamodbConnect) BuildTxPutIfNotExist(table string, item interface{}, pkAttrs []string) (*dynamodb.TransactWriteItem, error)

BuildTxPutIfNotExist builds a 'dynamodb.TransactWriteItem' with "insert if not exist" operation.

Parameters: see PutItemIfNotExist

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxPutIfNotExistRaw

func (adc *AwsDynamodbConnect) BuildTxPutIfNotExistRaw(table string, item map[string]*dynamodb.AttributeValue, pkAttrs []string) (*dynamodb.TransactWriteItem, error)

BuildTxPutIfNotExistRaw builds a 'dynamodb.TransactWriteItem' with "insert if not exist" operation.

Parameters: see PutItemIfNotExistRaw

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxPutRaw

BuildTxPutRaw builds a 'dynamodb.TransactWriteItem' with "insert or replace" operation.

Parameters: see PutItemRaw

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxRemoveAttributes

func (adc *AwsDynamodbConnect) BuildTxRemoveAttributes(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsToRemove []string) (*dynamodb.TransactWriteItem, error)

BuildTxRemoveAttributes builds a 'dynamodb.TransactWriteItem' that removes one or more attributes from matched items.

Parameters: see RemoveAttributes

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxSetAttributes

func (adc *AwsDynamodbConnect) BuildTxSetAttributes(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToSet map[string]interface{}) (*dynamodb.TransactWriteItem, error)

BuildTxSetAttributes builds a 'dynamodb.TransactWriteItem' that sets value of one or more attributes of matched items.

Parameters: see SetAttributes

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxUpdate

func (adc *AwsDynamodbConnect) BuildTxUpdate(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder,
	attrsToRemove []string, attrsAndValuesToSet, attrsAndValuesToAdd, attrsAndValuesToDelete map[string]interface{}) (*dynamodb.TransactWriteItem, error)

BuildTxUpdate builds a 'dynamodb.TransactWriteItem' with "update" operation.

Parameters: see UpdateItem

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildTxUpdateRaw

func (adc *AwsDynamodbConnect) BuildTxUpdateRaw(table string, key map[string]*dynamodb.AttributeValue, updateExpression expression.Expression) (*dynamodb.TransactWriteItem, error)

BuildTxUpdateRaw builds a 'dynamodb.TransactWriteItem' with "update" operation.

Available: since v0.2.4

func (*AwsDynamodbConnect) BuildUpdateItemInput

func (adc *AwsDynamodbConnect) BuildUpdateItemInput(table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder,
	attrsToRemove []string, attrsAndValuesToSet, attrsAndValuesToAdd, attrsAndValuesToDelete map[string]interface{}) (*dynamodb.UpdateItemInput, error)

BuildUpdateItemInput is a helper function to build dynamodb.UpdateItemInput.

Parameters:

  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsToRemove : for REMOVE expression: completely remove attributes from matched items
  • attrsAndValuesToSet : for SET expression: completely override attribute values of matched items (new attributes are added if not exist)
  • attrsAndValuesToAdd : for ADD expression: if the argument value is a number, increment/decrement the existing attribute value; if the argument value is a set, it is added to the existing set
  • attrsAndValuesToDelete: for DELETE expression: the argument value must be a set, it is subtracted from the existing set

Note: at least one of attrsToRemove, attrsAndValuesToSet, attrsAndValuesToAdd, attrsAndValuesToDelete must be provided.

See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html

Available: since v0.2.6

func (*AwsDynamodbConnect) Close

func (adc *AwsDynamodbConnect) Close() error

Close frees all resources and closes all connection associated with this AwsDynamodbConnect.

func (*AwsDynamodbConnect) CreateGlobalSecondaryIndex

func (adc *AwsDynamodbConnect) CreateGlobalSecondaryIndex(ctx aws.Context, table, indexName string, rcu, wcu int64, attrDefs, keyAttrs []AwsDynamodbNameAndType) error

CreateGlobalSecondaryIndex creates a Global Secondary Index on a specified table.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • indexName: name of the index to be created
  • rcu : ReadCapacityUnits (0 means PAY_PER_REQUEST)
  • wcu : WriteCapacityUnits (0 means PAY_PER_REQUEST)
  • attrDefs : GSI attributes, where attribute-type is either "S", "N" or "B"
  • keyAttrs : GSI key schema, where key-type is either "HASH" or "RANGE"

Note:

  • DynamoDB GSI is created asynchronously. Use GetGlobalSecondaryIndexStatus to check GSI's existence.
  • GSI is created with projection type dynamodb.ProjectionTypeKeysOnly. Use CreateGlobalSecondaryIndexWithAction to create GSI with customized options.

func (*AwsDynamodbConnect) CreateGlobalSecondaryIndexWithAction

func (adc *AwsDynamodbConnect) CreateGlobalSecondaryIndexWithAction(ctx aws.Context, tableName string, attrDefs []AwsDynamodbNameAndType, action *dynamodb.CreateGlobalSecondaryIndexAction) error

CreateGlobalSecondaryIndexWithAction creates a Global Secondary Index on a specified table.

Available since v0.3.0

func (*AwsDynamodbConnect) CreateTable

func (adc *AwsDynamodbConnect) CreateTable(ctx aws.Context, table string, rcu, wcu int64, attrDefs, pkDefs []AwsDynamodbNameAndType) error

CreateTable create a new table without index.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table to be created
  • rcu : ReadCapacityUnits (0 means PAY_PER_REQUEST)
  • wcu : WriteCapacityUnits (0 means PAY_PER_REQUEST)
  • attrDefs: table attributes, where attribute-type is either "S", "N" or "B"
  • pkDefs : primary key definitions, where key-type is either "HASH" or "RANGE"

Note: DynamoDB table is created asynchronously. Use GetTableStatus to check table's existence.

func (*AwsDynamodbConnect) DeleteGlobalSecondaryIndex

func (adc *AwsDynamodbConnect) DeleteGlobalSecondaryIndex(ctx aws.Context, table, indexName string) error

DeleteGlobalSecondaryIndex deletes a Global Secondary Index on a specified table.

Parameters:

  • ctx: (optional) used for request cancellation

Notes:

  • DynamoDB GSI is deleted asynchronously. Use GetGlobalSecondaryIndexStatus to check index's existence.
  • This function ignores error if index does not exist.

func (*AwsDynamodbConnect) DeleteItem

func (adc *AwsDynamodbConnect) DeleteItem(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder) (*dynamodb.DeleteItemOutput, error)

DeleteItem removes a single item from specified table.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter: map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition: (optional) a condition that must be satisfied before removing item

func (*AwsDynamodbConnect) DeleteItemWithInput

func (adc *AwsDynamodbConnect) DeleteItemWithInput(ctx aws.Context, input *dynamodb.DeleteItemInput) (*dynamodb.DeleteItemOutput, error)

DeleteItemWithInput executes DynamoDB "delete-item" operation.

Available: since v0.2.6

func (*AwsDynamodbConnect) DeleteTable

func (adc *AwsDynamodbConnect) DeleteTable(ctx aws.Context, table string) error

DeleteTable deletes an existing table.

Parameters:

  • ctx: (optional) used for request cancellation

Notes:

  • DynamoDB table is deleted asynchronously. Use GetTableStatus to check table's existence.
  • This function ignores error if table does not exist.

func (*AwsDynamodbConnect) DeleteValuesFromSet

func (adc *AwsDynamodbConnect) DeleteValuesFromSet(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToDelete map[string]interface{}) (*dynamodb.UpdateItemOutput, error)

DeleteValuesFromSet deletes entry from one or more set-type attributes of matched items.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsAndValuesToDelete: attributes and values to delete

This function is exclusive for set-type attributes. It invokes UpdateItem's DELETE expression and passes the argument "attrsAndValuesToDelete" along the function call.

func (*AwsDynamodbConnect) ExecTxGetItems

ExecTxGetItems executes a "get-items" transaction.

Available: since v0.2.4

func (*AwsDynamodbConnect) ExecTxWriteItems

ExecTxWriteItems executes a "write-items" transaction.

Available: since v0.2.4

func (*AwsDynamodbConnect) GetDb

func (adc *AwsDynamodbConnect) GetDb() *dynamodb.DynamoDB

GetDb returns the underlying dynamodb.DynamoDB instance.

func (*AwsDynamodbConnect) GetDbProxy

func (adc *AwsDynamodbConnect) GetDbProxy() *DynamoDbProxy

GetDbProxy is similar to GetDb, but returns a proxy that can be used as a replacement.

Available since v0.3.0

func (*AwsDynamodbConnect) GetGlobalSecondaryIndexStatus

func (adc *AwsDynamodbConnect) GetGlobalSecondaryIndexStatus(ctx aws.Context, table, indexName string) (string, error)

GetGlobalSecondaryIndexStatus fetches and returns a table's GSI status.

Parameters:

  • ctx: (optional) used for request cancellation

Note: If index does not exist, this function returns "", nil

func (*AwsDynamodbConnect) GetItem

func (adc *AwsDynamodbConnect) GetItem(ctx aws.Context, table string, keyFilter map[string]interface{}) (AwsDynamodbItem, error)

GetItem fetches a single item from specified table.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter: map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes

Notes:

  • If item does not exist, this function returns (nil, nil).
  • All projected attributes will be fetched.
  • ConsistentRead is not set.

func (*AwsDynamodbConnect) GetItemWithInput

func (adc *AwsDynamodbConnect) GetItemWithInput(ctx aws.Context, input *dynamodb.GetItemInput) (*dynamodb.GetItemOutput, error)

GetItemWithInput executes DynamoDB "get-item" operation.

Available: since v0.2.6

func (*AwsDynamodbConnect) GetTableStatus

func (adc *AwsDynamodbConnect) GetTableStatus(ctx aws.Context, table string) (string, error)

GetTableStatus fetches and returns table status.

Parameters:

  • ctx: (optional) used for request cancellation

Note: If table does not exist, this function returns "", nil

func (*AwsDynamodbConnect) HasTable

func (adc *AwsDynamodbConnect) HasTable(ctx aws.Context, table string) (bool, error)

HasTable checks if a table exists.

Parameters:

  • ctx: (optional) used for request cancellation

func (*AwsDynamodbConnect) Init

func (adc *AwsDynamodbConnect) Init() error

Init should be called to initialize the AwsDynamodbConnect instance before use.

Available since v0.3.0

func (*AwsDynamodbConnect) ListTables

func (adc *AwsDynamodbConnect) ListTables(ctx aws.Context) ([]string, error)

ListTables returns all visible tables.

Parameters:

  • ctx: (optional) used for request cancellation

func (*AwsDynamodbConnect) LogMetrics

func (adc *AwsDynamodbConnect) LogMetrics(category string, cmd *prom.CmdExecInfo) error

LogMetrics is convenient function to put the CmdExecInfo to the metrics log.

This function is silently no-op of the input if nil or there is no associated metrics logger.

Available since v0.3.0

func (*AwsDynamodbConnect) Metrics

func (adc *AwsDynamodbConnect) Metrics(category string, opts ...prom.MetricsOpts) (*prom.Metrics, error)

Metrics is convenient function to capture the snapshot of command execution metrics.

This function is silently no-op of there is no associated metrics logger.

Available since v0.3.0

func (*AwsDynamodbConnect) MetricsLogger

func (adc *AwsDynamodbConnect) MetricsLogger() prom.IMetricsLogger

MetricsLogger returns the associated IMetricsLogger instance.

func (*AwsDynamodbConnect) NewCmdExecInfo

func (adc *AwsDynamodbConnect) NewCmdExecInfo() *prom.CmdExecInfo

NewCmdExecInfo is convenient function to create a new CmdExecInfo instance.

The returned CmdExecInfo has its 'id' and 'begin-time' fields initialized.

Available since v0.3.0

func (*AwsDynamodbConnect) NewContext

func (adc *AwsDynamodbConnect) NewContext(timeoutMs ...int) (aws.Context, context.CancelFunc)

NewContext creates a new context with specified timeout in milliseconds. If there is no specified timeout, or timeout value is less than or equal to 0, the default timeout is used.

func (*AwsDynamodbConnect) PutItem

func (adc *AwsDynamodbConnect) PutItem(ctx aws.Context, table string, item interface{}, condition *expression.ConditionBuilder) (*dynamodb.PutItemOutput, error)

PutItem inserts a new item to table or replace an existing one.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • item : item to be inserted (a map or struct), will be converted to map[string]*dynamodb.AttributeValue via dynamodbattribute.MarshalMap(item)
  • condition: (optional) a condition that must be satisfied before writing item

func (*AwsDynamodbConnect) PutItemIfNotExist

func (adc *AwsDynamodbConnect) PutItemIfNotExist(ctx aws.Context, table string, item interface{}, pkAttrs []string) (*dynamodb.PutItemOutput, error)

PutItemIfNotExist inserts a new item to table only if it does not exist.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • item : item to be inserted (a map or struct), will be converted to map[string]*dynamodb.AttributeValue via dynamodbattribute.MarshalMap(item)
  • pkAttrs: primary key attribute names

Note: (since v0.2.7) if item already existed, this function return (nil, nil)

func (*AwsDynamodbConnect) PutItemIfNotExistRaw

func (adc *AwsDynamodbConnect) PutItemIfNotExistRaw(ctx aws.Context, table string, item map[string]*dynamodb.AttributeValue, pkAttrs []string) (*dynamodb.PutItemOutput, error)

PutItemIfNotExistRaw inserts a new item to table only if it does not exist.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • item : item to be inserted
  • pkAttrs: primary key attribute names

Note: (since v0.2.7) if item already existed, this function return (nil, nil)

func (*AwsDynamodbConnect) PutItemRaw

PutItemRaw inserts a new item to table or replace an existing one.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • item : item to be inserted
  • condition: (optional) a condition that must be satisfied before writing item

func (*AwsDynamodbConnect) PutItemWithInput

func (adc *AwsDynamodbConnect) PutItemWithInput(ctx aws.Context, input *dynamodb.PutItemInput) (*dynamodb.PutItemOutput, error)

PutItemWithInput executes DynamoDB "put-item" operation.

Available: since v0.2.6

func (*AwsDynamodbConnect) QueryItems

func (adc *AwsDynamodbConnect) QueryItems(ctx aws.Context, table string, keyFilter, nonKeyFilter *expression.ConditionBuilder,
	indexName string, opts ...AwsQueryOpt) ([]AwsDynamodbItem, error)

QueryItems fetches multiple items from specified table using "query" operation.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table to be scanned
  • keyFilter : used to filter items on primary key attributes
  • nonKeyFilter : used to filter items on non-primary key attributes before returning result
  • indexName : if non-empty, use this secondary index to scan (local or global)
  • opts : additional query options (since v0.2.15)

Notes:

  • This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.
  • All projected attributes will be fetched.
  • ConsistentRead is not set.

func (*AwsDynamodbConnect) QueryItemsWithCallback

func (adc *AwsDynamodbConnect) QueryItemsWithCallback(ctx aws.Context, table string, keyFilter, nonKeyFilter *expression.ConditionBuilder,
	indexName string, exclusiveStartKey map[string]*dynamodb.AttributeValue, callback AwsDynamodbItemCallback,
	opts ...AwsQueryOpt) error

QueryItemsWithCallback fetches multiple items from specified table using "query" operation.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table to be scanned
  • keyFilter : used to filter items on primary key attributes
  • nonKeyFilter : used to filter items on non-primary key attributes before returning result
  • indexName : if non-empty, use this secondary index to query (local or global)
  • exclusiveStartKey: (optional) skip items till this key (used for paging)
  • callback : callback function
  • opts : additional query options (since v0.2.15)

Notes:

  • This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.
  • All projected attributes will be fetched.
  • ConsistentRead is not set.

func (*AwsDynamodbConnect) QueryWithInput

func (adc *AwsDynamodbConnect) QueryWithInput(ctx aws.Context, input *dynamodb.QueryInput) ([]AwsDynamodbItem, error)

QueryWithInput executes DynamoDB "query" operation.

Note: This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.

Available: since v0.2.6

func (*AwsDynamodbConnect) QueryWithInputCallback

func (adc *AwsDynamodbConnect) QueryWithInputCallback(ctx aws.Context, input *dynamodb.QueryInput, callback AwsDynamodbItemCallback) error

QueryWithInputCallback executes DynamoDB "query" operation.

Note: This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.

Available: since v0.2.6

func (*AwsDynamodbConnect) RegisterMetricsLogger

func (adc *AwsDynamodbConnect) RegisterMetricsLogger(metricsLogger prom.IMetricsLogger) *AwsDynamodbConnect

RegisterMetricsLogger associate an IMetricsLogger instance with this AwsDynamodbConnect. If non-nil, AwsDynamodbConnect automatically logs executing commands.

Available since v0.3.0

func (*AwsDynamodbConnect) RemoveAttributes

func (adc *AwsDynamodbConnect) RemoveAttributes(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsToRemove []string) (*dynamodb.UpdateItemOutput, error)

RemoveAttributes removes one or more attributes from matched items.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsToRemove: list of attributes to remove

This function invokes UpdateItem's REMOVE expression and passes the argument "attrsToRemove" along the function call.

func (*AwsDynamodbConnect) ScanItems

func (adc *AwsDynamodbConnect) ScanItems(ctx aws.Context, table string, filter *expression.ConditionBuilder, indexName string) ([]AwsDynamodbItem, error)

ScanItems fetches multiple items from specified table using "scan" operation.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table to be scanned
  • filter : (optional) used to filter scanned items
  • indexName : if non-empty, use this secondary index to scan (local or global)

Notes:

  • This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.
  • All projected attributes will be fetched.
  • ConsistentRead is not set.

func (*AwsDynamodbConnect) ScanItemsWithCallback

func (adc *AwsDynamodbConnect) ScanItemsWithCallback(ctx aws.Context, table string, filter *expression.ConditionBuilder, indexName string, exclusiveStartKey map[string]*dynamodb.AttributeValue, callback AwsDynamodbItemCallback) error

ScanItemsWithCallback fetches multiple items from specified table using "scan" operation.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table to be scanned
  • filter : (optional) used to filter scanned items
  • indexName : if non-empty, use this secondary index to scan (local or global)
  • exclusiveStartKey: (optional) skip items till this key (used for paging)
  • callback : callback function

Notes:

  • This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.
  • All projected attributes will be fetched.
  • ConsistentRead is not set.

func (*AwsDynamodbConnect) ScanWithInput

func (adc *AwsDynamodbConnect) ScanWithInput(ctx aws.Context, input *dynamodb.ScanInput) ([]AwsDynamodbItem, error)

ScanWithInput executes DynamoDB "scan" operation.

Note: This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.

Available: since v0.2.6

func (*AwsDynamodbConnect) ScanWithInputCallback

func (adc *AwsDynamodbConnect) ScanWithInputCallback(ctx aws.Context, input *dynamodb.ScanInput, callback AwsDynamodbItemCallback) error

ScanWithInputCallback executes DynamoDB "scan" operation.

Note: This function may not fetch all item's attributes when using secondary index and not all attributes are projected to the index.

Available: since v0.2.6

func (*AwsDynamodbConnect) SetAttributes

func (adc *AwsDynamodbConnect) SetAttributes(ctx aws.Context, table string, keyFilter map[string]interface{}, condition *expression.ConditionBuilder, attrsAndValuesToSet map[string]interface{}) (*dynamodb.UpdateItemOutput, error)

SetAttributes sets value of one or more attributes of matched items.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsAndValuesToSet: list of attributes and values to set

This function invokes UpdateItem's SET expression and passes the argument "attrsAndValuesToSet" along the function call.

func (*AwsDynamodbConnect) UpdateItem

func (adc *AwsDynamodbConnect) UpdateItem(ctx aws.Context, table string,
	keyFilter map[string]interface{}, condition *expression.ConditionBuilder,
	attrsToRemove []string, attrsAndValuesToSet, attrsAndValuesToAdd, attrsAndValuesToDelete map[string]interface{}) (*dynamodb.UpdateItemOutput, error)

UpdateItem performs operation remove/set/add value/delete values from item's attributes.

Parameters:

  • ctx : (optional) used for request cancellation
  • table : name of the table
  • keyFilter : map of {primary-key-attribute-name:attribute-value}, must include all primary key's attributes
  • condition : (optional) a condition that must be satisfied before updating item
  • attrsToRemove : for REMOVE expression: completely remove attributes from matched items
  • attrsAndValuesToSet : for SET expression: completely override attribute values of matched items (new attributes are added if not exist)
  • attrsAndValuesToAdd : for ADD expression: if the argument value is a number, increment/decrement the existing attribute value; if the argument value is a set, it is added to the existing set
  • attrsAndValuesToDelete: for DELETE expression: the argument value must be a set, it is subtracted from the existing set

Note: at least one of attrsToRemove, attrsAndValuesToSet, attrsAndValuesToAdd, attrsAndValuesToDelete must be provided.

See https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html

func (*AwsDynamodbConnect) UpdateItemWithInput

func (adc *AwsDynamodbConnect) UpdateItemWithInput(ctx aws.Context, input *dynamodb.UpdateItemInput) (*dynamodb.UpdateItemOutput, error)

UpdateItemWithInput executes DynamoDB "update-item" operation.

Available: since v0.2.6

func (*AwsDynamodbConnect) WrapTxGetItems

func (adc *AwsDynamodbConnect) WrapTxGetItems(ctx aws.Context, items ...*dynamodb.TransactGetItem) ([]AwsDynamodbItem, error)

WrapTxGetItems is convenient function to execute a "get-items" transaction.

Available since v0.3.0

func (*AwsDynamodbConnect) WrapTxWriteItems

func (adc *AwsDynamodbConnect) WrapTxWriteItems(ctx aws.Context, clientRequestToken string, items ...*dynamodb.TransactWriteItem) (*dynamodb.TransactWriteItemsOutput, error)

WrapTxWriteItems is convenient function to execute a "write-items" transaction.

Available since v0.3.0

type AwsDynamodbItem

type AwsDynamodbItem map[string]interface{}

AwsDynamodbItem defines a generic structure for DynamoDB item.

type AwsDynamodbItemCallback

type AwsDynamodbItemCallback func(item AwsDynamodbItem, lastEvaluatedKey map[string]*dynamodb.AttributeValue) (bool, error)

AwsDynamodbItemCallback defines callback interface for "scan"/"query" operation.

If callback function returns false or error, the scan/query process will stop (even if there are still more items).

type AwsDynamodbNameAndType

type AwsDynamodbNameAndType struct{ Name, Type string }

AwsDynamodbNameAndType defines a generic name & type pair.

type AwsQueryOpt

type AwsQueryOpt struct {
	ScanIndexBackward *bool // if set to true, scan the index backward
}

AwsQueryOpt provides additional options to AwsDynamodbConnect.QueryItems and AwsDynamodbConnect.QueryItemsWithCallback.

Available since v0.2.15

type DynamoDbProxy

type DynamoDbProxy struct {
	*dynamodb.DynamoDB
	// contains filtered or unexported fields
}

DynamoDbProxy is a proxy that can be used as replacement for dynamodb.DynamoDB.

This proxy overrides some functions from dynamodb.DynamoDB and automatically logs the execution metrics.

Available since v0.3.0

func (*DynamoDbProxy) BatchExecuteStatement

BatchExecuteStatement overrides dynamodb.DynamoDB/BatchExecuteStatement to log execution metrics.

func (*DynamoDbProxy) BatchExecuteStatementWithContext

func (dp *DynamoDbProxy) BatchExecuteStatementWithContext(ctx aws.Context, input *dynamodb.BatchExecuteStatementInput, opts ...request.Option) (*dynamodb.BatchExecuteStatementOutput, error)

BatchExecuteStatementWithContext overrides dynamodb.DynamoDB/BatchExecuteStatementWithContext to log execution metrics.

func (*DynamoDbProxy) BatchGetItem

BatchGetItem overrides dynamodb.DynamoDB/BatchGetItem to log execution metrics.

func (*DynamoDbProxy) BatchGetItemPages

func (dp *DynamoDbProxy) BatchGetItemPages(input *dynamodb.BatchGetItemInput, fn func(*dynamodb.BatchGetItemOutput, bool) bool) error

BatchGetItemPages overrides dynamodb.DynamoDB/BatchGetItemPages to log execution metrics.

func (*DynamoDbProxy) BatchGetItemPagesWithContext

func (dp *DynamoDbProxy) BatchGetItemPagesWithContext(ctx aws.Context, input *dynamodb.BatchGetItemInput, fn func(*dynamodb.BatchGetItemOutput, bool) bool, opts ...request.Option) error

BatchGetItemPagesWithContext overrides dynamodb.DynamoDB/BatchGetItemPagesWithContext to log execution metrics.

func (*DynamoDbProxy) BatchGetItemWithContext

func (dp *DynamoDbProxy) BatchGetItemWithContext(ctx aws.Context, input *dynamodb.BatchGetItemInput, opts ...request.Option) (*dynamodb.BatchGetItemOutput, error)

BatchGetItemWithContext overrides dynamodb.DynamoDB/BatchGetItemWithContext to log execution metrics.

func (*DynamoDbProxy) BatchWriteItem

BatchWriteItem overrides dynamodb.DynamoDB/BatchWriteItem to log execution metrics.

func (*DynamoDbProxy) BatchWriteItemWithContext

func (dp *DynamoDbProxy) BatchWriteItemWithContext(ctx aws.Context, input *dynamodb.BatchWriteItemInput, opts ...request.Option) (*dynamodb.BatchWriteItemOutput, error)

BatchWriteItemWithContext overrides dynamodb.DynamoDB/BatchWriteItemWithContext to log execution metrics.

func (*DynamoDbProxy) CreateBackup

CreateBackup overrides dynamodb.DynamoDB/CreateBackup to log execution metrics.

func (*DynamoDbProxy) CreateBackupWithContext

func (dp *DynamoDbProxy) CreateBackupWithContext(ctx aws.Context, input *dynamodb.CreateBackupInput, opts ...request.Option) (*dynamodb.CreateBackupOutput, error)

CreateBackupWithContext overrides dynamodb.DynamoDB/CreateBackupWithContext to log execution metrics.

func (*DynamoDbProxy) CreateGlobalTable

CreateGlobalTable overrides dynamodb.DynamoDB/CreateGlobalTable to log execution metrics.

func (*DynamoDbProxy) CreateGlobalTableWithContext

func (dp *DynamoDbProxy) CreateGlobalTableWithContext(ctx aws.Context, input *dynamodb.CreateGlobalTableInput, opts ...request.Option) (*dynamodb.CreateGlobalTableOutput, error)

CreateGlobalTableWithContext overrides dynamodb.DynamoDB/CreateGlobalTableWithContext to log execution metrics.

func (*DynamoDbProxy) CreateTable

CreateTable overrides dynamodb.DynamoDB/CreateTable to log execution metrics.

func (*DynamoDbProxy) CreateTableWithContext

func (dp *DynamoDbProxy) CreateTableWithContext(ctx aws.Context, input *dynamodb.CreateTableInput, opts ...request.Option) (*dynamodb.CreateTableOutput, error)

CreateTableWithContext overrides dynamodb.DynamoDB/CreateTableWithContext to log execution metrics.

func (*DynamoDbProxy) DeleteBackup

DeleteBackup overrides dynamodb.DynamoDB/DeleteBackup to log execution metrics.

func (*DynamoDbProxy) DeleteBackupWithContext

func (dp *DynamoDbProxy) DeleteBackupWithContext(ctx aws.Context, input *dynamodb.DeleteBackupInput, opts ...request.Option) (*dynamodb.DeleteBackupOutput, error)

DeleteBackupWithContext overrides dynamodb.DynamoDB/DeleteBackupWithContext to log execution metrics.

func (*DynamoDbProxy) DeleteItem

DeleteItem overrides dynamodb.DynamoDB/DeleteItem to log execution metrics.

func (*DynamoDbProxy) DeleteItemWithContext

func (dp *DynamoDbProxy) DeleteItemWithContext(ctx aws.Context, input *dynamodb.DeleteItemInput, opts ...request.Option) (*dynamodb.DeleteItemOutput, error)

DeleteItemWithContext overrides dynamodb.DynamoDB/DeleteItemWithContext to log execution metrics.

func (*DynamoDbProxy) DeleteTable

DeleteTable overrides dynamodb.DynamoDB/DeleteTable to log execution metrics.

func (*DynamoDbProxy) DeleteTableWithContext

func (dp *DynamoDbProxy) DeleteTableWithContext(ctx aws.Context, input *dynamodb.DeleteTableInput, opts ...request.Option) (*dynamodb.DeleteTableOutput, error)

DeleteTableWithContext overrides dynamodb.DynamoDB/DeleteTableWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeBackup

DescribeBackup overrides dynamodb.DynamoDB/DescribeBackup to log execution metrics.

func (*DynamoDbProxy) DescribeBackupWithContext

func (dp *DynamoDbProxy) DescribeBackupWithContext(ctx aws.Context, input *dynamodb.DescribeBackupInput, opts ...request.Option) (*dynamodb.DescribeBackupOutput, error)

DescribeBackupWithContext overrides dynamodb.DynamoDB/DescribeBackupWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeContinuousBackups

DescribeContinuousBackups overrides dynamodb.DynamoDB/DescribeContinuousBackups to log execution metrics.

func (*DynamoDbProxy) DescribeContinuousBackupsWithContext

func (dp *DynamoDbProxy) DescribeContinuousBackupsWithContext(ctx aws.Context, input *dynamodb.DescribeContinuousBackupsInput, opts ...request.Option) (*dynamodb.DescribeContinuousBackupsOutput, error)

DescribeContinuousBackupsWithContext overrides dynamodb.DynamoDB/DescribeContinuousBackupsWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeContributorInsights

DescribeContributorInsights overrides dynamodb.DynamoDB/DescribeContributorInsights to log execution metrics.

func (*DynamoDbProxy) DescribeContributorInsightsWithContext

func (dp *DynamoDbProxy) DescribeContributorInsightsWithContext(ctx aws.Context, input *dynamodb.DescribeContributorInsightsInput, opts ...request.Option) (*dynamodb.DescribeContributorInsightsOutput, error)

DescribeContributorInsightsWithContext overrides dynamodb.DynamoDB/DescribeContributorInsightsWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeEndpoints

DescribeEndpoints overrides dynamodb.DynamoDB/DescribeEndpoints to log execution metrics.

func (*DynamoDbProxy) DescribeEndpointsWithContext

func (dp *DynamoDbProxy) DescribeEndpointsWithContext(ctx aws.Context, input *dynamodb.DescribeEndpointsInput, opts ...request.Option) (*dynamodb.DescribeEndpointsOutput, error)

DescribeEndpointsWithContext overrides dynamodb.DynamoDB/DescribeEndpointsWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeExport

DescribeExport overrides dynamodb.DynamoDB/DescribeExport to log execution metrics.

func (*DynamoDbProxy) DescribeExportWithContext

func (dp *DynamoDbProxy) DescribeExportWithContext(ctx aws.Context, input *dynamodb.DescribeExportInput, opts ...request.Option) (*dynamodb.DescribeExportOutput, error)

DescribeExportWithContext overrides dynamodb.DynamoDB/DescribeExportWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeGlobalTable

DescribeGlobalTable overrides dynamodb.DynamoDB/DescribeGlobalTable to log execution metrics.

func (*DynamoDbProxy) DescribeGlobalTableSettings

DescribeGlobalTableSettings overrides dynamodb.DynamoDB/DescribeGlobalTableSettings to log execution metrics.

func (*DynamoDbProxy) DescribeGlobalTableSettingsWithContext

func (dp *DynamoDbProxy) DescribeGlobalTableSettingsWithContext(ctx aws.Context, input *dynamodb.DescribeGlobalTableSettingsInput, opts ...request.Option) (*dynamodb.DescribeGlobalTableSettingsOutput, error)

DescribeGlobalTableSettingsWithContext overrides dynamodb.DynamoDB/DescribeGlobalTableSettingsWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeGlobalTableWithContext

func (dp *DynamoDbProxy) DescribeGlobalTableWithContext(ctx aws.Context, input *dynamodb.DescribeGlobalTableInput, opts ...request.Option) (*dynamodb.DescribeGlobalTableOutput, error)

DescribeGlobalTableWithContext overrides dynamodb.DynamoDB/DescribeGlobalTableWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeKinesisStreamingDestination

DescribeKinesisStreamingDestination overrides dynamodb.DynamoDB/DescribeKinesisStreamingDestination to log execution metrics.

func (*DynamoDbProxy) DescribeKinesisStreamingDestinationWithContext

func (dp *DynamoDbProxy) DescribeKinesisStreamingDestinationWithContext(ctx aws.Context, input *dynamodb.DescribeKinesisStreamingDestinationInput, opts ...request.Option) (*dynamodb.DescribeKinesisStreamingDestinationOutput, error)

DescribeKinesisStreamingDestinationWithContext overrides dynamodb.DynamoDB/DescribeKinesisStreamingDestinationWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeLimits

DescribeLimits overrides dynamodb.DynamoDB/DescribeLimits to log execution metrics.

func (*DynamoDbProxy) DescribeLimitsWithContext

func (dp *DynamoDbProxy) DescribeLimitsWithContext(ctx aws.Context, input *dynamodb.DescribeLimitsInput, opts ...request.Option) (*dynamodb.DescribeLimitsOutput, error)

DescribeLimitsWithContext overrides dynamodb.DynamoDB/DescribeLimitsWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeTable

DescribeTable overrides dynamodb.DynamoDB/DescribeTable to log execution metrics.

func (*DynamoDbProxy) DescribeTableReplicaAutoScaling

DescribeTableReplicaAutoScaling overrides dynamodb.DynamoDB/DescribeTableReplicaAutoScaling to log execution metrics.

func (*DynamoDbProxy) DescribeTableReplicaAutoScalingWithContext

func (dp *DynamoDbProxy) DescribeTableReplicaAutoScalingWithContext(ctx aws.Context, input *dynamodb.DescribeTableReplicaAutoScalingInput, opts ...request.Option) (*dynamodb.DescribeTableReplicaAutoScalingOutput, error)

DescribeTableReplicaAutoScalingWithContext overrides dynamodb.DynamoDB/DescribeTableReplicaAutoScalingWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeTableWithContext

func (dp *DynamoDbProxy) DescribeTableWithContext(ctx aws.Context, input *dynamodb.DescribeTableInput, opts ...request.Option) (*dynamodb.DescribeTableOutput, error)

DescribeTableWithContext overrides dynamodb.DynamoDB/DescribeTableWithContext to log execution metrics.

func (*DynamoDbProxy) DescribeTimeToLive

DescribeTimeToLive overrides dynamodb.DynamoDB/DescribeTimeToLive to log execution metrics.

func (*DynamoDbProxy) DescribeTimeToLiveWithContext

func (dp *DynamoDbProxy) DescribeTimeToLiveWithContext(ctx aws.Context, input *dynamodb.DescribeTimeToLiveInput, opts ...request.Option) (*dynamodb.DescribeTimeToLiveOutput, error)

DescribeTimeToLiveWithContext overrides dynamodb.DynamoDB/DescribeTimeToLiveWithContext to log execution metrics.

func (*DynamoDbProxy) DisableKinesisStreamingDestination

DisableKinesisStreamingDestination overrides dynamodb.DynamoDB/DisableKinesisStreamingDestination to log execution metrics.

func (*DynamoDbProxy) DisableKinesisStreamingDestinationWithContext

func (dp *DynamoDbProxy) DisableKinesisStreamingDestinationWithContext(ctx aws.Context, input *dynamodb.DisableKinesisStreamingDestinationInput, opts ...request.Option) (*dynamodb.DisableKinesisStreamingDestinationOutput, error)

DisableKinesisStreamingDestinationWithContext overrides dynamodb.DynamoDB/DisableKinesisStreamingDestinationWithContext to log execution metrics.

func (*DynamoDbProxy) EnableKinesisStreamingDestination

EnableKinesisStreamingDestination overrides dynamodb.DynamoDB/EnableKinesisStreamingDestination to log execution metrics.

func (*DynamoDbProxy) EnableKinesisStreamingDestinationWithContext

func (dp *DynamoDbProxy) EnableKinesisStreamingDestinationWithContext(ctx aws.Context, input *dynamodb.EnableKinesisStreamingDestinationInput, opts ...request.Option) (*dynamodb.EnableKinesisStreamingDestinationOutput, error)

EnableKinesisStreamingDestinationWithContext overrides dynamodb.DynamoDB/EnableKinesisStreamingDestinationWithContext to log execution metrics.

func (*DynamoDbProxy) ExecuteStatement

ExecuteStatement overrides dynamodb.DynamoDB/ExecuteStatement to log execution metrics.

func (*DynamoDbProxy) ExecuteStatementWithContext

func (dp *DynamoDbProxy) ExecuteStatementWithContext(ctx aws.Context, input *dynamodb.ExecuteStatementInput, opts ...request.Option) (*dynamodb.ExecuteStatementOutput, error)

ExecuteStatementWithContext overrides dynamodb.DynamoDB/ExecuteStatementWithContext to log execution metrics.

func (*DynamoDbProxy) ExecuteTransaction

ExecuteTransaction overrides dynamodb.DynamoDB/ExecuteTransaction to log execution metrics.

func (*DynamoDbProxy) ExecuteTransactionWithContext

func (dp *DynamoDbProxy) ExecuteTransactionWithContext(ctx aws.Context, input *dynamodb.ExecuteTransactionInput, opts ...request.Option) (*dynamodb.ExecuteTransactionOutput, error)

ExecuteTransactionWithContext overrides dynamodb.DynamoDB/ExecuteTransactionWithContext to log execution metrics.

func (*DynamoDbProxy) ExportTableToPointInTime

ExportTableToPointInTime overrides dynamodb.DynamoDB/ExportTableToPointInTime to log execution metrics.

func (*DynamoDbProxy) ExportTableToPointInTimeWithContext

func (dp *DynamoDbProxy) ExportTableToPointInTimeWithContext(ctx aws.Context, input *dynamodb.ExportTableToPointInTimeInput, opts ...request.Option) (*dynamodb.ExportTableToPointInTimeOutput, error)

ExportTableToPointInTimeWithContext overrides dynamodb.DynamoDB/ExportTableToPointInTimeWithContext to log execution metrics.

func (*DynamoDbProxy) GetItem

GetItem overrides dynamodb.DynamoDB/GetItem to log execution metrics.

func (*DynamoDbProxy) GetItemWithContext

func (dp *DynamoDbProxy) GetItemWithContext(ctx aws.Context, input *dynamodb.GetItemInput, opts ...request.Option) (*dynamodb.GetItemOutput, error)

GetItemWithContext overrides dynamodb.DynamoDB/GetItemWithContext to log execution metrics.

func (*DynamoDbProxy) ListBackups

ListBackups overrides dynamodb.DynamoDB/ListBackups to log execution metrics.

func (*DynamoDbProxy) ListBackupsWithContext

func (dp *DynamoDbProxy) ListBackupsWithContext(ctx aws.Context, input *dynamodb.ListBackupsInput, opts ...request.Option) (*dynamodb.ListBackupsOutput, error)

ListBackupsWithContext overrides dynamodb.DynamoDB/ListBackupsWithContext to log execution metrics.

func (*DynamoDbProxy) ListContributorInsights

ListContributorInsights overrides dynamodb.DynamoDB/ListContributorInsights to log execution metrics.

func (*DynamoDbProxy) ListContributorInsightsPages

func (dp *DynamoDbProxy) ListContributorInsightsPages(input *dynamodb.ListContributorInsightsInput, fn func(*dynamodb.ListContributorInsightsOutput, bool) bool) error

ListContributorInsightsPages overrides dynamodb.DynamoDB/ListContributorInsightsPages to log execution metrics.

func (*DynamoDbProxy) ListContributorInsightsPagesWithContext

func (dp *DynamoDbProxy) ListContributorInsightsPagesWithContext(ctx aws.Context, input *dynamodb.ListContributorInsightsInput, fn func(*dynamodb.ListContributorInsightsOutput, bool) bool, opts ...request.Option) error

ListContributorInsightsPagesWithContext overrides dynamodb.DynamoDB/ListContributorInsightsPagesWithContext to log execution metrics.

func (*DynamoDbProxy) ListContributorInsightsWithContext

func (dp *DynamoDbProxy) ListContributorInsightsWithContext(ctx aws.Context, input *dynamodb.ListContributorInsightsInput, opts ...request.Option) (*dynamodb.ListContributorInsightsOutput, error)

ListContributorInsightsWithContext overrides dynamodb.DynamoDB/ListContributorInsightsWithContext to log execution metrics.

func (*DynamoDbProxy) ListExports

ListExports overrides dynamodb.DynamoDB/ListExports to log execution metrics.

func (*DynamoDbProxy) ListExportsPages

func (dp *DynamoDbProxy) ListExportsPages(input *dynamodb.ListExportsInput, fn func(*dynamodb.ListExportsOutput, bool) bool) error

ListExportsPages overrides dynamodb.DynamoDB/ListExportsPages to log execution metrics.

func (*DynamoDbProxy) ListExportsPagesWithContext

func (dp *DynamoDbProxy) ListExportsPagesWithContext(ctx aws.Context, input *dynamodb.ListExportsInput, fn func(*dynamodb.ListExportsOutput, bool) bool, opts ...request.Option) error

ListExportsPagesWithContext overrides dynamodb.DynamoDB/ListExportsPagesWithContext to log execution metrics.

func (*DynamoDbProxy) ListExportsWithContext

func (dp *DynamoDbProxy) ListExportsWithContext(ctx aws.Context, input *dynamodb.ListExportsInput, opts ...request.Option) (*dynamodb.ListExportsOutput, error)

ListExportsWithContext overrides dynamodb.DynamoDB/ListExportsWithContext to log execution metrics.

func (*DynamoDbProxy) ListGlobalTables

ListGlobalTables overrides dynamodb.DynamoDB/ListGlobalTables to log execution metrics.

func (*DynamoDbProxy) ListGlobalTablesWithContext

func (dp *DynamoDbProxy) ListGlobalTablesWithContext(ctx aws.Context, input *dynamodb.ListGlobalTablesInput, opts ...request.Option) (*dynamodb.ListGlobalTablesOutput, error)

ListGlobalTablesWithContext overrides dynamodb.DynamoDB/ListGlobalTablesWithContext to log execution metrics.

func (*DynamoDbProxy) ListTables

ListTables overrides dynamodb.DynamoDB/ListTables to log execution metrics.

func (*DynamoDbProxy) ListTablesPages

func (dp *DynamoDbProxy) ListTablesPages(input *dynamodb.ListTablesInput, fn func(*dynamodb.ListTablesOutput, bool) bool) error

ListTablesPages overrides dynamodb.DynamoDB/ListTablesPages to log execution metrics.

func (*DynamoDbProxy) ListTablesPagesWithContext

func (dp *DynamoDbProxy) ListTablesPagesWithContext(ctx aws.Context, input *dynamodb.ListTablesInput, fn func(*dynamodb.ListTablesOutput, bool) bool, opts ...request.Option) error

ListTablesPagesWithContext overrides dynamodb.DynamoDB/ListTablesPagesWithContext to log execution metrics.

func (*DynamoDbProxy) ListTablesWithContext

func (dp *DynamoDbProxy) ListTablesWithContext(ctx aws.Context, input *dynamodb.ListTablesInput, opts ...request.Option) (*dynamodb.ListTablesOutput, error)

ListTablesWithContext overrides dynamodb.DynamoDB/ListTablesWithContext to log execution metrics.

func (*DynamoDbProxy) ListTagsOfResource

ListTagsOfResource overrides dynamodb.DynamoDB/ListTagsOfResource to log execution metrics.

func (*DynamoDbProxy) ListTagsOfResourceWithContext

func (dp *DynamoDbProxy) ListTagsOfResourceWithContext(ctx aws.Context, input *dynamodb.ListTagsOfResourceInput, opts ...request.Option) (*dynamodb.ListTagsOfResourceOutput, error)

ListTagsOfResourceWithContext overrides dynamodb.DynamoDB/ListTagsOfResourceWithContext to log execution metrics.

func (*DynamoDbProxy) PutItem

PutItem overrides dynamodb.DynamoDB/PutItem to log execution metrics.

func (*DynamoDbProxy) PutItemWithContext

func (dp *DynamoDbProxy) PutItemWithContext(ctx aws.Context, input *dynamodb.PutItemInput, opts ...request.Option) (*dynamodb.PutItemOutput, error)

PutItemWithContext overrides dynamodb.DynamoDB/PutItemWithContext to log execution metrics.

func (*DynamoDbProxy) Query

Query overrides dynamodb.DynamoDB/Query to log execution metrics.

func (*DynamoDbProxy) QueryPages

func (dp *DynamoDbProxy) QueryPages(input *dynamodb.QueryInput, fn func(*dynamodb.QueryOutput, bool) bool) error

QueryPages overrides dynamodb.DynamoDB/QueryPages to log execution metrics.

func (*DynamoDbProxy) QueryPagesWithContext

func (dp *DynamoDbProxy) QueryPagesWithContext(ctx aws.Context, input *dynamodb.QueryInput, fn func(*dynamodb.QueryOutput, bool) bool, opts ...request.Option) error

QueryPagesWithContext overrides dynamodb.DynamoDB/QueryPagesWithContext to log execution metrics.

func (*DynamoDbProxy) QueryWithContext

func (dp *DynamoDbProxy) QueryWithContext(ctx aws.Context, input *dynamodb.QueryInput, opts ...request.Option) (*dynamodb.QueryOutput, error)

QueryWithContext overrides dynamodb.DynamoDB/QueryWithContext to log execution metrics.

func (*DynamoDbProxy) RestoreTableFromBackup

RestoreTableFromBackup overrides dynamodb.DynamoDB/RestoreTableFromBackup to log execution metrics.

func (*DynamoDbProxy) RestoreTableFromBackupWithContext

func (dp *DynamoDbProxy) RestoreTableFromBackupWithContext(ctx aws.Context, input *dynamodb.RestoreTableFromBackupInput, opts ...request.Option) (*dynamodb.RestoreTableFromBackupOutput, error)

RestoreTableFromBackupWithContext overrides dynamodb.DynamoDB/RestoreTableFromBackupWithContext to log execution metrics.

func (*DynamoDbProxy) RestoreTableToPointInTime

RestoreTableToPointInTime overrides dynamodb.DynamoDB/RestoreTableToPointInTime to log execution metrics.

func (*DynamoDbProxy) RestoreTableToPointInTimeWithContext

func (dp *DynamoDbProxy) RestoreTableToPointInTimeWithContext(ctx aws.Context, input *dynamodb.RestoreTableToPointInTimeInput, opts ...request.Option) (*dynamodb.RestoreTableToPointInTimeOutput, error)

RestoreTableToPointInTimeWithContext overrides dynamodb.DynamoDB/RestoreTableToPointInTimeWithContext to log execution metrics.

func (*DynamoDbProxy) Scan

Scan overrides dynamodb.DynamoDB/Scan to log execution metrics.

func (*DynamoDbProxy) ScanPages

func (dp *DynamoDbProxy) ScanPages(input *dynamodb.ScanInput, fn func(*dynamodb.ScanOutput, bool) bool) error

ScanPages overrides dynamodb.DynamoDB/ScanPages to log execution metrics.

func (*DynamoDbProxy) ScanPagesWithContext

func (dp *DynamoDbProxy) ScanPagesWithContext(ctx aws.Context, input *dynamodb.ScanInput, fn func(*dynamodb.ScanOutput, bool) bool, opts ...request.Option) error

ScanPagesWithContext overrides dynamodb.DynamoDB/ScanPagesWithContext to log execution metrics.

func (*DynamoDbProxy) ScanWithContext

func (dp *DynamoDbProxy) ScanWithContext(ctx aws.Context, input *dynamodb.ScanInput, opts ...request.Option) (*dynamodb.ScanOutput, error)

ScanWithContext overrides dynamodb.DynamoDB/ScanWithContext to log execution metrics.

func (*DynamoDbProxy) TagResource

TagResource overrides dynamodb.DynamoDB/TagResource to log execution metrics.

func (*DynamoDbProxy) TagResourceWithContext

func (dp *DynamoDbProxy) TagResourceWithContext(ctx aws.Context, input *dynamodb.TagResourceInput, opts ...request.Option) (*dynamodb.TagResourceOutput, error)

TagResourceWithContext overrides dynamodb.DynamoDB/TagResourceWithContext to log execution metrics.

func (*DynamoDbProxy) TransactGetItems

TransactGetItems overrides dynamodb.DynamoDB/TransactGetItems to log execution metrics.

func (*DynamoDbProxy) TransactGetItemsWithContext

func (dp *DynamoDbProxy) TransactGetItemsWithContext(ctx aws.Context, input *dynamodb.TransactGetItemsInput, opts ...request.Option) (*dynamodb.TransactGetItemsOutput, error)

TransactGetItemsWithContext overrides dynamodb.DynamoDB/TransactGetItemsWithContext to log execution metrics.

func (*DynamoDbProxy) TransactWriteItems

TransactWriteItems overrides dynamodb.DynamoDB/TransactWriteItems to log execution metrics.

func (*DynamoDbProxy) TransactWriteItemsWithContext

func (dp *DynamoDbProxy) TransactWriteItemsWithContext(ctx aws.Context, input *dynamodb.TransactWriteItemsInput, opts ...request.Option) (*dynamodb.TransactWriteItemsOutput, error)

TransactWriteItemsWithContext overrides dynamodb.DynamoDB/TransactWriteItemsWithContext to log execution metrics.

func (*DynamoDbProxy) UntagResource

UntagResource overrides dynamodb.DynamoDB/UntagResource to log execution metrics.

func (*DynamoDbProxy) UntagResourceWithContext

func (dp *DynamoDbProxy) UntagResourceWithContext(ctx aws.Context, input *dynamodb.UntagResourceInput, opts ...request.Option) (*dynamodb.UntagResourceOutput, error)

UntagResourceWithContext overrides dynamodb.DynamoDB/UntagResourceWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateContinuousBackups

UpdateContinuousBackups overrides dynamodb.DynamoDB/UpdateContinuousBackups to log execution metrics.

func (*DynamoDbProxy) UpdateContinuousBackupsWithContext

func (dp *DynamoDbProxy) UpdateContinuousBackupsWithContext(ctx aws.Context, input *dynamodb.UpdateContinuousBackupsInput, opts ...request.Option) (*dynamodb.UpdateContinuousBackupsOutput, error)

UpdateContinuousBackupsWithContext overrides dynamodb.DynamoDB/UpdateContinuousBackupsWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateContributorInsights

UpdateContributorInsights overrides dynamodb.DynamoDB/UpdateContributorInsights to log execution metrics.

func (*DynamoDbProxy) UpdateContributorInsightsWithContext

func (dp *DynamoDbProxy) UpdateContributorInsightsWithContext(ctx aws.Context, input *dynamodb.UpdateContributorInsightsInput, opts ...request.Option) (*dynamodb.UpdateContributorInsightsOutput, error)

UpdateContributorInsightsWithContext overrides dynamodb.DynamoDB/UpdateContributorInsightsWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateGlobalTable

UpdateGlobalTable overrides dynamodb.DynamoDB/UpdateGlobalTable to log execution metrics.

func (*DynamoDbProxy) UpdateGlobalTableSettings

UpdateGlobalTableSettings overrides dynamodb.DynamoDB/UpdateGlobalTableSettings to log execution metrics.

func (*DynamoDbProxy) UpdateGlobalTableSettingsWithContext

func (dp *DynamoDbProxy) UpdateGlobalTableSettingsWithContext(ctx aws.Context, input *dynamodb.UpdateGlobalTableSettingsInput, opts ...request.Option) (*dynamodb.UpdateGlobalTableSettingsOutput, error)

UpdateGlobalTableSettingsWithContext overrides dynamodb.DynamoDB/UpdateGlobalTableSettingsWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateGlobalTableWithContext

func (dp *DynamoDbProxy) UpdateGlobalTableWithContext(ctx aws.Context, input *dynamodb.UpdateGlobalTableInput, opts ...request.Option) (*dynamodb.UpdateGlobalTableOutput, error)

UpdateGlobalTableWithContext overrides dynamodb.DynamoDB/UpdateGlobalTableWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateItem

UpdateItem overrides dynamodb.DynamoDB/UpdateItem to log execution metrics.

func (*DynamoDbProxy) UpdateItemWithContext

func (dp *DynamoDbProxy) UpdateItemWithContext(ctx aws.Context, input *dynamodb.UpdateItemInput, opts ...request.Option) (*dynamodb.UpdateItemOutput, error)

UpdateItemWithContext overrides dynamodb.DynamoDB/UpdateItemWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateTable

UpdateTable overrides dynamodb.DynamoDB/UpdateTable to log execution metrics.

func (*DynamoDbProxy) UpdateTableReplicaAutoScaling

UpdateTableReplicaAutoScaling overrides dynamodb.DynamoDB/UpdateTableReplicaAutoScaling to log execution metrics.

func (*DynamoDbProxy) UpdateTableReplicaAutoScalingWithContext

func (dp *DynamoDbProxy) UpdateTableReplicaAutoScalingWithContext(ctx aws.Context, input *dynamodb.UpdateTableReplicaAutoScalingInput, opts ...request.Option) (*dynamodb.UpdateTableReplicaAutoScalingOutput, error)

UpdateTableReplicaAutoScalingWithContext overrides dynamodb.DynamoDB/UpdateTableReplicaAutoScalingWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateTableWithContext

func (dp *DynamoDbProxy) UpdateTableWithContext(ctx aws.Context, input *dynamodb.UpdateTableInput, opts ...request.Option) (*dynamodb.UpdateTableOutput, error)

UpdateTableWithContext overrides dynamodb.DynamoDB/UpdateTableWithContext to log execution metrics.

func (*DynamoDbProxy) UpdateTimeToLive

UpdateTimeToLive overrides dynamodb.DynamoDB/UpdateTimeToLive to log execution metrics.

func (*DynamoDbProxy) UpdateTimeToLiveWithContext

func (dp *DynamoDbProxy) UpdateTimeToLiveWithContext(ctx aws.Context, input *dynamodb.UpdateTimeToLiveInput, opts ...request.Option) (*dynamodb.UpdateTimeToLiveOutput, error)

UpdateTimeToLiveWithContext overrides dynamodb.DynamoDB/UpdateTimeToLiveWithContext to log execution metrics.

Jump to

Keyboard shortcuts

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