Documentation ¶
Index ¶
- type AccountController
- type BottleController
- func (b *BottleController) Create(ctx *app.CreateBottleContext) error
- func (b *BottleController) Delete(ctx *app.DeleteBottleContext) error
- func (b *BottleController) List(ctx *app.ListBottleContext) error
- func (b *BottleController) Rate(ctx *app.RateBottleContext) error
- func (b *BottleController) Show(ctx *app.ShowBottleContext) error
- func (b *BottleController) Update(ctx *app.UpdateBottleContext) error
- type DB
- func (db *DB) DeleteAccount(account *app.Account)
- func (db *DB) DeleteBottle(bottle *app.Bottle)
- func (db *DB) GetAccount(id int) *app.Account
- func (db *DB) GetBottle(account, id int) *app.Bottle
- func (db *DB) GetBottles(account int) ([]*app.Bottle, error)
- func (db *DB) GetBottlesByYears(account int, years []int) ([]*app.Bottle, error)
- func (db *DB) NewAccount() *app.Account
- func (db *DB) NewBottle(account int) *app.Bottle
- func (db *DB) SaveAccount(a *app.Account)
- func (db *DB) SaveBottle(b *app.Bottle)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountController ¶
type AccountController struct { goa.Controller // contains filtered or unexported fields }
AccountController implements the account resource.
func NewAccount ¶
func NewAccount(service goa.Service) *AccountController
NewAccount creates a account controller.
func (*AccountController) Create ¶
func (b *AccountController) Create(c *app.CreateAccountContext) error
Create records a new account.
func (*AccountController) Delete ¶
func (b *AccountController) Delete(c *app.DeleteAccountContext) error
Delete removes a account from the database.
func (*AccountController) Show ¶
func (b *AccountController) Show(c *app.ShowAccountContext) error
Show retrieves the account with the given id.
func (*AccountController) Update ¶
func (b *AccountController) Update(c *app.UpdateAccountContext) error
Update updates a account field(s).
type BottleController ¶
type BottleController struct { goa.Controller // contains filtered or unexported fields }
BottleController implements the bottle resource.
func NewBottle ¶
func NewBottle(service goa.Service) *BottleController
NewBottle creates a bottle controller.
func (*BottleController) Create ¶
func (b *BottleController) Create(ctx *app.CreateBottleContext) error
Create records a new bottle.
func (*BottleController) Delete ¶
func (b *BottleController) Delete(ctx *app.DeleteBottleContext) error
Delete removes a bottle from the database.
func (*BottleController) List ¶
func (b *BottleController) List(ctx *app.ListBottleContext) error
List lists all the bottles in the account optionally filtering by year.
func (*BottleController) Rate ¶
func (b *BottleController) Rate(ctx *app.RateBottleContext) error
Rate rates a bottle.
func (*BottleController) Show ¶
func (b *BottleController) Show(ctx *app.ShowBottleContext) error
Show retrieves the bottle with the given id.
func (*BottleController) Update ¶
func (b *BottleController) Update(ctx *app.UpdateBottleContext) error
Update updates a bottle field(s).
type DB ¶
DB emulates a database driver using in-memory data structures.
func (*DB) DeleteAccount ¶
DeleteAccount deletes the account.
func (*DB) DeleteBottle ¶
DeleteBottle deletes bottle from bottlesbase.
func (*DB) GetAccount ¶
GetAccount returns the account with given id if any, nil otherwise.
func (*DB) GetBottle ¶
GetBottle returns the bottle with the given id from the given account or nil if not found.
func (*DB) GetBottles ¶
GetBottles return the bottles from the given account.
func (*DB) GetBottlesByYears ¶
GetBottlesByYears returns the bottles with the vintage in the given array from the given account.
func (*DB) NewAccount ¶
NewAccount creates a new blank account resource.
func (*DB) SaveAccount ¶
SaveAccount "persists" the account.
func (*DB) SaveBottle ¶
SaveBottle persists bottle to bottlesbase.