app

package
v0.0.0-...-a2b2d1c Latest Latest
Warning

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

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

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 MountSuggestionController

func MountSuggestionController(service *goa.Service, ctrl SuggestionController)

MountSuggestionController "mounts" a Suggestion 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 *Quotes) 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 {
	// ID of the user
	ID *int `form:"ID,omitempty" json:"ID,omitempty" xml:"ID,omitempty"`
	// User ID of quoter
	Name string `form:"Name" json:"Name" xml:"Name"`
	// The actual quotes of the quoter
	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 CreateSuggestionContext

type CreateSuggestionContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *CreateSuggestionPayload
}

CreateSuggestionContext provides the suggestion create action context.

func NewCreateSuggestionContext

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

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

func (*CreateSuggestionContext) NoContent

func (ctx *CreateSuggestionContext) NoContent() error

NoContent sends a HTTP response with status code 204.

type CreateSuggestionPayload

type CreateSuggestionPayload struct {
	// The ID of the show
	ShowID string `form:"ShowID" json:"ShowID" xml:"ShowID"`
	// Identity of suggester
	Suggester string `form:"Suggester" json:"Suggester" xml:"Suggester"`
	// The suggested title
	Title string `form:"Title" json:"Title" xml:"Title"`
}

CreateSuggestionPayload is the suggestion create action payload.

func (*CreateSuggestionPayload) Validate

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

Validate runs the validation rules defined in the design.

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 *Quote) error

OK sends a HTTP response with status code 200.

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 *Quotes) 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 ListSuggestionContext

type ListSuggestionContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ShowID string
}

ListSuggestionContext provides the suggestion list action context.

func NewListSuggestionContext

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

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

func (*ListSuggestionContext) NotFound

func (ctx *ListSuggestionContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ListSuggestionContext) OK

OK sends a HTTP response with status code 200.

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 (default view)

Identifier: vnd.application.io/quote; view=default

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 Quotes

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

A quote from the user database (default view)

Identifier: vnd.application.io/quotes; view=default

type Suggestion

type Suggestion struct {
	// The ID of the show
	ShowID *string `form:"ShowID,omitempty" json:"ShowID,omitempty" xml:"ShowID,omitempty"`
	// Identity of suggester
	Suggester *string `form:"Suggester,omitempty" json:"Suggester,omitempty" xml:"Suggester,omitempty"`
	// The suggested title
	Title *string `form:"Title,omitempty" json:"Title,omitempty" xml:"Title,omitempty"`
}

All suggestions for a given user ID

type SuggestionController

type SuggestionController interface {
	goa.Muxer
	Create(*CreateSuggestionContext) error
	List(*ListSuggestionContext) error
}

SuggestionController is the controller interface for the Suggestion actions.

type Suggestions

type Suggestions struct {
	// Suggestion
	Suggestions []*Suggestion `form:"Suggestions,omitempty" json:"Suggestions,omitempty" xml:"Suggestions,omitempty"`
}

Suggestions media type (default view)

Identifier: vnd.application.io/suggestions; view=default

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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