Documentation ¶
Index ¶
- type GenerateID
- type PostgresBeerRepository
- func (repo *PostgresBeerRepository) Close() error
- func (repo *PostgresBeerRepository) CreateBeer(ctx context.Context, params *domain.CreateBeerParams) (*domain.Beer, error)
- func (repo *PostgresBeerRepository) DeleteBeer(ctx context.Context, params *domain.DeleteBeerParams) error
- func (repo *PostgresBeerRepository) GetBeer(ctx context.Context, params *domain.GetBeerParams) (*domain.Beer, error)
- func (repo *PostgresBeerRepository) ListBeers(ctx context.Context, params *domain.ListBeersParams) ([]*domain.Beer, error)
- func (repo *PostgresBeerRepository) UpdateBeer(ctx context.Context, params *domain.UpdateBeerParams) (*domain.Beer, error)
- type PostgresSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresBeerRepository ¶
type PostgresBeerRepository struct {
// contains filtered or unexported fields
}
PostgresBeerRepository is a postgres beer repository.
func NewPostgresBeerRepository ¶
func NewPostgresBeerRepository(settings *PostgresSettings, generateID GenerateID) (*PostgresBeerRepository, error)
NewPostgresBeerRepository creates a new postgres beer repository.
func (*PostgresBeerRepository) Close ¶
func (repo *PostgresBeerRepository) Close() error
Close closes the postgres database.
func (*PostgresBeerRepository) CreateBeer ¶
func (repo *PostgresBeerRepository) CreateBeer(ctx context.Context, params *domain.CreateBeerParams) (*domain.Beer, error)
CreateBeer creates a beer in the postgres database.
func (*PostgresBeerRepository) DeleteBeer ¶
func (repo *PostgresBeerRepository) DeleteBeer(ctx context.Context, params *domain.DeleteBeerParams) error
DeleteBeer deletes a beer from the postgres database.
func (*PostgresBeerRepository) GetBeer ¶
func (repo *PostgresBeerRepository) GetBeer(ctx context.Context, params *domain.GetBeerParams) (*domain.Beer, error)
GetBeer gets a beer from the postgres database.
func (*PostgresBeerRepository) ListBeers ¶
func (repo *PostgresBeerRepository) ListBeers(ctx context.Context, params *domain.ListBeersParams) ([]*domain.Beer, error)
ListBeers lists all beers from the postgres database.
func (*PostgresBeerRepository) UpdateBeer ¶
func (repo *PostgresBeerRepository) UpdateBeer(ctx context.Context, params *domain.UpdateBeerParams) (*domain.Beer, error)
UpdateBeer updates a beer in the postgres database.
type PostgresSettings ¶
PostgresSettings describes all the settings required for setting up a connection to a postgres database.
func (*PostgresSettings) String ¶
func (s *PostgresSettings) String() string
String returns the string representation for a postgres database.
Click to show internal directories.
Click to hide internal directories.