Documentation ¶
Index ¶
- type ActionCommand
- type Client
- func (c *Client) CreateAccount(path string, payload *CreateAccountPayload) (*http.Response, error)
- func (c *Client) CreateBottle(path string, payload *CreateBottlePayload) (*http.Response, error)
- func (c *Client) DeleteAccount(path string) (*http.Response, error)
- func (c *Client) DeleteBottle(path string) (*http.Response, error)
- func (c *Client) ListBottle(path string, years []int) (*http.Response, error)
- func (c *Client) RateBottle(path string, payload *RateBottlePayload) (*http.Response, error)
- func (c *Client) ShowAccount(path string) (*http.Response, error)
- func (c *Client) ShowBottle(path string) (*http.Response, error)
- func (c *Client) UpdateAccount(path string, payload *UpdateAccountPayload) (*http.Response, error)
- func (c *Client) UpdateBottle(path string, payload *UpdateBottlePayload) (*http.Response, error)
- type CreateAccountPayload
- type CreateBottlePayload
- type RateBottlePayload
- type UpdateAccountPayload
- type UpdateBottlePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionCommand ¶
type ActionCommand interface { // Run makes the HTTP request and returns the response. Run(c *Client) (*http.Response, error) // RegisterFlags defines the command flags. RegisterFlags(*kingpin.CmdClause) }
ActionCommand represents a single action command as defined on the command line. Each command is associated with a generated client method and contains the logic to call the method passing in arguments computed from the command line.
type Client ¶
Client is the cellar service client.
func (*Client) CreateAccount ¶
Create new account
func (*Client) CreateBottle ¶
Record new bottle
func (*Client) DeleteAccount ¶
DeleteAccount makes a request to the delete action endpoint of the account resource
func (*Client) DeleteBottle ¶
DeleteBottle makes a request to the delete action endpoint of the bottle resource
func (*Client) ListBottle ¶
List all bottles in account optionally filtering by year
func (*Client) RateBottle ¶
RateBottle makes a request to the rate action endpoint of the bottle resource
func (*Client) ShowAccount ¶
Retrieve account with given id
func (*Client) ShowBottle ¶
Retrieve bottle with given id
func (*Client) UpdateAccount ¶
Change account name
func (*Client) UpdateBottle ¶
UpdateBottle makes a request to the update action endpoint of the bottle resource
type CreateAccountPayload ¶
type CreateAccountPayload struct { // Name of account Name string }
CreateAccountPayload is the data structure used to initialize the account create request body.
type CreateBottlePayload ¶
type CreateBottlePayload struct { Color string Country *string Name string Region *string Review *string Sweetness *int Varietal string Vineyard string Vintage int }
CreateBottlePayload is the data structure used to initialize the bottle create request body.
type RateBottlePayload ¶
type RateBottlePayload struct { // Rating of bottle between 1 and 5 Rating int }
RateBottlePayload is the data structure used to initialize the bottle rate request body.
type UpdateAccountPayload ¶
type UpdateAccountPayload struct { // Name of account Name string }
UpdateAccountPayload is the data structure used to initialize the account update request body.