aws

package
v0.0.0-...-471d7c0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Package aws provides AWS implementation of data interfaces.

AWS Go SDK: https://github.com/aws/aws-sdk-go Go SDK API Ref: https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/ Dev Guide: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html REST API Ref: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Operations.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDB

type DynamoDB struct {
	DB      *dynamodb.DynamoDB
	Tables  []string
	Config  *aws.Config
	Session *session.Session
}

DynamoDB implementation for DB interface.

func NewDynamoDB

func NewDynamoDB(region string, endpoint string) *DynamoDB

NewDynamoDB creates a new AWS DynamoDB instance. region = Optional region setting. Will overwrite AWS_REGION env var if available. endpoint = Optional endpoint URL setting. Useful for specifying local/development service URL.

func (*DynamoDB) GetByEmail

func (db *DynamoDB) GetByEmail(email string) (u *models.User, ok bool)

GetByEmail retrieves a user by e-mail with OK indicator.

func (*DynamoDB) GetByID

func (db *DynamoDB) GetByID(id string) (u *models.User, ok bool)

GetByID retrieves a user by ID with OK indicator.

func (*DynamoDB) SaveUser

func (db *DynamoDB) SaveUser(u *models.User) error

SaveUser creates or updates a user. Upon creation, users are assigned a unique ID.

func (*DynamoDB) Seed

func (db *DynamoDB) Seed(overwrite bool, jwtPass string) error

Seed creates and populates the database, overwriting existing data if specified.

Jump to

Keyboard shortcuts

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