app

package
v0.0.0-...-2587fd7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 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 `json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Email of account owner
	CreatedBy *string `json:"created_by,omitempty" xml:"created_by,omitempty"`
	// API href of account
	Href string `json:"href" xml:"href"`
	// ID of account
	ID int `json:"id" xml:"id"`
	// Name of account
	Name string `json:"name" xml:"name"`
}

Account media type.

Identifier: application/vnd.account+json

func (*Account) Validate

func (mt *Account) Validate() (err error)

Validate validates the Account media type instance.

type AccountController

type AccountController interface {
	goa.Muxer
	Create(*CreateAccountContext) error
	Delete(*DeleteAccountContext) error
	Show(*ShowAccountContext) error
	Update(*UpdateAccountContext) error
}

AccountController is the controller interface for the Account actions.

type AccountLink struct {
	// API href of account
	Href string `json:"href" xml:"href"`
	// ID of account
	ID int `json:"id" xml:"id"`
}

AccountLink media type.

Identifier: application/vnd.account+json

func (*AccountLink) Validate

func (mt *AccountLink) Validate() (err error)

Validate validates the AccountLink media type instance.

type AccountTiny

type AccountTiny struct {
	// API href of account
	Href string `json:"href" xml:"href"`
	// ID of account
	ID int `json:"id" xml:"id"`
	// Name of account
	Name string `json:"name" xml:"name"`
}

AccountTiny media type.

Identifier: application/vnd.account+json

func (*AccountTiny) Validate

func (mt *AccountTiny) Validate() (err error)

Validate validates the AccountTiny media type instance.

type Bottle

type Bottle struct {
	// Account that owns bottle
	Account *Account `json:"account,omitempty" xml:"account,omitempty"`
	// API href of bottle
	Href string `json:"href" xml:"href"`
	// ID of bottle
	ID int `json:"id" xml:"id"`
	// Links to related resources
	Links *BottleLinks `json:"links,omitempty" xml:"links,omitempty"`
	Name  string       `json:"name" xml:"name"`
	// Rating of bottle between 1 and 5
	Rating   *int   `json:"rating,omitempty" xml:"rating,omitempty"`
	Varietal string `json:"varietal" xml:"varietal"`
	Vineyard string `json:"vineyard" xml:"vineyard"`
	Vintage  int    `json:"vintage" xml:"vintage"`
}

Bottle media type.

Identifier: application/vnd.bottle+json

func (*Bottle) Validate

func (mt *Bottle) Validate() (err error)

Validate validates the Bottle media type instance.

type BottleCollection

type BottleCollection []*Bottle

BottleCollection media type is a collection of Bottle.

Identifier: application/vnd.bottle+json; type=collection

func (BottleCollection) Validate

func (mt BottleCollection) Validate() (err error)

Validate validates the BottleCollection media type instance.

type BottleController

BottleController is the controller interface for the Bottle actions.

type BottleFull

type BottleFull struct {
	// Account that owns bottle
	Account *Account `json:"account,omitempty" xml:"account,omitempty"`
	Color   string   `json:"color" xml:"color"`
	Country *string  `json:"country,omitempty" xml:"country,omitempty"`
	// Date of creation
	CreatedAt *string `json:"created_at,omitempty" xml:"created_at,omitempty"`
	// API href of bottle
	Href string `json:"href" xml:"href"`
	// ID of bottle
	ID int `json:"id" xml:"id"`
	// Links to related resources
	Links *BottleLinks `json:"links,omitempty" xml:"links,omitempty"`
	Name  string       `json:"name" xml:"name"`
	// Rating of bottle between 1 and 5
	Rating    *int    `json:"rating,omitempty" xml:"rating,omitempty"`
	Region    *string `json:"region,omitempty" xml:"region,omitempty"`
	Review    *string `json:"review,omitempty" xml:"review,omitempty"`
	Sweetness *int    `json:"sweetness,omitempty" xml:"sweetness,omitempty"`
	// Date of last update
	UpdatedAt *string `json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	Varietal  string  `json:"varietal" xml:"varietal"`
	Vineyard  string  `json:"vineyard" xml:"vineyard"`
	Vintage   int     `json:"vintage" xml:"vintage"`
}

BottleFull media type.

Identifier: application/vnd.bottle+json

func (*BottleFull) Validate

func (mt *BottleFull) Validate() (err error)

Validate validates the BottleFull media type instance.

type BottleLinks struct {
	Account *AccountLink `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 `json:"color,omitempty" xml:"color,omitempty"`
	Country   *string `json:"country,omitempty" xml:"country,omitempty"`
	Name      *string `json:"name,omitempty" xml:"name,omitempty"`
	Region    *string `json:"region,omitempty" xml:"region,omitempty"`
	Review    *string `json:"review,omitempty" xml:"review,omitempty"`
	Sweetness *int    `json:"sweetness,omitempty" xml:"sweetness,omitempty"`
	Varietal  *string `json:"varietal,omitempty" xml:"varietal,omitempty"`
	Vineyard  *string `json:"vineyard,omitempty" xml:"vineyard,omitempty"`
	Vintage   *int    `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 `json:"href" xml:"href"`
	// ID of bottle
	ID int `json:"id" xml:"id"`
	// Links to related resources
	Links *BottleLinks `json:"links,omitempty" xml:"links,omitempty"`
	Name  string       `json:"name" xml:"name"`
	// Rating of bottle between 1 and 5
	Rating *int `json:"rating,omitempty" xml:"rating,omitempty"`
}

BottleTiny media type.

Identifier: application/vnd.bottle+json

func (*BottleTiny) Validate

func (mt *BottleTiny) Validate() (err error)

Validate validates the BottleTiny media type instance.

type BottleTinyCollection

type BottleTinyCollection []*BottleTiny

BottleTinyCollection media type is a collection of BottleTiny.

Identifier: application/vnd.bottle+json; type=collection

func (BottleTinyCollection) Validate

func (mt BottleTinyCollection) Validate() (err error)

Validate validates the BottleTinyCollection media type instance.

type CreateAccountContext

type CreateAccountContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *CreateAccountPayload
}

CreateAccountContext provides the account create action context.

func NewCreateAccountContext

func NewCreateAccountContext(ctx context.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 `json:"name" xml:"name"`
}

CreateAccountPayload is the account create action payload.

func (*CreateAccountPayload) Validate

func (payload *CreateAccountPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type CreateBottleContext

type CreateBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	Payload   *CreateBottlePayload
}

CreateBottleContext provides the bottle create action context.

func NewCreateBottleContext

func NewCreateBottleContext(ctx context.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  `json:"color" xml:"color"`
	Country   *string `json:"country,omitempty" xml:"country,omitempty"`
	Name      string  `json:"name" xml:"name"`
	Region    *string `json:"region,omitempty" xml:"region,omitempty"`
	Review    *string `json:"review,omitempty" xml:"review,omitempty"`
	Sweetness *int    `json:"sweetness,omitempty" xml:"sweetness,omitempty"`
	Varietal  string  `json:"varietal" xml:"varietal"`
	Vineyard  string  `json:"vineyard" xml:"vineyard"`
	Vintage   int     `json:"vintage" xml:"vintage"`
}

CreateBottlePayload is the bottle create action payload.

func (*CreateBottlePayload) Validate

func (payload *CreateBottlePayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type DeleteAccountContext

type DeleteAccountContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
}

DeleteAccountContext provides the account delete action context.

func NewDeleteAccountContext

func NewDeleteAccountContext(ctx context.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

type DeleteBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	BottleID  int
}

DeleteBottleContext provides the bottle delete action context.

func NewDeleteBottleContext

func NewDeleteBottleContext(ctx context.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

type ListBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	Years     []int
}

ListBottleContext provides the bottle list action context.

func NewListBottleContext

func NewListBottleContext(ctx context.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

OK sends a HTTP response with status code 200.

func (*ListBottleContext) OKTiny

OKTiny sends a HTTP response with status code 200.

type RateBottleContext

type RateBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	BottleID  int
	Payload   *RateBottlePayload
}

RateBottleContext provides the bottle rate action context.

func NewRateBottleContext

func NewRateBottleContext(ctx context.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 `json:"rating" xml:"rating"`
}

RateBottlePayload is the bottle rate action payload.

func (*RateBottlePayload) Validate

func (payload *RateBottlePayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type ShowAccountContext

type ShowAccountContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
}

ShowAccountContext provides the account show action context.

func NewShowAccountContext

func NewShowAccountContext(ctx context.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(r *Account) error

OK sends a HTTP response with status code 200.

func (*ShowAccountContext) OKTiny

func (ctx *ShowAccountContext) OKTiny(r *AccountTiny) error

OKTiny sends a HTTP response with status code 200.

type ShowBottleContext

type ShowBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	BottleID  int
}

ShowBottleContext provides the bottle show action context.

func NewShowBottleContext

func NewShowBottleContext(ctx context.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(r *Bottle) error

OK sends a HTTP response with status code 200.

func (*ShowBottleContext) OKFull

func (ctx *ShowBottleContext) OKFull(r *BottleFull) error

OKFull sends a HTTP response with status code 200.

func (*ShowBottleContext) OKTiny

func (ctx *ShowBottleContext) OKTiny(r *BottleTiny) error

OKTiny sends a HTTP response with status code 200.

type UpdateAccountContext

type UpdateAccountContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	Payload   *UpdateAccountPayload
}

UpdateAccountContext provides the account update action context.

func NewUpdateAccountContext

func NewUpdateAccountContext(ctx context.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 `json:"name" xml:"name"`
}

UpdateAccountPayload is the account update action payload.

func (*UpdateAccountPayload) Validate

func (payload *UpdateAccountPayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type UpdateBottleContext

type UpdateBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	BottleID  int
	Payload   *UpdateBottlePayload
}

UpdateBottleContext provides the bottle update action context.

func NewUpdateBottleContext

func NewUpdateBottleContext(ctx context.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 `json:"color,omitempty" xml:"color,omitempty"`
	Country   *string `json:"country,omitempty" xml:"country,omitempty"`
	Name      *string `json:"name,omitempty" xml:"name,omitempty"`
	Region    *string `json:"region,omitempty" xml:"region,omitempty"`
	Review    *string `json:"review,omitempty" xml:"review,omitempty"`
	Sweetness *int    `json:"sweetness,omitempty" xml:"sweetness,omitempty"`
	Varietal  *string `json:"varietal,omitempty" xml:"varietal,omitempty"`
	Vineyard  *string `json:"vineyard,omitempty" xml:"vineyard,omitempty"`
	Vintage   *int    `json:"vintage,omitempty" xml:"vintage,omitempty"`
}

UpdateBottlePayload is the bottle update action payload.

func (*UpdateBottlePayload) Validate

func (payload *UpdateBottlePayload) Validate() (err error)

Validate runs the validation rules defined in the design.

type WatchBottleContext

type WatchBottleContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	AccountID int
	BottleID  int
}

WatchBottleContext provides the bottle watch action context.

func NewWatchBottleContext

func NewWatchBottleContext(ctx context.Context) (*WatchBottleContext, error)

NewWatchBottleContext parses the incoming request URL and body, performs validations and creates the context used by the bottle controller watch action.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL