Documentation ¶
Index ¶
- func CreateAccountPath() string
- func CreateBottlePath(accountID int) string
- func DeleteAccountPath(accountID int) string
- func DeleteBottlePath(accountID int, bottleID int) string
- func HealthHealthPath() string
- func ListAccountPath() string
- func ListBottlePath(accountID int) string
- func RateBottlePath(accountID int, bottleID int) string
- func ShowAccountPath(accountID int) string
- func ShowBottlePath(accountID int, bottleID int) string
- func UpdateAccountPath(accountID int) string
- func UpdateBottlePath(accountID int, bottleID int) string
- func WatchBottlePath(accountID int, bottleID int) string
- type Account
- type AccountCollection
- type AccountLink
- type AccountLinkCollection
- type AccountTiny
- type AccountTinyCollection
- type Bottle
- type BottleCollection
- type BottleFull
- type BottleLinks
- type BottleLinksArray
- type BottlePayload
- type BottleTiny
- type BottleTinyCollection
- type Client
- func (c *Client) CreateAccount(ctx context.Context, path string, payload *CreateAccountPayload, ...) (*http.Response, error)
- func (c *Client) CreateBottle(ctx context.Context, path string, payload *CreateBottlePayload, ...) (*http.Response, error)
- func (c *Client) DecodeAccount(resp *http.Response) (*Account, error)
- func (c *Client) DecodeAccountCollection(resp *http.Response) (AccountCollection, error)
- func (c *Client) DecodeAccountLink(resp *http.Response) (*AccountLink, error)
- func (c *Client) DecodeAccountLinkCollection(resp *http.Response) (AccountLinkCollection, error)
- func (c *Client) DecodeAccountTiny(resp *http.Response) (*AccountTiny, error)
- func (c *Client) DecodeAccountTinyCollection(resp *http.Response) (AccountTinyCollection, error)
- func (c *Client) DecodeBottle(resp *http.Response) (*Bottle, error)
- func (c *Client) DecodeBottleCollection(resp *http.Response) (BottleCollection, error)
- func (c *Client) DecodeBottleFull(resp *http.Response) (*BottleFull, error)
- func (c *Client) DecodeBottleTiny(resp *http.Response) (*BottleTiny, error)
- func (c *Client) DecodeBottleTinyCollection(resp *http.Response) (BottleTinyCollection, error)
- func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)
- func (c *Client) DeleteAccount(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) DeleteBottle(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) DownloadJs(ctx context.Context, filename, dest string) (int64, error)
- func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)
- func (c *Client) DownloadUI(ctx context.Context, dest string) (int64, error)
- func (c *Client) HealthHealth(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) ListAccount(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) ListBottle(ctx context.Context, path string, years []int) (*http.Response, error)
- func (c *Client) NewCreateAccountRequest(ctx context.Context, path string, payload *CreateAccountPayload, ...) (*http.Request, error)
- func (c *Client) NewCreateBottleRequest(ctx context.Context, path string, payload *CreateBottlePayload, ...) (*http.Request, error)
- func (c *Client) NewDeleteAccountRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewDeleteBottleRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewHealthHealthRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewListAccountRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewListBottleRequest(ctx context.Context, path string, years []int) (*http.Request, error)
- func (c *Client) NewRateBottleRequest(ctx context.Context, path string, payload *RateBottlePayload, ...) (*http.Request, error)
- func (c *Client) NewShowAccountRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewShowBottleRequest(ctx context.Context, path string) (*http.Request, error)
- func (c *Client) NewUpdateAccountRequest(ctx context.Context, path string, payload *UpdateAccountPayload, ...) (*http.Request, error)
- func (c *Client) NewUpdateBottleRequest(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Request, error)
- func (c *Client) RateBottle(ctx context.Context, path string, payload *RateBottlePayload, ...) (*http.Response, error)
- func (c *Client) ShowAccount(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) ShowBottle(ctx context.Context, path string) (*http.Response, error)
- func (c *Client) UpdateAccount(ctx context.Context, path string, payload *UpdateAccountPayload, ...) (*http.Response, error)
- func (c *Client) UpdateBottle(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Response, error)
- func (c *Client) WatchBottle(ctx context.Context, path string) (*websocket.Conn, error)
- type CreateAccountPayload
- type CreateBottlePayload
- type RateBottlePayload
- type UpdateAccountPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAccountPath ¶
func CreateAccountPath() string
CreateAccountPath computes a request path to the create action of account.
func CreateBottlePath ¶
CreateBottlePath computes a request path to the create action of bottle.
func DeleteAccountPath ¶
DeleteAccountPath computes a request path to the delete action of account.
func DeleteBottlePath ¶
DeleteBottlePath computes a request path to the delete action of bottle.
func HealthHealthPath ¶
func HealthHealthPath() string
HealthHealthPath computes a request path to the health action of health.
func ListAccountPath ¶
func ListAccountPath() string
ListAccountPath computes a request path to the list action of account.
func ListBottlePath ¶
ListBottlePath computes a request path to the list action of bottle.
func RateBottlePath ¶
RateBottlePath computes a request path to the rate action of bottle.
func ShowAccountPath ¶
ShowAccountPath computes a request path to the show action of account.
func ShowBottlePath ¶
ShowBottlePath computes a request path to the show action of bottle.
func UpdateAccountPath ¶
UpdateAccountPath computes a request path to the update action of account.
func UpdateBottlePath ¶
UpdateBottlePath computes a request path to the update action of bottle.
func WatchBottlePath ¶
WatchBottlePath computes a request path to the watch action of bottle.
Types ¶
type Account ¶
type Account struct { // Date of creation CreatedAt time.Time `form:"created_at" json:"created_at" xml:"created_at"` // Email of account owner CreatedBy string `form:"created_by" json:"created_by" xml:"created_by"` // API href of account Href string `form:"href" json:"href" xml:"href"` // ID of account ID int `form:"id" json:"id" xml:"id"` // Name of account Name string `form:"name" json:"name" xml:"name"` }
A tenant account (default view)
Identifier: application/vnd.account+json; view=default
type AccountCollection ¶
type AccountCollection []*Account
AccountCollection is the media type for an array of Account (default view)
Identifier: application/vnd.account+json; type=collection; view=default
func (AccountCollection) Validate ¶
func (mt AccountCollection) Validate() (err error)
Validate validates the AccountCollection media type instance.
type AccountLink ¶
type AccountLink struct { // API href of account Href string `form:"href" json:"href" xml:"href"` // ID of account ID int `form:"id" json:"id" xml:"id"` }
A tenant account (link view)
Identifier: application/vnd.account+json; view=link
func (*AccountLink) Validate ¶
func (mt *AccountLink) Validate() (err error)
Validate validates the AccountLink media type instance.
type AccountLinkCollection ¶
type AccountLinkCollection []*AccountLink
AccountCollection is the media type for an array of Account (link view)
Identifier: application/vnd.account+json; type=collection; view=link
func (AccountLinkCollection) Validate ¶
func (mt AccountLinkCollection) Validate() (err error)
Validate validates the AccountLinkCollection media type instance.
type AccountTiny ¶
type AccountTiny struct { // API href of account Href string `form:"href" json:"href" xml:"href"` // ID of account ID int `form:"id" json:"id" xml:"id"` // Name of account Name string `form:"name" json:"name" xml:"name"` }
A tenant account (tiny view)
Identifier: application/vnd.account+json; view=tiny
func (*AccountTiny) Validate ¶
func (mt *AccountTiny) Validate() (err error)
Validate validates the AccountTiny media type instance.
type AccountTinyCollection ¶
type AccountTinyCollection []*AccountTiny
AccountCollection is the media type for an array of Account (tiny view)
Identifier: application/vnd.account+json; type=collection; view=tiny
func (AccountTinyCollection) Validate ¶
func (mt AccountTinyCollection) Validate() (err error)
Validate validates the AccountTinyCollection media type instance.
type Bottle ¶
type Bottle struct { // Account that owns bottle Account *AccountTiny `form:"account,omitempty" json:"account,omitempty" xml:"account,omitempty"` // API href of bottle Href string `form:"href" json:"href" xml:"href"` // ID of bottle ID int `form:"id" json:"id" xml:"id"` // Links to related resources Links *BottleLinks `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"` Name string `form:"name" json:"name" xml:"name"` // Rating of bottle between 1 and 5 Rating *int `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"` Varietal string `form:"varietal" json:"varietal" xml:"varietal"` Vineyard string `form:"vineyard" json:"vineyard" xml:"vineyard"` Vintage int `form:"vintage" json:"vintage" xml:"vintage"` }
A bottle of wine (default view)
Identifier: application/vnd.bottle+json; view=default
type BottleCollection ¶
type BottleCollection []*Bottle
BottleCollection is the media type for an array of Bottle (default view)
Identifier: application/vnd.bottle+json; type=collection; view=default
func (BottleCollection) Validate ¶
func (mt BottleCollection) Validate() (err error)
Validate validates the BottleCollection media type instance.
type BottleFull ¶
type BottleFull struct { // Account that owns bottle Account *Account `form:"account,omitempty" json:"account,omitempty" xml:"account,omitempty"` Color string `form:"color" json:"color" xml:"color"` Country *string `form:"country,omitempty" json:"country,omitempty" xml:"country,omitempty"` // Date of creation CreatedAt time.Time `form:"created_at" json:"created_at" xml:"created_at"` // API href of bottle Href string `form:"href" json:"href" xml:"href"` // ID of bottle ID int `form:"id" json:"id" xml:"id"` // Links to related resources Links *BottleLinks `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"` Name string `form:"name" json:"name" xml:"name"` // Rating of bottle between 1 and 5 Rating *int `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"` Region *string `form:"region,omitempty" json:"region,omitempty" xml:"region,omitempty"` Review *string `form:"review,omitempty" json:"review,omitempty" xml:"review,omitempty"` Sweetness *int `form:"sweetness,omitempty" json:"sweetness,omitempty" xml:"sweetness,omitempty"` // Date of last update UpdatedAt *time.Time `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"` Varietal string `form:"varietal" json:"varietal" xml:"varietal"` Vineyard string `form:"vineyard" json:"vineyard" xml:"vineyard"` Vintage int `form:"vintage" json:"vintage" xml:"vintage"` }
A bottle of wine (full view)
Identifier: application/vnd.bottle+json; view=full
func (*BottleFull) Validate ¶
func (mt *BottleFull) Validate() (err error)
Validate validates the BottleFull media type instance.
type BottleLinks ¶
type BottleLinks struct {
Account *AccountLink `form:"account,omitempty" json:"account,omitempty" xml:"account,omitempty"`
}
BottleLinks contains links to related resources of Bottle.
func (*BottleLinks) Validate ¶
func (ut *BottleLinks) Validate() (err error)
Validate validates the BottleLinks type instance.
type BottleLinksArray ¶
type BottleLinksArray []*BottleLinks
BottleLinksArray contains links to related resources of BottleCollection.
func (BottleLinksArray) Validate ¶
func (ut BottleLinksArray) Validate() (err error)
Validate validates the BottleLinksArray type instance.
type BottlePayload ¶
type BottlePayload struct { Color *string `form:"color,omitempty" json:"color,omitempty" xml:"color,omitempty"` Country *string `form:"country,omitempty" json:"country,omitempty" xml:"country,omitempty"` Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"` Region *string `form:"region,omitempty" json:"region,omitempty" xml:"region,omitempty"` Review *string `form:"review,omitempty" json:"review,omitempty" xml:"review,omitempty"` Sweetness *int `form:"sweetness,omitempty" json:"sweetness,omitempty" xml:"sweetness,omitempty"` Varietal *string `form:"varietal,omitempty" json:"varietal,omitempty" xml:"varietal,omitempty"` Vineyard *string `form:"vineyard,omitempty" json:"vineyard,omitempty" xml:"vineyard,omitempty"` Vintage *int `form:"vintage,omitempty" json:"vintage,omitempty" xml:"vintage,omitempty"` }
BottlePayload user type.
func (*BottlePayload) Validate ¶
func (ut *BottlePayload) Validate() (err error)
Validate validates the BottlePayload type instance.
type BottleTiny ¶
type BottleTiny struct { // API href of bottle Href string `form:"href" json:"href" xml:"href"` // ID of bottle ID int `form:"id" json:"id" xml:"id"` // Links to related resources Links *BottleLinks `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"` Name string `form:"name" json:"name" xml:"name"` // Rating of bottle between 1 and 5 Rating *int `form:"rating,omitempty" json:"rating,omitempty" xml:"rating,omitempty"` }
A bottle of wine (tiny view)
Identifier: application/vnd.bottle+json; view=tiny
func (*BottleTiny) Validate ¶
func (mt *BottleTiny) Validate() (err error)
Validate validates the BottleTiny media type instance.
type BottleTinyCollection ¶
type BottleTinyCollection []*BottleTiny
BottleCollection is the media type for an array of Bottle (tiny view)
Identifier: application/vnd.bottle+json; type=collection; view=tiny
func (BottleTinyCollection) Validate ¶
func (mt BottleTinyCollection) Validate() (err error)
Validate validates the BottleTinyCollection media type instance.
type Client ¶
type Client struct { *goaclient.Client Encoder *goa.HTTPEncoder Decoder *goa.HTTPDecoder }
Client is the cellar service client.
func (*Client) CreateAccount ¶
func (c *Client) CreateAccount(ctx context.Context, path string, payload *CreateAccountPayload, contentType string) (*http.Response, error)
Create new account
func (*Client) CreateBottle ¶
func (c *Client) CreateBottle(ctx context.Context, path string, payload *CreateBottlePayload, contentType string) (*http.Response, error)
Record new bottle
func (*Client) DecodeAccount ¶
DecodeAccount decodes the Account instance encoded in resp body.
func (*Client) DecodeAccountCollection ¶
func (c *Client) DecodeAccountCollection(resp *http.Response) (AccountCollection, error)
DecodeAccountCollection decodes the AccountCollection instance encoded in resp body.
func (*Client) DecodeAccountLink ¶
func (c *Client) DecodeAccountLink(resp *http.Response) (*AccountLink, error)
DecodeAccountLink decodes the AccountLink instance encoded in resp body.
func (*Client) DecodeAccountLinkCollection ¶
func (c *Client) DecodeAccountLinkCollection(resp *http.Response) (AccountLinkCollection, error)
DecodeAccountLinkCollection decodes the AccountLinkCollection instance encoded in resp body.
func (*Client) DecodeAccountTiny ¶
func (c *Client) DecodeAccountTiny(resp *http.Response) (*AccountTiny, error)
DecodeAccountTiny decodes the AccountTiny instance encoded in resp body.
func (*Client) DecodeAccountTinyCollection ¶
func (c *Client) DecodeAccountTinyCollection(resp *http.Response) (AccountTinyCollection, error)
DecodeAccountTinyCollection decodes the AccountTinyCollection instance encoded in resp body.
func (*Client) DecodeBottle ¶
DecodeBottle decodes the Bottle instance encoded in resp body.
func (*Client) DecodeBottleCollection ¶
func (c *Client) DecodeBottleCollection(resp *http.Response) (BottleCollection, error)
DecodeBottleCollection decodes the BottleCollection instance encoded in resp body.
func (*Client) DecodeBottleFull ¶
func (c *Client) DecodeBottleFull(resp *http.Response) (*BottleFull, error)
DecodeBottleFull decodes the BottleFull instance encoded in resp body.
func (*Client) DecodeBottleTiny ¶
func (c *Client) DecodeBottleTiny(resp *http.Response) (*BottleTiny, error)
DecodeBottleTiny decodes the BottleTiny instance encoded in resp body.
func (*Client) DecodeBottleTinyCollection ¶
func (c *Client) DecodeBottleTinyCollection(resp *http.Response) (BottleTinyCollection, error)
DecodeBottleTinyCollection decodes the BottleTinyCollection instance encoded in resp body.
func (*Client) DecodeErrorResponse ¶
DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.
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) DownloadJs ¶
DownloadJs downloads /files with the given filename and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) DownloadSwaggerJSON ¶
DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) DownloadUI ¶
DownloadUI downloads index.html and writes it to the file dest. It returns the number of bytes downloaded in case of success.
func (*Client) HealthHealth ¶
Perform health check.
func (*Client) ListAccount ¶
Retrieve all accounts.
func (*Client) ListBottle ¶
List all bottles in account optionally filtering by year
func (*Client) NewCreateAccountRequest ¶
func (c *Client) NewCreateAccountRequest(ctx context.Context, path string, payload *CreateAccountPayload, contentType string) (*http.Request, error)
NewCreateAccountRequest create the request corresponding to the create action endpoint of the account resource.
func (*Client) NewCreateBottleRequest ¶
func (c *Client) NewCreateBottleRequest(ctx context.Context, path string, payload *CreateBottlePayload, contentType string) (*http.Request, error)
NewCreateBottleRequest create the request corresponding to the create action endpoint of the bottle resource.
func (*Client) NewDeleteAccountRequest ¶
NewDeleteAccountRequest create the request corresponding to the delete action endpoint of the account resource.
func (*Client) NewDeleteBottleRequest ¶
NewDeleteBottleRequest create the request corresponding to the delete action endpoint of the bottle resource.
func (*Client) NewHealthHealthRequest ¶
NewHealthHealthRequest create the request corresponding to the health action endpoint of the health resource.
func (*Client) NewListAccountRequest ¶
NewListAccountRequest create the request corresponding to the list action endpoint of the account resource.
func (*Client) NewListBottleRequest ¶
func (c *Client) NewListBottleRequest(ctx context.Context, path string, years []int) (*http.Request, error)
NewListBottleRequest create the request corresponding to the list action endpoint of the bottle resource.
func (*Client) NewRateBottleRequest ¶
func (c *Client) NewRateBottleRequest(ctx context.Context, path string, payload *RateBottlePayload, contentType string) (*http.Request, error)
NewRateBottleRequest create the request corresponding to the rate action endpoint of the bottle resource.
func (*Client) NewShowAccountRequest ¶
NewShowAccountRequest create the request corresponding to the show action endpoint of the account resource.
func (*Client) NewShowBottleRequest ¶
NewShowBottleRequest create the request corresponding to the show action endpoint of the bottle resource.
func (*Client) NewUpdateAccountRequest ¶
func (c *Client) NewUpdateAccountRequest(ctx context.Context, path string, payload *UpdateAccountPayload, contentType string) (*http.Request, error)
NewUpdateAccountRequest create the request corresponding to the update action endpoint of the account resource.
func (*Client) NewUpdateBottleRequest ¶
func (c *Client) NewUpdateBottleRequest(ctx context.Context, path string, payload *BottlePayload, contentType string) (*http.Request, error)
NewUpdateBottleRequest create the request corresponding to the update action endpoint of the bottle resource.
func (*Client) RateBottle ¶
func (c *Client) RateBottle(ctx context.Context, path string, payload *RateBottlePayload, contentType string) (*http.Response, error)
RateBottle makes a request to the rate action endpoint of the bottle resource
func (*Client) ShowAccount ¶
Retrieve account with given id. IDs 1 and 2 pre-exist in the system.
func (*Client) ShowBottle ¶
Retrieve bottle with given id
func (*Client) UpdateAccount ¶
func (c *Client) UpdateAccount(ctx context.Context, path string, payload *UpdateAccountPayload, contentType string) (*http.Response, error)
Change account name
type CreateAccountPayload ¶
type CreateAccountPayload struct { // Name of account Name string `form:"name" json:"name" xml:"name"` }
CreateAccountPayload is the account create action payload.
type CreateBottlePayload ¶
type CreateBottlePayload struct { Color string `form:"color" json:"color" xml:"color"` Country *string `form:"country,omitempty" json:"country,omitempty" xml:"country,omitempty"` Name string `form:"name" json:"name" xml:"name"` Region *string `form:"region,omitempty" json:"region,omitempty" xml:"region,omitempty"` Review *string `form:"review,omitempty" json:"review,omitempty" xml:"review,omitempty"` Sweetness *int `form:"sweetness,omitempty" json:"sweetness,omitempty" xml:"sweetness,omitempty"` Varietal string `form:"varietal" json:"varietal" xml:"varietal"` Vineyard string `form:"vineyard" json:"vineyard" xml:"vineyard"` Vintage int `form:"vintage" json:"vintage" xml:"vintage"` }
CreateBottlePayload is the bottle create action payload.
type RateBottlePayload ¶
type RateBottlePayload struct { // Rating of bottle between 1 and 5 Rating int `form:"rating" json:"rating" xml:"rating"` }
RateBottlePayload is the bottle rate action payload.
type UpdateAccountPayload ¶
type UpdateAccountPayload struct { // Name of account Name string `form:"name" json:"name" xml:"name"` }
UpdateAccountPayload is the account update action payload.