app

package
v0.0.0-...-3c3b521 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CourseHref

func CourseHref(id interface{}) string

CourseHref returns the resource href.

func MountCourseController

func MountCourseController(service *goa.Service, ctrl CourseController)

MountCourseController "mounts" a Course resource controller on the given service.

func MountRegistrationController

func MountRegistrationController(service *goa.Service, ctrl RegistrationController)

MountRegistrationController "mounts" a Registration resource controller on the given service.

func RegistrationHref

func RegistrationHref(id interface{}) string

RegistrationHref returns the resource href.

Types

type Address

type Address struct {
	// City
	City string `json:"city" xml:"city" form:"city"`
	// Street number
	Number int `json:"number" xml:"number" form:"number"`
	// US State Code
	State string `json:"state" xml:"state" form:"state"`
	// Street name
	Street string `json:"street" xml:"street" form:"street"`
	// US Zip code
	Zip int `json:"zip" xml:"zip" form:"zip"`
}

Address is a street address

func (*Address) Validate

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

Validate validates the Address type instance.

type CourseController

type CourseController interface {
	goa.Muxer
	Create(*CreateCourseContext) error
	Delete(*DeleteCourseContext) error
	Show(*ShowCourseContext) error
}

CourseController is the controller interface for the Course actions.

type CourseMedia

type CourseMedia struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime time.Time `json:"end_time" xml:"end_time" form:"end_time"`
	// Course href
	Href string `json:"href" xml:"href" form:"href"`
	// Course identifier
	ID int `json:"id" xml:"id" form:"id"`
	// Course location
	Location string `json:"location" xml:"location" form:"location"`
	// Course name
	Name string `json:"name" xml:"name" form:"name"`
	// Course start date/time
	StartTime time.Time `json:"start_time" xml:"start_time" form:"start_time"`
}

CourseMedia media type.

Identifier: application/vnd.goworkshop.course+json

func (*CourseMedia) Validate

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

Validate validates the CourseMedia media type instance.

type CourseMediaLink struct {
	// Course href
	Href string `json:"href" xml:"href" form:"href"`
	// Course identifier
	ID int `json:"id" xml:"id" form:"id"`
}

CourseMediaLink media type.

Identifier: application/vnd.goworkshop.course+json

func (*CourseMediaLink) Validate

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

Validate validates the CourseMediaLink media type instance.

type CoursePatchPayload

type CoursePatchPayload struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime time.Time `json:"end_time" xml:"end_time" form:"end_time"`
	// Course location
	Location string `json:"location" xml:"location" form:"location"`
	// Course name
	Name string `json:"name" xml:"name" form:"name"`
	// Course start date/time
	StartTime time.Time `json:"start_time" xml:"start_time" form:"start_time"`
}

CoursePayload is the type used to create courses

func (*CoursePatchPayload) Validate

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

Validate validates the CoursePatchPayload type instance.

type CreateCourseContext

type CreateCourseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *CreateCoursePayload
}

CreateCourseContext provides the course create action context.

func NewCreateCourseContext

func NewCreateCourseContext(ctx context.Context, service *goa.Service) (*CreateCourseContext, error)

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

func (*CreateCourseContext) BadRequest

func (ctx *CreateCourseContext) BadRequest(r *goa.Error) error

BadRequest sends a HTTP response with status code 400.

func (*CreateCourseContext) Created

func (ctx *CreateCourseContext) Created(r *CourseMedia) error

Created sends a HTTP response with status code 201.

type CreateCoursePayload

type CreateCoursePayload struct {
	// Course description
	Description *string `json:"description,omitempty" xml:"description,omitempty" form:"description,omitempty"`
	// Course end date/time
	EndTime time.Time `json:"end_time" xml:"end_time" form:"end_time"`
	// Course location
	Location string `json:"location" xml:"location" form:"location"`
	// Course name
	Name string `json:"name" xml:"name" form:"name"`
	// Course start date/time
	StartTime time.Time `json:"start_time" xml:"start_time" form:"start_time"`
}

CreateCoursePayload is the course create action payload.

func (*CreateCoursePayload) Validate

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

Validate runs the validation rules defined in the design.

type CreateRegistrationContext

type CreateRegistrationContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *CreateRegistrationPayload
}

CreateRegistrationContext provides the registration create action context.

func NewCreateRegistrationContext

func NewCreateRegistrationContext(ctx context.Context, service *goa.Service) (*CreateRegistrationContext, error)

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

func (*CreateRegistrationContext) BadRequest

func (ctx *CreateRegistrationContext) BadRequest(r *goa.Error) error

BadRequest sends a HTTP response with status code 400.

func (*CreateRegistrationContext) Created

Created sends a HTTP response with status code 201.

type CreateRegistrationPayload

type CreateRegistrationPayload struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// The href to the course resource that describes the course being taught
	CourseHref string `json:"course_href" xml:"course_href" form:"course_href"`
	// Attendee first name
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	// Attendee last name
	LastName string `json:"last_name" xml:"last_name" form:"last_name"`
}

CreateRegistrationPayload is the registration create action payload.

func (*CreateRegistrationPayload) Validate

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

Validate runs the validation rules defined in the design.

type DeleteCourseContext

type DeleteCourseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID int
}

DeleteCourseContext provides the course delete action context.

func NewDeleteCourseContext

func NewDeleteCourseContext(ctx context.Context, service *goa.Service) (*DeleteCourseContext, error)

NewDeleteCourseContext parses the incoming request URL and body, performs validations and creates the context used by the course controller delete action.

func (*DeleteCourseContext) BadRequest

func (ctx *DeleteCourseContext) BadRequest(r *goa.Error) error

BadRequest sends a HTTP response with status code 400.

func (*DeleteCourseContext) NoContent

func (ctx *DeleteCourseContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteCourseContext) NotFound

func (ctx *DeleteCourseContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type ListRegistrationContext

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

ListRegistrationContext provides the registration list action context.

func NewListRegistrationContext

func NewListRegistrationContext(ctx context.Context, service *goa.Service) (*ListRegistrationContext, error)

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

func (*ListRegistrationContext) OK

OK sends a HTTP response with status code 200.

type RegistrationController

type RegistrationController interface {
	goa.Muxer
	Create(*CreateRegistrationContext) error
	List(*ListRegistrationContext) error
	Show(*ShowRegistrationContext) error
}

RegistrationController is the controller interface for the Registration actions.

type RegistrationMedia

type RegistrationMedia struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// Attendee first name
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	// Registration href
	Href string `json:"href" xml:"href" form:"href"`
	// Registration identifier
	ID int `json:"id" xml:"id" form:"id"`
	// Attendee last name
	LastName string `json:"last_name" xml:"last_name" form:"last_name"`
	// Links to related resources
	Links *RegistrationMediaLinks `json:"links,omitempty" xml:"links,omitempty" form:"links,omitempty"`
}

RegistrationMedia media type.

Identifier: application/vnd.goworkshop.registration+json

func (*RegistrationMedia) Validate

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

Validate validates the RegistrationMedia media type instance.

type RegistrationMediaCollection

type RegistrationMediaCollection []*RegistrationMedia

RegistrationMediaCollection media type is a collection of RegistrationMedia.

Identifier: application/vnd.goworkshop.registration+json; type=collection

func (RegistrationMediaCollection) Validate

func (mt RegistrationMediaCollection) Validate() (err error)

Validate validates the RegistrationMediaCollection media type instance.

type RegistrationMediaLinks struct {
	Course *CourseMediaLink `json:"course,omitempty" xml:"course,omitempty" form:"course,omitempty"`
}

RegistrationMediaLinks contains links to related resources of RegistrationMedia.

func (*RegistrationMediaLinks) Validate

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

Validate validates the RegistrationMediaLinks type instance.

type RegistrationMediaLinksArray

type RegistrationMediaLinksArray []*RegistrationMediaLinks

RegistrationMediaLinksArray contains links to related resources of RegistrationMediaCollection.

func (RegistrationMediaLinksArray) Validate

func (ut RegistrationMediaLinksArray) Validate() (err error)

Validate validates the RegistrationMediaLinksArray type instance.

type RegistrationPayload

type RegistrationPayload struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// The href to the course resource that describes the course being taught
	CourseHref string `json:"course_href" xml:"course_href" form:"course_href"`
	// Attendee first name
	FirstName string `json:"first_name" xml:"first_name" form:"first_name"`
	// Attendee last name
	LastName string `json:"last_name" xml:"last_name" form:"last_name"`
}

RegistrationPayload is the type used to create registrations

func (*RegistrationPayload) Validate

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

Validate validates the RegistrationPayload type instance.

type ShowCourseContext

type ShowCourseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID int
}

ShowCourseContext provides the course show action context.

func NewShowCourseContext

func NewShowCourseContext(ctx context.Context, service *goa.Service) (*ShowCourseContext, error)

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

func (*ShowCourseContext) BadRequest

func (ctx *ShowCourseContext) BadRequest(r *goa.Error) error

BadRequest sends a HTTP response with status code 400.

func (*ShowCourseContext) NotFound

func (ctx *ShowCourseContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowCourseContext) OK

func (ctx *ShowCourseContext) OK(r *CourseMedia) error

OK sends a HTTP response with status code 200.

type ShowRegistrationContext

type ShowRegistrationContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID int
}

ShowRegistrationContext provides the registration show action context.

func NewShowRegistrationContext

func NewShowRegistrationContext(ctx context.Context, service *goa.Service) (*ShowRegistrationContext, error)

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

func (*ShowRegistrationContext) BadRequest

func (ctx *ShowRegistrationContext) BadRequest(r *goa.Error) error

BadRequest sends a HTTP response with status code 400.

func (*ShowRegistrationContext) NotFound

func (ctx *ShowRegistrationContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowRegistrationContext) 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