Documentation ¶
Index ¶
- func AccountHref(accountID interface{}) string
- func BottleHref(accountID, bottleID interface{}) string
- func MarshalAccount(source *Account, inErr error) (target map[string]interface{}, err error)
- func MarshalAccountLink(source *Account, inErr error) (target map[string]interface{}, err error)
- func MarshalBottle(source *Bottle, inErr error) (target map[string]interface{}, err error)
- func MarshalBottleCollection(source BottleCollection, inErr error) (target []map[string]interface{}, err error)
- func MarshalBottleCollectionTiny(source BottleCollection, inErr error) (target []map[string]interface{}, err error)
- func MarshalBottleFull(source *Bottle, inErr error) (target map[string]interface{}, err error)
- func MarshalBottlePayload(source *BottlePayload, inErr error) (target map[string]interface{}, err error)
- func MarshalBottleTiny(source *Bottle, inErr error) (target map[string]interface{}, err error)
- func MountAccountController(service goa.Service, ctrl AccountController)
- func MountBottleController(service goa.Service, ctrl BottleController)
- type Account
- type AccountController
- type AccountViewEnum
- type Bottle
- type BottleCollection
- type BottleCollectionViewEnum
- type BottleController
- type BottlePayload
- type BottleViewEnum
- type CreateAccountContext
- type CreateAccountPayload
- type CreateBottleContext
- type CreateBottlePayload
- type DeleteAccountContext
- type DeleteBottleContext
- type ListBottleContext
- type RateBottleContext
- type RateBottlePayload
- type ShowAccountContext
- type ShowBottleContext
- type UpdateAccountContext
- type UpdateAccountPayload
- type UpdateBottleContext
- type UpdateBottlePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountHref ¶
func AccountHref(accountID interface{}) string
AccountHref returns the resource href.
func BottleHref ¶
func BottleHref(accountID, bottleID interface{}) string
BottleHref returns the resource href.
func MarshalAccount ¶
MarshalAccount validates and renders an instance of Account into a interface{} using view "default".
func MarshalAccountLink ¶
MarshalAccountLink validates and renders an instance of Account into a interface{} using view "link".
func MarshalBottle ¶
MarshalBottle validates and renders an instance of Bottle into a interface{} using view "default".
func MarshalBottleCollection ¶
func MarshalBottleCollection(source BottleCollection, inErr error) (target []map[string]interface{}, err error)
MarshalBottleCollection validates and renders an instance of BottleCollection into a interface{} using view "default".
func MarshalBottleCollectionTiny ¶
func MarshalBottleCollectionTiny(source BottleCollection, inErr error) (target []map[string]interface{}, err error)
MarshalBottleCollectionTiny validates and renders an instance of BottleCollection into a interface{} using view "tiny".
func MarshalBottleFull ¶
MarshalBottleFull validates and renders an instance of Bottle into a interface{} using view "full".
func MarshalBottlePayload ¶
func MarshalBottlePayload(source *BottlePayload, inErr error) (target map[string]interface{}, err error)
MarshalBottlePayload validates and renders an instance of BottlePayload into a interface{}
func MarshalBottleTiny ¶
MarshalBottleTiny validates and renders an instance of Bottle into a interface{} using view "tiny".
func MountAccountController ¶
func MountAccountController(service goa.Service, ctrl AccountController)
MountAccountController "mounts" a Account resource controller on the given service.
func MountBottleController ¶
func MountBottleController(service goa.Service, ctrl BottleController)
MountBottleController "mounts" a Bottle resource controller on the given service.
Types ¶
type Account ¶
type Account struct { // Date of creation CreatedAt string // Email of account owner CreatedBy string // API href of account Href string // ID of account ID int // Name of account Name string }
A tenant account Identifier: application/vnd.account+json
func LoadAccount ¶
LoadAccount loads raw data into an instance of Account running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.ir/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalAccount ¶
UnmarshalAccount unmarshals and validates a raw interface{} into an instance of Account
type AccountController ¶
type AccountController interface { goa.Controller Create(*CreateAccountContext) error Delete(*DeleteAccountContext) error Show(*ShowAccountContext) error Update(*UpdateAccountContext) error }
AccountController is the controller interface for the Account actions.
type AccountViewEnum ¶
type AccountViewEnum string
Account views
const ( // Account default view AccountDefaultView AccountViewEnum = "default" // Account link view AccountLinkView AccountViewEnum = "link" )
type Bottle ¶
type Bottle struct { // Account that owns bottle Account *Account Color string Country string // Date of creation CreatedAt string // API href of bottle Href string // ID of bottle ID int Name string // Rating of bottle between 1 and 5 Rating int Region string Review string Sweetness int // Date of last update UpdatedAt string Varietal string Vineyard string Vintage int }
A bottle of wine Identifier: application/vnd.bottle+json
func LoadBottle ¶
LoadBottle loads raw data into an instance of Bottle running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.ir/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalBottle ¶
UnmarshalBottle unmarshals and validates a raw interface{} into an instance of Bottle
type BottleCollection ¶
type BottleCollection []*Bottle
BottleCollection media type Identifier: application/vnd.bottle+json; type=collection
func LoadBottleCollection ¶
func LoadBottleCollection(raw interface{}) (res BottleCollection, err error)
LoadBottleCollection loads raw data into an instance of BottleCollection running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.ir/pkg/encoding/json/#Unmarshal for the complete list of supported data types.
func UnmarshalBottleCollection ¶
func UnmarshalBottleCollection(source interface{}, inErr error) (target BottleCollection, err error)
UnmarshalBottleCollection unmarshals and validates a raw interface{} into an instance of BottleCollection
func (BottleCollection) Dump ¶
func (mt BottleCollection) Dump(view BottleCollectionViewEnum) (res []map[string]interface{}, err error)
Dump produces raw data from an instance of BottleCollection running all the validations. See LoadBottleCollection for the definition of raw data.
func (BottleCollection) Validate ¶
func (mt BottleCollection) Validate() (err error)
Validate validates the media type instance.
type BottleCollectionViewEnum ¶
type BottleCollectionViewEnum string
BottleCollection views
const ( // BottleCollection default view BottleCollectionDefaultView BottleCollectionViewEnum = "default" // BottleCollection tiny view BottleCollectionTinyView BottleCollectionViewEnum = "tiny" )
type BottleController ¶
type BottleController interface { goa.Controller Create(*CreateBottleContext) error Delete(*DeleteBottleContext) error List(*ListBottleContext) error Rate(*RateBottleContext) error Show(*ShowBottleContext) error Update(*UpdateBottleContext) error }
BottleController is the controller interface for the Bottle actions.
type BottlePayload ¶
type BottlePayload struct { Color string Country string Name string Region string Review string Sweetness int Varietal string Vineyard string Vintage int }
BottlePayload type
func UnmarshalBottlePayload ¶
func UnmarshalBottlePayload(source interface{}, inErr error) (target *BottlePayload, err error)
UnmarshalBottlePayload unmarshals and validates a raw interface{} into an instance of BottlePayload
type BottleViewEnum ¶
type BottleViewEnum string
Bottle views
const ( // Bottle default view BottleDefaultView BottleViewEnum = "default" // Bottle full view BottleFullView BottleViewEnum = "full" // Bottle tiny view BottleTinyView BottleViewEnum = "tiny" )
type CreateAccountContext ¶
type CreateAccountContext struct { *goa.Context Payload *CreateAccountPayload }
CreateAccountContext provides the account create action context.
func NewCreateAccountContext ¶
func NewCreateAccountContext(c *goa.Context) (*CreateAccountContext, error)
NewCreateAccountContext parses the incoming request URL and body, performs validations and creates the context used by the account controller create action.
func (*CreateAccountContext) Created ¶
func (ctx *CreateAccountContext) Created() error
Created sends a HTTP response with status code 201.
type CreateAccountPayload ¶
type CreateAccountPayload struct { // Name of account Name string }
CreateAccountPayload is the account create action payload.
func NewCreateAccountPayload ¶
func NewCreateAccountPayload(raw interface{}) (p *CreateAccountPayload, err error)
NewCreateAccountPayload instantiates a CreateAccountPayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalCreateAccountPayload ¶
func UnmarshalCreateAccountPayload(source interface{}, inErr error) (target *CreateAccountPayload, err error)
UnmarshalCreateAccountPayload unmarshals and validates a raw interface{} into an instance of CreateAccountPayload
type CreateBottleContext ¶
type CreateBottleContext struct { *goa.Context AccountID int Payload *CreateBottlePayload }
CreateBottleContext provides the bottle create action context.
func NewCreateBottleContext ¶
func NewCreateBottleContext(c *goa.Context) (*CreateBottleContext, error)
NewCreateBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller create action.
func (*CreateBottleContext) Created ¶
func (ctx *CreateBottleContext) Created() error
Created sends a HTTP response with status code 201.
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 bottle create action payload.
func NewCreateBottlePayload ¶
func NewCreateBottlePayload(raw interface{}) (p *CreateBottlePayload, err error)
NewCreateBottlePayload instantiates a CreateBottlePayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalCreateBottlePayload ¶
func UnmarshalCreateBottlePayload(source interface{}, inErr error) (target *CreateBottlePayload, err error)
UnmarshalCreateBottlePayload unmarshals and validates a raw interface{} into an instance of CreateBottlePayload
type DeleteAccountContext ¶
DeleteAccountContext provides the account delete action context.
func NewDeleteAccountContext ¶
func NewDeleteAccountContext(c *goa.Context) (*DeleteAccountContext, error)
NewDeleteAccountContext parses the incoming request URL and body, performs validations and creates the context used by the account controller delete action.
func (*DeleteAccountContext) NoContent ¶
func (ctx *DeleteAccountContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*DeleteAccountContext) NotFound ¶
func (ctx *DeleteAccountContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type DeleteBottleContext ¶
DeleteBottleContext provides the bottle delete action context.
func NewDeleteBottleContext ¶
func NewDeleteBottleContext(c *goa.Context) (*DeleteBottleContext, error)
NewDeleteBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller delete action.
func (*DeleteBottleContext) NoContent ¶
func (ctx *DeleteBottleContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*DeleteBottleContext) NotFound ¶
func (ctx *DeleteBottleContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type ListBottleContext ¶
ListBottleContext provides the bottle list action context.
func NewListBottleContext ¶
func NewListBottleContext(c *goa.Context) (*ListBottleContext, error)
NewListBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller list action.
func (*ListBottleContext) NotFound ¶
func (ctx *ListBottleContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*ListBottleContext) OK ¶
func (ctx *ListBottleContext) OK(resp BottleCollection, view BottleCollectionViewEnum) error
OK sends a HTTP response with status code 200.
type RateBottleContext ¶
type RateBottleContext struct { *goa.Context AccountID int BottleID int Payload *RateBottlePayload }
RateBottleContext provides the bottle rate action context.
func NewRateBottleContext ¶
func NewRateBottleContext(c *goa.Context) (*RateBottleContext, error)
NewRateBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller rate action.
func (*RateBottleContext) NoContent ¶
func (ctx *RateBottleContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*RateBottleContext) NotFound ¶
func (ctx *RateBottleContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type RateBottlePayload ¶
type RateBottlePayload struct { // Rating of bottle between 1 and 5 Rating int }
RateBottlePayload is the bottle rate action payload.
func NewRateBottlePayload ¶
func NewRateBottlePayload(raw interface{}) (p *RateBottlePayload, err error)
NewRateBottlePayload instantiates a RateBottlePayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalRateBottlePayload ¶
func UnmarshalRateBottlePayload(source interface{}, inErr error) (target *RateBottlePayload, err error)
UnmarshalRateBottlePayload unmarshals and validates a raw interface{} into an instance of RateBottlePayload
type ShowAccountContext ¶
ShowAccountContext provides the account show action context.
func NewShowAccountContext ¶
func NewShowAccountContext(c *goa.Context) (*ShowAccountContext, error)
NewShowAccountContext parses the incoming request URL and body, performs validations and creates the context used by the account controller show action.
func (*ShowAccountContext) NotFound ¶
func (ctx *ShowAccountContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*ShowAccountContext) OK ¶
func (ctx *ShowAccountContext) OK(resp *Account, view AccountViewEnum) error
OK sends a HTTP response with status code 200.
type ShowBottleContext ¶
ShowBottleContext provides the bottle show action context.
func NewShowBottleContext ¶
func NewShowBottleContext(c *goa.Context) (*ShowBottleContext, error)
NewShowBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller show action.
func (*ShowBottleContext) NotFound ¶
func (ctx *ShowBottleContext) NotFound() error
NotFound sends a HTTP response with status code 404.
func (*ShowBottleContext) OK ¶
func (ctx *ShowBottleContext) OK(resp *Bottle, view BottleViewEnum) error
OK sends a HTTP response with status code 200.
type UpdateAccountContext ¶
type UpdateAccountContext struct { *goa.Context AccountID int Payload *UpdateAccountPayload }
UpdateAccountContext provides the account update action context.
func NewUpdateAccountContext ¶
func NewUpdateAccountContext(c *goa.Context) (*UpdateAccountContext, error)
NewUpdateAccountContext parses the incoming request URL and body, performs validations and creates the context used by the account controller update action.
func (*UpdateAccountContext) NoContent ¶
func (ctx *UpdateAccountContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*UpdateAccountContext) NotFound ¶
func (ctx *UpdateAccountContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type UpdateAccountPayload ¶
type UpdateAccountPayload struct { // Name of account Name string }
UpdateAccountPayload is the account update action payload.
func NewUpdateAccountPayload ¶
func NewUpdateAccountPayload(raw interface{}) (p *UpdateAccountPayload, err error)
NewUpdateAccountPayload instantiates a UpdateAccountPayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalUpdateAccountPayload ¶
func UnmarshalUpdateAccountPayload(source interface{}, inErr error) (target *UpdateAccountPayload, err error)
UnmarshalUpdateAccountPayload unmarshals and validates a raw interface{} into an instance of UpdateAccountPayload
type UpdateBottleContext ¶
type UpdateBottleContext struct { *goa.Context AccountID int BottleID int Payload *UpdateBottlePayload }
UpdateBottleContext provides the bottle update action context.
func NewUpdateBottleContext ¶
func NewUpdateBottleContext(c *goa.Context) (*UpdateBottleContext, error)
NewUpdateBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller update action.
func (*UpdateBottleContext) NoContent ¶
func (ctx *UpdateBottleContext) NoContent() error
NoContent sends a HTTP response with status code 204.
func (*UpdateBottleContext) NotFound ¶
func (ctx *UpdateBottleContext) NotFound() error
NotFound sends a HTTP response with status code 404.
type UpdateBottlePayload ¶
type UpdateBottlePayload struct { Color string Country string Name string Region string Review string Sweetness int Varietal string Vineyard string Vintage int }
UpdateBottlePayload is the bottle update action payload.
func NewUpdateBottlePayload ¶
func NewUpdateBottlePayload(raw interface{}) (p *UpdateBottlePayload, err error)
NewUpdateBottlePayload instantiates a UpdateBottlePayload from a raw request body. It validates each field and returns an error if any validation fails.
func UnmarshalUpdateBottlePayload ¶
func UnmarshalUpdateBottlePayload(source interface{}, inErr error) (target *UpdateBottlePayload, err error)
UnmarshalUpdateBottlePayload unmarshals and validates a raw interface{} into an instance of UpdateBottlePayload