app

package
v0.0.0-...-722e3b2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountQuoteController

func MountQuoteController(service *goa.Service, ctrl QuoteController)

MountQuoteController "mounts" a Quote resource controller on the given service.

func NewBasicAuthSecurity

func NewBasicAuthSecurity() *goa.BasicAuthSecurity

NewBasicAuthSecurity creates a BasicAuth security definition.

func NewJWTSecurity

func NewJWTSecurity() *goa.JWTSecurity

NewJWTSecurity creates a jwt security definition.

func UseBasicAuthMiddleware

func UseBasicAuthMiddleware(service *goa.Service, middleware goa.Middleware)

UseBasicAuthMiddleware mounts the BasicAuth auth middleware onto the service.

func UseJWTMiddleware

func UseJWTMiddleware(service *goa.Service, middleware goa.Middleware)

UseJWTMiddleware mounts the jwt auth middleware onto the service.

Types

type CreateQuoteContext

type CreateQuoteContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *CreateQuotePayload
}

CreateQuoteContext provides the quote create action context.

func NewCreateQuoteContext

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

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

func (*CreateQuoteContext) OK

func (ctx *CreateQuoteContext) OK(r *JSON) error

OK sends a HTTP response with status code 200.

func (*CreateQuoteContext) Unauthorized

func (ctx *CreateQuoteContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type CreateQuotePayload

type CreateQuotePayload struct {
	Name  string `form:"Name" json:"Name" xml:"Name"`
	Quote string `form:"Quote" json:"Quote" xml:"Quote"`
}

CreateQuotePayload is the quote create action payload.

func (*CreateQuotePayload) Validate

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

Validate runs the validation rules defined in the design.

type JSON

type JSON struct {
	// Quote
	Quotes []*Quote `form:"Quotes,omitempty" json:"Quotes,omitempty" xml:"Quotes,omitempty"`
}

A quote from the user database (default view)

Identifier: application/json; view=default

type ListByIDQuoteContext

type ListByIDQuoteContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	UserID string
}

ListByIDQuoteContext provides the quote list by ID action context.

func NewListByIDQuoteContext

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

NewListByIDQuoteContext parses the incoming request URL and body, performs validations and creates the context used by the quote controller list by ID action.

func (*ListByIDQuoteContext) NotFound

func (ctx *ListByIDQuoteContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ListByIDQuoteContext) OK

func (ctx *ListByIDQuoteContext) OK(r *JSON) error

OK sends a HTTP response with status code 200.

func (*ListByIDQuoteContext) Unauthorized

func (ctx *ListByIDQuoteContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type ListQuoteContext

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

ListQuoteContext provides the quote list action context.

func NewListQuoteContext

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

NewListQuoteContext parses the incoming request URL and body, performs validations and creates the context used by the quote controller list action.

func (*ListQuoteContext) OK

func (ctx *ListQuoteContext) OK(r *JSON) error

OK sends a HTTP response with status code 200.

func (*ListQuoteContext) Unauthorized

func (ctx *ListQuoteContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type LoginQuoteContext

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

LoginQuoteContext provides the quote login action context.

func NewLoginQuoteContext

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

NewLoginQuoteContext parses the incoming request URL and body, performs validations and creates the context used by the quote controller login action.

func (*LoginQuoteContext) NoContent

func (ctx *LoginQuoteContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*LoginQuoteContext) Unauthorized

func (ctx *LoginQuoteContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type Quote

type Quote struct {
	// ID of the user
	ID *int `form:"ID,omitempty" json:"ID,omitempty" xml:"ID,omitempty"`
	// User ID of quoter
	Name *string `form:"Name,omitempty" json:"Name,omitempty" xml:"Name,omitempty"`
	// The actual quotes of the quoter
	Quote *string `form:"Quote,omitempty" json:"Quote,omitempty" xml:"Quote,omitempty"`
}

All quotes for a given user ID

type QuoteController

type QuoteController interface {
	goa.Muxer
	Create(*CreateQuoteContext) error
	List(*ListQuoteContext) error
	ListByID(*ListByIDQuoteContext) error
	Login(*LoginQuoteContext) error
}

QuoteController is the controller interface for the Quote actions.

type QuotePayload

type QuotePayload struct {
	Name  *string `form:"Name,omitempty" json:"Name,omitempty" xml:"Name,omitempty"`
	Quote *string `form:"Quote,omitempty" json:"Quote,omitempty" xml:"Quote,omitempty"`
}

QuotePayload user type.

func (*QuotePayload) Validate

func (ut *QuotePayload) Validate() (err error)

Validate validates the QuotePayload type instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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