app

package
v0.0.0-...-eecba0e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 7 Imported by: 4

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.

func MountSwaggerController

func MountSwaggerController(service *goa.Service, ctrl SwaggerController)

MountSwaggerController "mounts" a Swagger resource controller on the given service.

func MountUserController

func MountUserController(service *goa.Service, ctrl UserController)

MountUserController "mounts" a User resource controller on the given service.

func UserHref

func UserHref(userID interface{}) string

UserHref returns the resource href.

Types

type ApplicationVndUser

type ApplicationVndUser struct {
	// description
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	// id
	ID *int `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// title
	Title *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
}

user media type (default view)

Identifier: application.vnd.user+json; view=default

type ApplicationVndUserCollection

type ApplicationVndUserCollection []*ApplicationVndUser

ApplicationVndUserCollection is the media type for an array of ApplicationVndUser (default view)

Identifier: application.vnd.user+json; type=collection; view=default

type BottleController

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

BottleController is the controller interface for the Bottle actions.

type CreateUserContext

type CreateUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *UserPayload
}

CreateUserContext provides the user create action context.

func NewCreateUserContext

func NewCreateUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*CreateUserContext, error)

NewCreateUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller create action.

func (*CreateUserContext) NotFound

func (ctx *CreateUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*CreateUserContext) OK

OK sends a HTTP response with status code 200.

type GoaExampleCom

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

A bottle of wine (default view)

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

func (*GoaExampleCom) Validate

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

Validate validates the GoaExampleCom media type instance.

type IndexUserContext

type IndexUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

IndexUserContext provides the user index action context.

func NewIndexUserContext

func NewIndexUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*IndexUserContext, error)

NewIndexUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller index action.

func (*IndexUserContext) NotFound

func (ctx *IndexUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*IndexUserContext) OK

OK sends a HTTP response with status code 200.

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.

type ShowUserContext

type ShowUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	UserID int
}

ShowUserContext provides the user show action context.

func NewShowUserContext

func NewShowUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*ShowUserContext, error)

NewShowUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller show action.

func (*ShowUserContext) NotFound

func (ctx *ShowUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowUserContext) OK

OK sends a HTTP response with status code 200.

type SwaggerController

type SwaggerController interface {
	goa.Muxer
	goa.FileServer
}

SwaggerController is the controller interface for the Swagger actions.

type UpdateUserContext

type UpdateUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	UserID  int
	Payload *UserPayload
}

UpdateUserContext provides the user update action context.

func NewUpdateUserContext

func NewUpdateUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*UpdateUserContext, error)

NewUpdateUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller update action.

func (*UpdateUserContext) NotFound

func (ctx *UpdateUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*UpdateUserContext) OK

OK sends a HTTP response with status code 200.

type UserController

type UserController interface {
	goa.Muxer
	Create(*CreateUserContext) error
	Index(*IndexUserContext) error
	Show(*ShowUserContext) error
	Update(*UpdateUserContext) error
}

UserController is the controller interface for the User actions.

type UserPayload

type UserPayload struct {
	Description *string `form:"description,omitempty" json:"description,omitempty" xml:"description,omitempty"`
	Title       *string `form:"title,omitempty" json:"title,omitempty" xml:"title,omitempty"`
}

UserPayload user type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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