Documentation
¶
Index ¶
- func CreateItem(productID string, productName string, quantity int, discount float64, ...) map[string]*dynamodb.AttributeValue
- func CreateItemPutPayload(item map[string]*dynamodb.AttributeValue, tableName string) *dynamodb.PutItemInput
- type DBManager
- func (dbm *DBManager) CreateItemInDB(productItem ProductItem) error
- func (dbm *DBManager) DeleteProductWithID(productID string) error
- func (dbm *DBManager) GetAllItemsInDB() ([]ProductItem, error)
- func (dbm *DBManager) GetProductWithID(productID string) ([]ProductItem, error)
- func (dbm *DBManager) Init(cfg *aws.Config, tableName string)
- type ProductItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateItem ¶
func CreateItemPutPayload ¶
func CreateItemPutPayload(item map[string]*dynamodb.AttributeValue, tableName string) *dynamodb.PutItemInput
Types ¶
type DBManager ¶
type DBManager struct {
AwsSession *session.Session
DynamoServiceClient *dynamodb.DynamoDB
DynamodbTable string
}
func (*DBManager) CreateItemInDB ¶
func (dbm *DBManager) CreateItemInDB(productItem ProductItem) error
func (*DBManager) DeleteProductWithID ¶
func (*DBManager) GetAllItemsInDB ¶
func (dbm *DBManager) GetAllItemsInDB() ([]ProductItem, error)
func (*DBManager) GetProductWithID ¶
func (dbm *DBManager) GetProductWithID(productID string) ([]ProductItem, error)
type ProductItem ¶
type ProductItem struct {
ProductID string `json:"ProductID"`
Name string `json:"Name"`
Quantity int `json:"Quantity"`
Discount float64 `json:"Discount"`
Price float64 `json:"Price"`
}
func CastDbRawItemToProductObject ¶
func CastDbRawItemToProductObject(item map[string]*dynamodb.AttributeValue) ProductItem
func CastDbRawItemsListToProductObjectList ¶
func CastDbRawItemsListToProductObjectList(items []map[string]*dynamodb.AttributeValue) []ProductItem
Click to show internal directories.
Click to hide internal directories.