dynamodb

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAutomaticTextMessageDDBRepository

func NewAutomaticTextMessageDDBRepository(client *dynamodb.Client) repository.AutomaticTextMessageRepository

NewAutomaticTextMessageDDBRepository creates a new instance of AutomaticTextMessageDDBRepository using a DynamoDB client.

func NewCheckinDDBRepository

func NewCheckinDDBRepository(client *dynamodb.Client) repository.CheckinRepository

NewCheckinDDBRepository initializes a CheckinRepository using a DynamoDB client and sets the target table to "checkins".

func NewCompanyDDBRepository

func NewCompanyDDBRepository(client *dynamodb.Client) repository.CompanyRepository

NewCompanyDDBRepository creates a new instance of a CompanyRepository using a DynamoDB client and a predefined table name.

func NewLanguageDDBRepository

func NewLanguageDDBRepository(client *dynamodb.Client) repository.LanguageRepository

NewLanguageDDBRepository creates a new instance of LanguageDDBRepository with the given DynamoDB client and table name.

func NewLocationDDBRepository

func NewLocationDDBRepository(client *dynamodb.Client) repository.LocationRepository

NewLocationDDBRepository initializes a new LocationDDBRepository using a provided DynamoDB client. It configures the repository to operate on the "locations" table. Returns an implementation of the repository.LocationRepository interface.

func NewRegionDDBRepository

func NewRegionDDBRepository(client *dynamodb.Client) repository.RegionRepository

NewRegionDDBRepository creates a new RegionDDBRepository using the provided DynamoDB client. It initializes the repository with a "regions" table name for DynamoDB operations. Returns an implementation of the RegionRepository interface.

func NewTestCheckinDDBRepository

func NewTestCheckinDDBRepository(client *dynamodb.Client) repository.CheckinRepository

func NewTestCompanyDDBRepository

func NewTestCompanyDDBRepository(client *dynamodb.Client) repository.CompanyRepository

func NewTestLanguageDDBRepository

func NewTestLanguageDDBRepository(client *dynamodb.Client) repository.LanguageRepository

func NewTestLocationDDBRepository

func NewTestLocationDDBRepository(client *dynamodb.Client) repository.LocationRepository

func NewTestTextMessageDDBRepository

func NewTestTextMessageDDBRepository(client *dynamodb.Client) repository.TextMessageRepository

func NewTestTraineeDDBRepository

func NewTestTraineeDDBRepository(client *toolkit.MockDynamoDBClient) repository.TraineeRepository

func NewTestTrainingDDBRepository

func NewTestTrainingDDBRepository(client *dynamodb.Client) repository.TrainingRepository

func NewTextMessageDDBRepository

func NewTextMessageDDBRepository(client *dynamodb.Client) repository.TextMessageRepository

NewTextMessageDDBRepository initializes a new TextMessageRepository with a given DynamoDB client.

func NewTraineeDDBRepository

func NewTraineeDDBRepository(client *dynamodb.Client, tableName string) repository.TraineeRepository

NewTraineeDDBRepository creates a new instance of a TraineeRepository using a DynamoDB client and a predefined table name.

func NewTrainingDDBRepository

func NewTrainingDDBRepository(client *dynamodb.Client) repository.TrainingRepository

NewTrainingDDBRepository initializes a DynamoDB-backed TrainingRepository with the specified DynamoDB client.

Types

type AutomaticTextMessageDDBRepository

type AutomaticTextMessageDDBRepository struct {
	// contains filtered or unexported fields
}

AutomaticTextMessageDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on AutomaticTextMessage records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*AutomaticTextMessageDDBRepository) Delete

Delete removes an AutomaticTextMessage record identified by the given id from the DynamoDB table and returns an error if unsuccessful.

func (*AutomaticTextMessageDDBRepository) FindAll

FindAll retrieves all AutomaticTextMessage records from the DynamoDB table and returns them as a slice.

func (*AutomaticTextMessageDDBRepository) FindAllByLocationID

FindAllByLocationID retrieves all AutomaticTextMessage records associated with a specific location ID from the DynamoDB table.

func (*AutomaticTextMessageDDBRepository) FindByID

FindByID retrieves an AutomaticTextMessage record by its unique identifier from the DynamoDB table and returns it.

func (*AutomaticTextMessageDDBRepository) Save

func (r *AutomaticTextMessageDDBRepository) Save(automaticTextMessage *models.AutomaticTextMessage) error

Save stores a new AutomaticTextMessage record in the DynamoDB table and returns an error if the operation fails.

func (*AutomaticTextMessageDDBRepository) Update

func (r *AutomaticTextMessageDDBRepository) Update(automaticTextMessage *models.AutomaticTextMessage) error

Update updates an existing AutomaticTextMessage record in the DynamoDB table and returns an error if the operation fails.

type CheckinDDBRepository

type CheckinDDBRepository struct {
	// contains filtered or unexported fields
}

CheckinDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on Checkin records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*CheckinDDBRepository) Delete

func (r *CheckinDDBRepository) Delete(id string) error

Delete removes a Checkin record from the DynamoDB table identified by the given ID. Returns an error if the operation fails.

func (*CheckinDDBRepository) FindAll

func (r *CheckinDDBRepository) FindAll() ([]*models.Checkin, error)

FindAll retrieves all Checkin records from the DynamoDB table. Returns a slice of Checkin pointers or an error.

func (*CheckinDDBRepository) FindAllByCompanyID

func (r *CheckinDDBRepository) FindAllByCompanyID(id string) ([]*models.Checkin, error)

FindAllByCompanyID retrieves all Checkin records associated with the given company ID from the DynamoDB table.

func (*CheckinDDBRepository) FindAllByLocationID

func (r *CheckinDDBRepository) FindAllByLocationID(id string) ([]*models.Checkin, error)

FindAllByLocationID retrieves all Checkin records associated with the given location ID from the DynamoDB table.

func (*CheckinDDBRepository) FindAllByRegionID

func (r *CheckinDDBRepository) FindAllByRegionID(id string) ([]*models.Checkin, error)

FindAllByRegionID retrieves all Checkin records associated with the given region ID from the DynamoDB table.

func (*CheckinDDBRepository) FindAllByTraineeID

func (r *CheckinDDBRepository) FindAllByTraineeID(id string) ([]*models.Checkin, error)

FindAllByTraineeID retrieves all Checkin records from the database associated with the given trainee ID.

func (*CheckinDDBRepository) FindByID

func (r *CheckinDDBRepository) FindByID(id string) (*models.Checkin, error)

FindByID retrieves a Checkin record from the DynamoDB table using the given ID. Returns the record or an error.

func (*CheckinDDBRepository) Save

func (r *CheckinDDBRepository) Save(checkin *models.Checkin) error

Save saves the provided Checkin record into the DynamoDB table. Returns an error if the operation fails.

func (*CheckinDDBRepository) Update

func (r *CheckinDDBRepository) Update(checkin *models.Checkin) error

Update updates an existing Checkin record in the DynamoDB table. Returns an error if the update operation fails.

type CompanyDDBRepository

type CompanyDDBRepository struct {
	// contains filtered or unexported fields
}

CompanyDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on company records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*CompanyDDBRepository) Delete

func (r *CompanyDDBRepository) Delete(id string) error

Delete removes a company record from the DynamoDB table based on the provided unique identifier and returns an error if it fails.

func (*CompanyDDBRepository) FindAll

func (r *CompanyDDBRepository) FindAll() ([]*models.Company, error)

FindAll retrieves all company records from the DynamoDB table and returns them as a slice of Company pointers.

func (*CompanyDDBRepository) FindByID

func (r *CompanyDDBRepository) FindByID(id string) (*models.Company, error)

FindByID retrieves a company record from the DynamoDB table by its unique identifier and returns the result.

func (*CompanyDDBRepository) Save

func (r *CompanyDDBRepository) Save(company *models.Company) error

Save stores or inserts the given company record into the DynamoDB table. Returns an error if the operation fails.

func (*CompanyDDBRepository) Update

func (r *CompanyDDBRepository) Update(company *models.Company) error

Update modifies an existing company record in the DynamoDB table and returns an error if the operation fails.

type LanguageDDBRepository

type LanguageDDBRepository struct {
	// contains filtered or unexported fields
}

LanguageDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on Language records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*LanguageDDBRepository) Delete

func (r *LanguageDDBRepository) Delete(id string) error

Delete removes a Language record from the DynamoDB table by its unique identifier. Returns an error if the operation fails.

func (*LanguageDDBRepository) FindAll

func (r *LanguageDDBRepository) FindAll() ([]*models.Language, error)

FindAll retrieves all Language records from the DynamoDB table. Returns a slice of Language pointers or an error.

func (*LanguageDDBRepository) FindByID

func (r *LanguageDDBRepository) FindByID(id string) (*models.Language, error)

FindByID retrieves a Language record by its unique identifier from the DynamoDB table. Returns the record or an error if not found.

func (*LanguageDDBRepository) Save

func (r *LanguageDDBRepository) Save(language *models.Language) error

Save persists a Language record to the DynamoDB table. Returns an error if the operation fails.

func (*LanguageDDBRepository) Update

func (r *LanguageDDBRepository) Update(language *models.Language) error

Update updates an existing Language record in the DynamoDB table. Returns an error if the operation fails.

type LocationDDBRepository

type LocationDDBRepository struct {
	// contains filtered or unexported fields
}

LocationDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on Location records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*LocationDDBRepository) Delete

func (r *LocationDDBRepository) Delete(id string) error

Delete removes a Location record from the DynamoDB table using the specified ID. Returns an error if the operation fails.

func (*LocationDDBRepository) FindAll

func (r *LocationDDBRepository) FindAll() ([]*models.Location, error)

FindAll retrieves all Location records from the DynamoDB table. Returns a slice of Location pointers or an error.

func (*LocationDDBRepository) FindAllByCompanyID

func (r *LocationDDBRepository) FindAllByCompanyID(id string) ([]*models.Location, error)

FindAllByCompanyID retrieves all Location records associated with the specified Company ID. Returns a slice of Location pointers or an error.

func (*LocationDDBRepository) FindAllByRegionID

func (r *LocationDDBRepository) FindAllByRegionID(id string) ([]*models.Location, error)

FindAllByRegionID retrieves all Location records associated with the specified Region ID. Returns a slice of Location pointers or an error.

func (*LocationDDBRepository) FindByID

func (r *LocationDDBRepository) FindByID(id string) (*models.Location, error)

FindByID retrieves a Location record from the DynamoDB table using the specified ID. Returns the Location or an error.

func (*LocationDDBRepository) Save

func (r *LocationDDBRepository) Save(location *models.Location) error

Save stores or creates a new Location record in the DynamoDB table. Returns an error if the operation fails.

func (*LocationDDBRepository) Update

func (r *LocationDDBRepository) Update(location *models.Location) error

Update modifies an existing Location record in the DynamoDB table. Returns an error if the operation fails.

type RegionDDBRepository

type RegionDDBRepository struct {
	// contains filtered or unexported fields
}

RegionDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on Region records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*RegionDDBRepository) Delete

func (r *RegionDDBRepository) Delete(id string) error

Delete removes a Region record identified by the provided ID from the DynamoDB table and returns an error if it fails.

func (*RegionDDBRepository) FindAll

func (r *RegionDDBRepository) FindAll() ([]*models.Region, error)

FindAll retrieves all Region records from the DynamoDB table and returns them as a slice or an error if the operation fails.

func (*RegionDDBRepository) FindAllByCompanyID

func (r *RegionDDBRepository) FindAllByCompanyID(id string) ([]*models.Region, error)

FindAllByCompanyID retrieves all Region records associated with a specific company ID from the DynamoDB table. It returns a slice of Region pointers or an error if the operation fails.

func (*RegionDDBRepository) FindByID

func (r *RegionDDBRepository) FindByID(id string) (*models.Region, error)

FindByID retrieves a Region record from the DynamoDB table using the specified ID. It returns the Region if found or an error if the operation fails.

func (*RegionDDBRepository) Save

func (r *RegionDDBRepository) Save(region *models.Region) error

Save stores or inserts a Region record into the DynamoDB table. It returns an error if the operation fails.

func (*RegionDDBRepository) Update

func (r *RegionDDBRepository) Update(region *models.Region) error

Update modifies an existing Region record in the DynamoDB table and returns an error if the operation fails.

type TextMessageDDBRepository

type TextMessageDDBRepository struct {
	// contains filtered or unexported fields
}

TextMessageDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on TextMessage records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*TextMessageDDBRepository) Delete

func (r *TextMessageDDBRepository) Delete(id string) error

Delete removes a TextMessage record from the DynamoDB table by its unique identifier and returns an error if it fails.

func (*TextMessageDDBRepository) FindAll

func (r *TextMessageDDBRepository) FindAll() ([]*models.TextMessage, error)

FindAll retrieves all TextMessage records from the DynamoDB table and returns them as a slice.

func (*TextMessageDDBRepository) FindAllByLocationID

func (r *TextMessageDDBRepository) FindAllByLocationID(id string) ([]*models.TextMessage, error)

FindAllByLocationID retrieves all TextMessage records associated with the specified LocationID from the DynamoDB table.

func (*TextMessageDDBRepository) FindByID

FindByID retrieves a TextMessage record from the DynamoDB table using the provided unique identifier.

func (*TextMessageDDBRepository) Save

func (r *TextMessageDDBRepository) Save(textMessage *models.TextMessage) error

Save stores the given TextMessage in the DynamoDB table and returns an error if the operation fails.

func (*TextMessageDDBRepository) Update

func (r *TextMessageDDBRepository) Update(textMessage *models.TextMessage) error

Update modifies an existing TextMessage record in the DynamoDB table and returns an error if the operation fails.

type TraineeDDBRepository

type TraineeDDBRepository struct {
	// contains filtered or unexported fields
}

TraineeDDBRepository is a repository implementation for managing trainee data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on trainee records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*TraineeDDBRepository) Checkin

func (r *TraineeDDBRepository) Checkin(id string) error

Checkin updates a trainee's record to mark them as checked in.

func (*TraineeDDBRepository) Checkout

func (r *TraineeDDBRepository) Checkout(id string) error

Checkout updates a trainee's record to mark them as checked out.

func (*TraineeDDBRepository) CompleteTraining

func (r *TraineeDDBRepository) CompleteTraining(id string) error

CompleteTraining updates a trainee's record to mark training as complete.

func (*TraineeDDBRepository) Delete

func (r *TraineeDDBRepository) Delete(id string) error

Delete removes a trainee record from the DynamoDB table based on the provided ID and returns an error if the operation fails.

func (*TraineeDDBRepository) DeleteByEmail

func (r *TraineeDDBRepository) DeleteByEmail(email string) error

DeleteByEmail removes a trainee record from the DynamoDB table based on the provided email and returns an error if the operation fails.

func (*TraineeDDBRepository) FindAll

func (r *TraineeDDBRepository) FindAll() ([]*models.Trainee, error)

FindAll retrieves all trainee records from the DynamoDB table and returns a slice of Trainee objects or an error.

func (*TraineeDDBRepository) FindAllByCompanyID

func (r *TraineeDDBRepository) FindAllByCompanyID(id string) ([]*models.Trainee, error)

FindAllByCompanyID retrieves all trainee records associated with the given company ID from DynamoDB. Returns a slice of Trainee objects or an error.

func (*TraineeDDBRepository) FindAllByLocationID

func (r *TraineeDDBRepository) FindAllByLocationID(id string) ([]*models.Trainee, error)

FindAllByLocationID retrieves all trainee records associated with the specified location ID from DynamoDB. Returns a slice of Trainee objects or an error if the operation fails.

func (*TraineeDDBRepository) FindAllByRegionID

func (r *TraineeDDBRepository) FindAllByRegionID(id string) ([]*models.Trainee, error)

FindAllByRegionID retrieves all trainee records associated with the specified region ID from DynamoDB. Returns a slice of Trainee objects or an error if the operation fails.

func (*TraineeDDBRepository) FindByEmail

func (r *TraineeDDBRepository) FindByEmail(email string) (*models.Trainee, error)

FindByEmail retrieves a trainee record from DynamoDB based on the provided email and returns a Trainee object or an error.

func (*TraineeDDBRepository) FindByEmailAndLocation

func (r *TraineeDDBRepository) FindByEmailAndLocation(email string, locationID string) (*models.Trainee, error)

FindByEmailAndLocation retrieves a trainee record from DynamoDB based on the provided email and location ID. Returns a Trainee object or an error if no matching record is found.

func (*TraineeDDBRepository) FindByID

func (r *TraineeDDBRepository) FindByID(id string) (*models.Trainee, error)

FindByID retrieves a trainee record from DynamoDB based on the provided ID and returns a Trainee object or an error.

func (*TraineeDDBRepository) FindByNames

func (r *TraineeDDBRepository) FindByNames(firstName string, lastName string) (*models.Trainee, error)

FindByNames retrieves a trainee record from DynamoDB based on the provided first and last names. Returns a Trainee object or error.

func (*TraineeDDBRepository) FindByNamesAndLocation

func (r *TraineeDDBRepository) FindByNamesAndLocation(firstName string, lastName string, locationID string) (*models.Trainee, error)

FindByNamesAndLocation retrieves a trainee record from DynamoDB using first name, last name, and location ID. Returns a Trainee object or an error.

func (*TraineeDDBRepository) FindByPhone

func (r *TraineeDDBRepository) FindByPhone(phone string) (*models.Trainee, error)

FindByPhone retrieves a trainee record from DynamoDB based on the provided phone number and returns a Trainee object or an error.

func (*TraineeDDBRepository) FindByPhoneAndLocation

func (r *TraineeDDBRepository) FindByPhoneAndLocation(phone string, locationID string) (*models.Trainee, error)

FindByPhoneAndLocation retrieves a trainee record from DynamoDB based on the provided phone and location ID. Returns a Trainee object or error.

func (*TraineeDDBRepository) Save

func (r *TraineeDDBRepository) Save(trainee *models.Trainee) error

Save persists a trainee record to the DynamoDB table. Returns an error if the operation fails. Save persists a trainee record to the DynamoDB table. Returns an error if the operation fails.

func (*TraineeDDBRepository) Update

func (r *TraineeDDBRepository) Update(trainee *models.Trainee) error

Update updates an existing trainee record in the DynamoDB table and returns an error if the operation fails.

type TrainingDDBRepository

type TrainingDDBRepository struct {
	// contains filtered or unexported fields
}

TrainingDDBRepository is a repository implementation for managing company data in DynamoDB. It utilizes a DynamoDB client and a specific table to perform CRUD operations on Training records. The struct includes client for interaction with DynamoDB and tableName for specifying the target table.

func (*TrainingDDBRepository) Delete

func (r *TrainingDDBRepository) Delete(id string) error

Delete removes a training record from the DynamoDB table using the specified unique ID.

func (*TrainingDDBRepository) FindAll

func (r *TrainingDDBRepository) FindAll() ([]*models.Training, error)

FindAll retrieves all training records from the DynamoDB table and returns them as a slice of Training.

func (*TrainingDDBRepository) FindAllByCompanyID

func (r *TrainingDDBRepository) FindAllByCompanyID(id string) ([]*models.Training, error)

FindAllByCompanyID retrieves all training records associated with the specified company ID from the DynamoDB table.

func (*TrainingDDBRepository) FindAllByLocationID

func (r *TrainingDDBRepository) FindAllByLocationID(id string) ([]*models.Training, error)

FindAllByLocationID retrieves all training records associated with the specified location ID from the DynamoDB table.

func (*TrainingDDBRepository) FindAllByRegionID

func (r *TrainingDDBRepository) FindAllByRegionID(id string) ([]*models.Training, error)

FindAllByRegionID retrieves all training records associated with the specified region ID from the DynamoDB table.

func (*TrainingDDBRepository) FindAllByTraineeID

func (r *TrainingDDBRepository) FindAllByTraineeID(id string) ([]*models.Training, error)

FindAllByTraineeID retrieves all training records associated with the specified trainee ID from the DynamoDB table.

func (*TrainingDDBRepository) FindByID

func (r *TrainingDDBRepository) FindByID(id string) (*models.Training, error)

FindByID retrieves a training record from the DynamoDB table based on the provided unique ID.

func (*TrainingDDBRepository) Save

func (r *TrainingDDBRepository) Save(training *models.Training) error

Save inserts a new training record into the DynamoDB table or overwrites an existing one with the same ID.

func (*TrainingDDBRepository) Update

func (r *TrainingDDBRepository) Update(training *models.Training) error

Update modifies an existing training record in the DynamoDB table with the provided training data.

Jump to

Keyboard shortcuts

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