db

package
v0.0.0-...-dc52cdd Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: MIT-0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceSlice

func InterfaceSlice(slice interface{}) []interface{}

TODO: to evaluate th value of this tradeoff: this is probably a little slow but abstract the complexity for all uses of the save many function(and actually any core operation on array of interface)

Types

type DBConfig

type DBConfig struct {
	DbService  *dynamodb.DynamoDB
	PrimaryKey string
	SortKey    string
	TableName  string
}

func Init

func Init(tn string, pk string, sk string) DBConfig

init setup teh session and define table name, primary key and sort key

func (DBConfig) Delete

func (dbc DBConfig) Delete(prop interface{}) (interface{}, error)

func (DBConfig) DeleteMany

func (dbc DBConfig) DeleteMany(data interface{}) error

Deletes many items to a single table

func (DBConfig) FindByGsi

func (dbc DBConfig) FindByGsi(value string, indexName string, indexPk string, data interface{}) error

func (DBConfig) FindStartingWith

func (dbc DBConfig) FindStartingWith(pk string, value string, data interface{}) error

func (DBConfig) Get

func (dbc DBConfig) Get(pk string, sk string, data interface{}) error

func (DBConfig) Save

func (dbc DBConfig) Save(prop interface{}) (interface{}, error)

func (DBConfig) SaveMany

func (dbc DBConfig) SaveMany(data interface{}) error

Writtes many items to a single table

Jump to

Keyboard shortcuts

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