app

package
v0.0.0-...-2469c04 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountJsController

func MountJsController(service *goa.Service, ctrl JsController)

MountJsController "mounts" a Js resource controller on the given service.

func MountPublicController

func MountPublicController(service *goa.Service, ctrl PublicController)

MountPublicController "mounts" a Public resource controller on the given service.

func MountPurchaseController

func MountPurchaseController(service *goa.Service, ctrl PurchaseController)

MountPurchaseController "mounts" a Purchase 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 PurchaseHref

func PurchaseHref(transactionID interface{}) string

PurchaseHref returns the resource href.

Types

type CreatePurchaseContext

type CreatePurchaseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *PurchasePayload
}

CreatePurchaseContext provides the Purchase create action context.

func NewCreatePurchaseContext

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

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

func (*CreatePurchaseContext) BadRequest

func (ctx *CreatePurchaseContext) BadRequest() error

BadRequest sends a HTTP response with status code 400.

func (*CreatePurchaseContext) Conflict

func (ctx *CreatePurchaseContext) Conflict() error

Conflict sends a HTTP response with status code 409.

func (*CreatePurchaseContext) Created

func (ctx *CreatePurchaseContext) Created() error

Created sends a HTTP response with status code 201.

type JsController

type JsController interface {
	goa.Muxer
	goa.FileServer
}

JsController is the controller interface for the Js actions.

type PublicController

type PublicController interface {
	goa.Muxer
	goa.FileServer
}

PublicController is the controller interface for the Public actions.

type Purchase

type Purchase struct {
	// API href of Purchase
	Href string `json:"href"`
	// Operation reference code
	Locator string `bson:"locator,omitempty" json:"locator"`
	// Total amount paid
	PurchaseValue float64 `bson:"purchase_value,omitempty" json:"purchase_value"`
	// Purchase status
	Status string `bson:"status,omitempty" json:"status"`
	// Unique transaction identifier
	TransactionID string `bson:"_id,omitempty" json:"transaction_id"`
}

Purchase media type (default view)

Identifier: application/json; view=default

func (*Purchase) Validate

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

Validate validates the Purchase media type instance.

type PurchaseController

type PurchaseController interface {
	goa.Muxer
	Create(*CreatePurchaseContext) error
	Show(*ShowPurchaseContext) error
}

PurchaseController is the controller interface for the Purchase actions.

type PurchasePayload

type PurchasePayload struct {
	ID *bson.ObjectId `bson:"_id,omitempty"`
	// Operation reference code
	Locator string `bson:"locator,omitempty" json:"locator"`
	// Total amount paid
	PurchaseValue float64 `bson:"purchase_value,omitempty" json:"purchase_value"`
	Status        *string `bson:"status,omitempty" json:"status"`
}

Detailed information regarding a POS purchase operation

func (*PurchasePayload) Validate

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

Validate validates the PurchasePayload type instance.

type ShowPurchaseContext

type ShowPurchaseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	TransactionID string
}

ShowPurchaseContext provides the Purchase show action context.

func NewShowPurchaseContext

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

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

func (*ShowPurchaseContext) BadRequest

func (ctx *ShowPurchaseContext) BadRequest() error

BadRequest sends a HTTP response with status code 400.

func (*ShowPurchaseContext) NotFound

func (ctx *ShowPurchaseContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowPurchaseContext) OK

func (ctx *ShowPurchaseContext) OK(r *Purchase) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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