db

package
v0.0.0-...-4648e5f Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Save(table string, item map[string]types.AttributeValue) error

	// TODO: Combine all the GET into 1 function
	Get(table string, key map[string]types.AttributeValue, output interface{}) error
	GetItemById(table string, id string, output interface{}) error
	GetItem(table string, key map[string]types.AttributeValue) (map[string]types.AttributeValue, error)
	QueryOne(queryInput *dynamodb.QueryInput, output interface{}) error
	QueryAll(queryInput *dynamodb.QueryInput, output interface{}) error
	Scan(queryParams *dynamodb.ScanInput, output interface{}) error
	Delete(table string, id string) error
}

func Init

func Init() DB

type DBClient

type DBClient struct {
	Svc *dynamodb.Client
}

func (*DBClient) Delete

func (dbClient *DBClient) Delete(table string, id string) error

func (*DBClient) Get

func (dbClient *DBClient) Get(table string, key map[string]types.AttributeValue, output interface{}) error

func (*DBClient) GetItem

func (dbClient *DBClient) GetItem(table string, key map[string]types.AttributeValue) (map[string]types.AttributeValue, error)

func (*DBClient) GetItemById

func (dbClient *DBClient) GetItemById(table string, id string, output interface{}) error

func (*DBClient) QueryAll

func (dbClient *DBClient) QueryAll(queryInput *dynamodb.QueryInput, output interface{}) error

func (*DBClient) QueryOne

func (dbClient *DBClient) QueryOne(queryInput *dynamodb.QueryInput, output interface{}) error

func (*DBClient) Save

func (dbClient *DBClient) Save(table string, item map[string]types.AttributeValue) error

func (*DBClient) Scan

func (dbClient *DBClient) Scan(queryParams *dynamodb.ScanInput, output interface{}) error

Jump to

Keyboard shortcuts

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