dynamodb

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0

SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const DynamoDB = "dynamo"

DynamoDB is the path to the configuration structure needed to connect to a dynamo DB instance.

Variables

This section is empty.

Functions

func NewDynamoDB added in v0.5.0

func NewDynamoDB(config Config, measures metric.Measures) (store.S, error)

Types

type Config

type Config struct {
	// Table is the name of the target DB table.
	// (Optional) Defaults to 'gifnoc'
	Table string

	// Endpoint is the HTTP(S) URL to the DB.
	// (Optional) Defaults to endpoint generated by the aws sdk.
	Endpoint string

	// Region is the AWS region of the running DB.
	Region string `validate:"required"`

	// MaxRetries is the number of times DB operations will be retried on error.
	// (Optional) Defaults to 3.
	MaxRetries int

	// GetAllLimit is the maximum number of items to get at a time.
	// (Optional) defaults to no limit
	GetAllLimit int32

	// AccessKey is the AWS AccessKey credential.
	AccessKey *string

	// SecretKey is the AWS SecretKey credential.
	SecretKey *string

	// DisableDualStack indicates whether the connection to the DB should be
	// dual stack (IPv4 and IPv6).
	// (Optional) Defaults to False.
	DisableDualStack bool

	// If roleBasedAccess is enabled, accessKey and secretKey will be fetched using IAM temporary credentials
	RoleBasedAccess bool

	// Mechanically identical to RoleBasedAccess, but with descriptive name
	UseDefaultCredentialChain bool
}

Config contains all fields needed to establish a connection with a dynamoDB instance.

type DynamoDBAPI added in v0.11.0

type DynamoDBAPI interface {
	PutItem(ctx context.Context, params *awsv2dynamodb.PutItemInput, optFns ...func(*awsv2dynamodb.Options)) (*awsv2dynamodb.PutItemOutput, error)
	GetItem(ctx context.Context, params *awsv2dynamodb.GetItemInput, optFns ...func(*awsv2dynamodb.Options)) (*awsv2dynamodb.GetItemOutput, error)
	DeleteItem(ctx context.Context, params *awsv2dynamodb.DeleteItemInput, optFns ...func(*awsv2dynamodb.Options)) (*awsv2dynamodb.DeleteItemOutput, error)
	Query(ctx context.Context, params *awsv2dynamodb.QueryInput, optFns ...func(*awsv2dynamodb.Options)) (*awsv2dynamodb.QueryOutput, error)
}

DynamoDBAPI defines the subset of the DynamoDB client used by executor, for mocking/testing.

Jump to

Keyboard shortcuts

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