app

package
v0.0.0-...-a15f217 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BottleHref

func BottleHref(id interface{}) string

BottleHref returns the resource href.

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

func (*Bottle) Validate

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

Validate validates the Bottle media type instance.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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