db

package
v0.0.0-demo Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(session *session.Session, dynamodbEndpoint string) *dynamodb.DynamoDB

Connect creates a dynamodb connection

Types

type Database

type Database interface {
	Insert(datautils.Resource) error
	Update(datautils.Resource) error
	Read(id string) (*datautils.Resource, error)
}

Database is a generic connection to a database.

type DynamodbDatabase

type DynamodbDatabase struct {
	Connection *dynamodb.DynamoDB
	Table      string
}

DynamodbDatabase Represents a connection to Dynamo

func (*DynamodbDatabase) Insert

func (database *DynamodbDatabase) Insert(params datautils.Resource) error

Insert create a row in dynamodb

func (DynamodbDatabase) Read

func (database DynamodbDatabase) Read(id string) (*datautils.Resource, error)

func (DynamodbDatabase) Update

func (h DynamodbDatabase) Update(resource datautils.Resource) error

Update - Replaces an existing resource in the repository

Jump to

Keyboard shortcuts

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