Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MountBottleController ¶
func MountBottleController(service *goa.Service, ctrl BottleController)
MountBottleController "mounts" a Bottle resource controller on the given service.
Types ¶
type Bottle ¶
type Bottle struct { // Unique bottle ID ID int `form:"ID" json:"ID" yaml:"ID" xml:"ID"` // Name of bottle Name string `form:"name" json:"name" yaml:"name" xml:"name"` // Rating of bottle Rating int `form:"rating" json:"rating" yaml:"rating" xml:"rating"` // Vintage of bottle Vintage int `form:"vintage" json:"vintage" yaml:"vintage" xml:"vintage"` }
bottle media type (default view)
Identifier: application/vnd.gophercon.goa.bottle; view=default
type BottleController ¶
type BottleController interface { goa.Muxer Create(*CreateBottleContext) error Show(*ShowBottleContext) error }
BottleController is the controller interface for the Bottle actions.
type BottlePayload ¶
type BottlePayload struct { // Name of bottle Name string `form:"name" json:"name" yaml:"name" xml:"name"` // Rating of bottle Rating int `form:"rating" json:"rating" yaml:"rating" xml:"rating"` // Vintage of bottle Vintage int `form:"vintage" json:"vintage" yaml:"vintage" xml:"vintage"` }
BottlePayload that creates bottles
func (*BottlePayload) Validate ¶
func (ut *BottlePayload) Validate() (err error)
Validate validates the BottlePayload type instance.
type CreateBottleContext ¶
type CreateBottleContext struct { context.Context *goa.ResponseData *goa.RequestData Payload *BottlePayload }
CreateBottleContext provides the bottle create action context.
func NewCreateBottleContext ¶
func NewCreateBottleContext(ctx context.Context, r *http.Request, service *goa.Service) (*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 ShowBottleContext ¶
type ShowBottleContext struct { context.Context *goa.ResponseData *goa.RequestData ID int Payload *BottlePayload }
ShowBottleContext provides the bottle show action context.
func NewShowBottleContext ¶
func NewShowBottleContext(ctx context.Context, r *http.Request, service *goa.Service) (*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) OK ¶
func (ctx *ShowBottleContext) OK(r *Bottle) error
OK sends a HTTP response with status code 200.