dynamodb

package
v0.0.0-...-62f8b51 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 5 Imported by: 1

README

DynamoDB Storage provider

This is a simple abstraction layer between Amazon's DynamoDB and our local storage interface.

Configuration

To run the tests, create a .env file in the dynamodb directory with the following vars:

AWS_ACCESS=my-access-id
AWS_SECRET=my-access-secret
AWS_REGION=us-east-1
DYNAMO_DB_TABLE=my_test_table
Running Local

Amazon provides a convenient java executable for running a mock DynamoDB server locally. Read all about it here: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html.

Documentation

Overview

DynamoDB storage abstraction layer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDB

type DynamoDB struct {
	Table string
	Conn  *dynamodb.DynamoDB
}

func New

func New(access string, secret string, region string, tableName string) (DynamoDB, error)

New creates an instance of the DynamoDB struct for us.

func (DynamoDB) Delete

func (ddb DynamoDB) Delete(key string)

Delete removes a file by key.

func (DynamoDB) Flush

func (ddb DynamoDB) Flush()

Flush removes the entire db table. This should be called with caution!

func (DynamoDB) Get

func (ddb DynamoDB) Get(key string) []byte

Get attempts to grab data from dynamodb

func (DynamoDB) Put

func (ddb DynamoDB) Put(key string, data []byte) error

Put overwrites or creates as needed a new file based on the key.

Jump to

Keyboard shortcuts

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