Documentation
¶
Index ¶
- Variables
- type Itinerary
- type ItineraryRepository
- type Location
- type LocationRepository
- type PostgresItineraryRepository
- func (repo *PostgresItineraryRepository) Create(itinerary *domain.Itinerary) error
- func (repo *PostgresItineraryRepository) Delete(itinerary *domain.Itinerary) error
- func (repo *PostgresItineraryRepository) List() ([]*domain.Itinerary, error)
- func (repo *PostgresItineraryRepository) Read(id uuid.UUID) (*domain.Itinerary, error)
- type PostgresLocationRepository
- func (repo *PostgresLocationRepository) Create(location *domain.Location) error
- func (repo *PostgresLocationRepository) Delete(location *domain.Location) error
- func (repo *PostgresLocationRepository) List() ([]*domain.Location, error)
- func (repo *PostgresLocationRepository) Read(id uuid.UUID) (*domain.Location, error)
- func (repo *PostgresLocationRepository) Update(location *domain.Location) error
- type PostgresTransferRepository
- func (repo *PostgresTransferRepository) Acquire() (*domain.Transfer, error)
- func (repo *PostgresTransferRepository) Create(transfer *domain.Transfer) error
- func (repo *PostgresTransferRepository) Delete(transfer *domain.Transfer) error
- func (repo *PostgresTransferRepository) List() ([]*domain.Transfer, error)
- func (repo *PostgresTransferRepository) Read(id uuid.UUID) (*domain.Transfer, error)
- func (repo *PostgresTransferRepository) Update(transfer *domain.Transfer) error
- type Repository
- type Transfer
- type TransferRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // based the os package error names: // https://pkg.go.dev/os#pkg-variables ErrExist = errors.New("repository: already exists") ErrNotExist = errors.New("repository: does not exist") // storage errors ErrRetry = errors.New("repository: retry storage operation") ErrConflict = errors.New("repository: conflict in storage operation") )
TODO: add metadata to errors to make em more useful:
- what already exists
- what was missing
- what column(s) caused the conflict
Functions ¶
This section is empty.
Types ¶
type ItineraryRepository ¶
type LocationRepository ¶
type PostgresItineraryRepository ¶
type PostgresItineraryRepository struct {
// contains filtered or unexported fields
}
func NewPostgresItineraryRepository ¶
func NewPostgresItineraryRepository(conn database.Conn) *PostgresItineraryRepository
func (*PostgresItineraryRepository) Create ¶
func (repo *PostgresItineraryRepository) Create(itinerary *domain.Itinerary) error
func (*PostgresItineraryRepository) Delete ¶
func (repo *PostgresItineraryRepository) Delete(itinerary *domain.Itinerary) error
type PostgresLocationRepository ¶
type PostgresLocationRepository struct {
// contains filtered or unexported fields
}
func NewPostgresLocationRepository ¶
func NewPostgresLocationRepository(conn database.Conn, box *secret.Box) *PostgresLocationRepository
func (*PostgresLocationRepository) Create ¶
func (repo *PostgresLocationRepository) Create(location *domain.Location) error
func (*PostgresLocationRepository) Delete ¶
func (repo *PostgresLocationRepository) Delete(location *domain.Location) error
func (*PostgresLocationRepository) List ¶
func (repo *PostgresLocationRepository) List() ([]*domain.Location, error)
type PostgresTransferRepository ¶
type PostgresTransferRepository struct {
// contains filtered or unexported fields
}
func NewPostgresTransferRepository ¶
func NewPostgresTransferRepository(conn database.Conn) *PostgresTransferRepository
func (*PostgresTransferRepository) Acquire ¶
func (repo *PostgresTransferRepository) Acquire() (*domain.Transfer, error)
func (*PostgresTransferRepository) Create ¶
func (repo *PostgresTransferRepository) Create(transfer *domain.Transfer) error
func (*PostgresTransferRepository) Delete ¶
func (repo *PostgresTransferRepository) Delete(transfer *domain.Transfer) error
func (*PostgresTransferRepository) List ¶
func (repo *PostgresTransferRepository) List() ([]*domain.Transfer, error)
type Repository ¶
type Repository struct { Location LocationRepository Itinerary ItineraryRepository Transfer TransferRepository }
func NewPostgres ¶
func NewPostgres(conn database.Conn, box *secret.Box) *Repository
Click to show internal directories.
Click to hide internal directories.