dynamodb

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: BSD-3-Clause Imports: 15 Imported by: 8

README

go-aws-dynamodb

Go package providing convenience methods for working with aws-sdk-go/service/dynamodb instances.

Documentation

Go Reference

Documentation is incomplete.

Documentation

Overview

Package dynamodb provides convenience methods for working with aws-sdk-go/service/dynamodb instances.

Index

Constants

View Source
const LOCAL_CLIENT_URI string = "aws://?region=localhost&credentials=anon:&local=true"

LOCAL_CLIENT_URI is a suitable URI for passing to the `NewClient` and `NewClientV1` methods for use with a local instance of DynamoDB.

Variables

This section is empty.

Functions

func CreateTables

func CreateTables(ctx context.Context, client *aws_dynamodb.Client, opts *CreateTablesOptions) error

Create one or more tables associated with the dynamodb.DynamoDB instance.

func HasTable

func HasTable(ctx context.Context, client *aws_dynamodb.Client, table_name string) (bool, error)

Return a boolean value indication whether or not the dynamodb.DynamoDB instances contains a table matching table_name.

func ListTables

func ListTables(ctx context.Context, client *aws_dynamodb.Client) ([]string, error)

Return the list of table names associated with the dynamodb.DynamoDB instance.

func NewClient added in v0.2.0

func NewClient(ctx context.Context, uri string) (*aws_dynamodb.Client, error)

func NewClientV1 added in v0.2.0

func NewClientV1(ctx context.Context, uri string) (*aws_dynamodb.DynamoDB, error)

NewClientV1 returns an aws-sdk-go (v1) compatible client which is still necessary for some packages (like gocloud.dev/docstore)

func NewClientWithURI added in v0.0.3

func NewClientWithURI(ctx context.Context, uri string) (*aws_dynamodb.Client, error)

Types

type CreateTablesOptions

type CreateTablesOptions struct {
	// A hash map containing table names and their dynamodb.CreateTableInput defintions
	Tables map[string]*aws_dynamodb.CreateTableInput
	// If true and the table already exists, delete and recreate the table
	Refresh bool
	// An optional string to append to each table name as it is created.
	Prefix string
}

CreateTablesOptions defines options for the CreateTables method

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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