Documentation
¶
Index ¶
- func MigrateUp(dbURL string)
- type Db
- func (db *Db) CloseConnection()
- func (db *Db) CreatePrices(drinks *[]exel.Drink) (OK bool, error error)
- func (db *Db) DeleteDrinks() error
- func (db *Db) GetAllBeers() (d []model.Drink, error error)
- func (db *Db) GetAllDrinks() ([]model.Drink, error)
- func (db *Db) GetAllPrices() ([]model.Price, error)
- func (db *Db) GetDrinkByProdID(ProductID string) (d model.Drink, error error)
- func (db *Db) GetPriceHistory(productID string) ([]model.Price, error)
- func (db *Db) InsertDrinks(drinks *[]exel.Drink) (OK bool, error error)
- func (db *Db) InsertManyDrinks() (string, error)
- func (db *Db) SearchForBeer(term string) (d []model.Drink, error error)
- func (db *Db) SearchForDrink(term string) (j []model.Drink, error error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db is the database connection
func (*Db) CloseConnection ¶
func (db *Db) CloseConnection()
CloseConnection closes the sql conection
func (*Db) CreatePrices ¶
CreatePrices creates new prices for juomas
func (*Db) DeleteDrinks ¶
DeleteDrinks deletes all the drinks from the db
func (*Db) GetAllBeers ¶
GetAllBeers gets all the beers from postgres
func (*Db) GetAllDrinks ¶
GetAllDrinks finds all the drinks
func (*Db) GetAllPrices ¶
GetAllPrices gets all the prices
func (*Db) GetDrinkByProdID ¶
GetDrinkByProdID gets one juoma with specified productID
func (*Db) GetPriceHistory ¶
GetPriceHistory returns the price history of one drink
func (*Db) InsertDrinks ¶
InsertDrinks reads the exel file and inserts to postgres
func (*Db) InsertManyDrinks ¶
InsertManyDrinks reads the alko file and inserts everything to postgres
func (*Db) SearchForBeer ¶
SearchForBeer gets one or more beer based on search results
Click to show internal directories.
Click to hide internal directories.