dynamodb

package
v0.0.0-...-6f40e4d Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DynamoConnection *dynamodb.DynamoDB
View Source
var DynamoTable string

** Values injected from main internal that imports this library **

View Source
var GenericModel interface{}
View Source
var SearchParam string

Functions

func Connect

func Connect(c *credentials.Credentials, region string) error

Create a connection to DB and assign the session to DynamoConnection variable DynamoConnection variable is shared by other resources(CRUD)

func CreateItem

func CreateItem(av map[string]*dynamodb.AttributeValue) error

Item created using AttributeValue which is decoded by modeldecoding

func DecodeToDynamoAttribute

func DecodeToDynamoAttribute(readBody io.ReadCloser, m interface{}) (map[string]*dynamodb.AttributeValue, error)

* * Convert type interface to dynamodb readable object *

func DecodeToDynamoAttributeAndJson

func DecodeToDynamoAttributeAndJson(readBody io.ReadCloser, m interface{}) (map[string]*dynamodb.AttributeValue, error, string)

* * Convert type interface to dynamodb readable object and JSON *

func DecodeToMap

func DecodeToMap(b io.ReadCloser, m interface{}) (map[string]interface{}, error)

* * Convert the interface fields into a map *

func DeleteItem

func DeleteItem(itemValue string) error

func GetItem

func GetItem(itemValue string) (*dynamodb.GetItemOutput, error)

func GetParameterValue

func GetParameterValue(r io.ReadCloser, m interface{}) (string, error)

* * Get the specific value query by the unique identifier *

func StringFromMap

func StringFromMap(m map[string]interface{}, p string) string

* * Convert a interface type to string *

func Unmarshal

func Unmarshal(result *dynamodb.GetItemOutput, m interface{}) map[string]interface{}

* * Model mapping of type interface to item from dynamodb *

func UpdateItem

func UpdateItem(updatingField string, identifier string, updateVal string) (bool, error)

* TODO: not working as expected yet ***** NOT IN USE, under implementation **** *

Types

type ErrorString

type ErrorString struct {
	Reason string
	Code   int
}

errorString is a trivial implementation of error.

func (*ErrorString) Error

func (e *ErrorString) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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