dynamodb

package
v0.0.0-...-24fb135 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package dynamodb has a storage provider that uses an AWS DynamoDB table.

The DynamoDB table is expected to have the following structure:

Hash Key: name="id" type="S"
Sort Key: none
Time to Live Attribute: name="expires_at"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides storage for sessions using an AWS DynamoDB table. It implements the storage.Provider interface.

The structure of the DynamoDB table is described in the package comment.

func New

func New(dynamodb *dynamodb.DynamoDB, tableName string) *Provider

New creates a new DynamoDB Provider given the AWS handle and the table name.

func (*Provider) CreateTable

func (db *Provider) CreateTable(readCapacityUnits, writeCapacityUnits int64) error

CreateTable creates the dynamodb table.

func (*Provider) Delete

func (db *Provider) Delete(ctx context.Context, id string) error

Delete implements the storage.Provider interface.

func (*Provider) DropTable

func (db *Provider) DropTable() error

DropTable deletes the DynamoDB table.

func (*Provider) Fetch

func (db *Provider) Fetch(ctx context.Context, id string) (*storage.Record, error)

Fetch implements the storage.Provider interface.

func (*Provider) Save

func (db *Provider) Save(ctx context.Context, rec *storage.Record, oldVersion int64) error

Jump to

Keyboard shortcuts

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