dynamo

package
v0.0.0-...-e805d58 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package dynamo wraps the AWS DynamoDB SDK

To insert a row:

svc, _ := dynamo.New(conf)
row := &types.Row{...}
count, err := dynamo.Insert(svc, row)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(svc *dynamodb.DynamoDB, schema *types.Schema) error

CreateTable creates a dynamoDB table

func DeleteTable

func DeleteTable(svc *dynamodb.DynamoDB, schema *types.Schema) error

DeleteTable deletes the DynamoDB table

func Insert

func Insert(svc *dynamodb.DynamoDB, row *types.Row) (*int64, error)

Insert takes in a row, and increments the atomic key value by row.Incr using the query:

SET [ATOMIC KEY] = IF_NOT_EXISTS(VALUE, 0) + VALUE

This will row lock and can create hotspots if used on the same key too often, for high volume writes on a single key use the dynatomic async wrapper for an eventually consistent result

func New

func New(config *aws.Config) (*dynamodb.DynamoDB, error)

New creates a dynamodb client on first call, and returns the existing client on subsequent calls.

Types

This section is empty.

Jump to

Keyboard shortcuts

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