database

package
v0.0.0-...-1908aab Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteItem

func DeleteItem(svc dynamodbiface.DynamoDBAPI, tableName string, personalWebsiteType string, sortValue string) (err error)

func GetItem

func GetItem(svc dynamodbiface.DynamoDBAPI, tableName string, personalWebsiteType string, sortValue string, itemPtr interface{}) (err error)

GetItem retrieves an item from DynamoDB based on the provided personalWebsiteType and sortValue. It takes an initialized DynamoDB client (svc), the personalWebsiteType and sortValue to uniquely identify the item, and a pointer to the struct (itemPtr) where the retrieved item will be unmarshalled.

Example usage:

var item models.Item
err := GetItem(svc, "type", "sortValue", &item)
if err != nil {
    log.Printf("error retrieving item: %v", err)
}

func GetProjects

func GetProjects(svc dynamodbiface.DynamoDBAPI, tableName string) (projects []models.Project, err error)

func GetSkillsTools

func GetSkillsTools(svc dynamodbiface.DynamoDBAPI, tableName string) (skillsTools []models.SkillsTools, err error)

func GetWork

func GetWork(svc dynamodbiface.DynamoDBAPI, tableName string) (work []models.Work, err error)

func PostProject

func PostProject(svc dynamodbiface.DynamoDBAPI, tableName string, newProject models.Project) (project models.Project, err error)

func PostSkillsTools

func PostSkillsTools(svc dynamodbiface.DynamoDBAPI, tableName string, newSkillsTools models.SkillsTools) (skillsTools models.SkillsTools, err error)

func PostWork

func PostWork(svc dynamodbiface.DynamoDBAPI, tableName string, newWork models.Work) (work models.Work, err error)

func UpdateProject

func UpdateProject(svc dynamodbiface.DynamoDBAPI, tableName string, newProject models.Project) (project models.Project, err error)

func UpdateSkillsTools

func UpdateSkillsTools(svc dynamodbiface.DynamoDBAPI, tableName string, newSkillsTools models.SkillsTools) (skillsTools models.SkillsTools, err error)

func UpdateWork

func UpdateWork(svc dynamodbiface.DynamoDBAPI, tableName string, updateWork models.Work) (work models.Work, err error)

Types

type Database

type Database struct {
	*dynamodb.DynamoDB
}

func NewDatabase

func NewDatabase(awsSession *session.Session) (database *Database)

Jump to

Keyboard shortcuts

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