db

package
v0.0.0-...-5a544cf Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package db is a DB helper interface for AWS DynamoDB

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDBHelper

type DynamoDBHelper struct {
	Region string
	// contains filtered or unexported fields
}

DynamoDBHelper is a DB helper structure

func GetInstance

func GetInstance(region string) *DynamoDBHelper

GetInstance returns an instance of DbHelper region is blank or aws-region such as ap-northeast-2 In case of blank, use AWS_DEFAULT_REGION as region

func New

func New(region string) *DynamoDBHelper

New makes an instance for DbHelper

func (*DynamoDBHelper) GetItem

func (d *DynamoDBHelper) GetItem(tblName, propName, propVal, targetName string) *dynamodb.ScanOutput

GetItem returns queried result following inputs For table named "tblName" in DynamoDB, Scan target value following propName is propVal

-----------------------------
|  propName  |  targetName  |
-----------------------------
|  propVal   |  targetVal   |
|   ...      |    ...       |
-----------------------------

func (*DynamoDBHelper) ListTables

func (d *DynamoDBHelper) ListTables()

ListTables lists table names

func (*DynamoDBHelper) UnmarshalMap

func (d *DynamoDBHelper) UnmarshalMap(in map[string]*dynamodb.AttributeValue, out interface{})

UnmarshalMap makes output data from DynamoDB output

Jump to

Keyboard shortcuts

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