table

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: AGPL-3.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package table manages all of the Dynamo calls (query, scan, get, write, etc).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Get() (*models.Organization, error)
	Put(*models.Organization) error
	Update(*models.Organization) (*models.Organization, error)
	AddActions(actions []*models.Action) (*models.Organization, error)
}

API defines the interface for the table which can be used for mocking.

type DynamoItem

type DynamoItem = map[string]*dynamodb.AttributeValue

DynamoItem is a type alias for the item format expected by the Dynamo SDK.

type OrganizationsTable

type OrganizationsTable struct {
	Name *string
	// contains filtered or unexported fields
}

OrganizationsTable encapsulates a connection to the Dynamo table.

func New

func New(tableName string, sess *session.Session) *OrganizationsTable

New creates a new Dynamo client which talks to the given table name.

func (*OrganizationsTable) AddActions

func (table *OrganizationsTable) AddActions(actions []*models.Action) (*models.Organization, error)

AddActions append additional actions to completed actions and returns the updated organization

func (*OrganizationsTable) Get

func (table *OrganizationsTable) Get() (*models.Organization, error)

Get retrieves account details from the table.

func (*OrganizationsTable) Put

func (table *OrganizationsTable) Put(org *models.Organization) error

Put writes organization details to the dynamo table.

func (*OrganizationsTable) Update

Update updates account details and returns the updated item

Jump to

Keyboard shortcuts

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