app

package
v0.0.0-...-84d5eb4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BottleHref

func BottleHref(bottleID 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 BottleController

type BottleController interface {
	goa.Muxer
	Show(*ShowBottleContext) error
}

BottleController is the controller interface for the Bottle actions.

type GoaExampleBottle

type GoaExampleBottle struct {
	// API href for making requests on the bottle
	Href string `form:"href" json:"href" yaml:"href" xml:"href"`
	// Unique bottle ID
	ID int `form:"id" json:"id" yaml:"id" xml:"id"`
	// Name of wine
	Name string `form:"name" json:"name" yaml:"name" xml:"name"`
}

A bottle of wine (default view)

Identifier: application/vnd.goa.example.bottle+json; view=default

func (*GoaExampleBottle) Validate

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

Validate validates the GoaExampleBottle media type instance.

type ShowBottleContext

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

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) NotFound

func (ctx *ShowBottleContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowBottleContext) OK

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