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 MountPublicController

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

MountPublicController "mounts" a Public 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 MountSessionController

func MountSessionController(service *goa.Service, ctrl SessionController)

MountSessionController "mounts" a Session resource controller on the given service.

func NewBasicAuthSecurity

func NewBasicAuthSecurity() *goa.BasicAuthSecurity

NewBasicAuthSecurity creates a BasicAuth security definition.

func NewJWTAuthSecurity

func NewJWTAuthSecurity() *goa.JWTSecurity

NewJWTAuthSecurity creates a JWTAuth security definition.

func RegistrationHref

func RegistrationHref(id interface{}) string

RegistrationHref returns the resource href.

func UseBasicAuthMiddleware

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

UseBasicAuthMiddleware mounts the BasicAuth auth middleware onto the service.

func UseJWTAuthMiddleware

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

UseJWTAuthMiddleware mounts the JWTAuth auth middleware onto the service.

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
	List(*ListCourseContext) error
	Patch(*PatchCourseContext) 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 CourseMediaCollection

type CourseMediaCollection []*CourseMedia

CourseMediaCollection media type is a collection of CourseMedia.

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

func (CourseMediaCollection) Validate

func (mt CourseMediaCollection) Validate() (err error)

Validate validates the CourseMediaCollection 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 CourseMediaLinkCollection

type CourseMediaLinkCollection []*CourseMediaLink

CourseMediaLinkCollection media type is a collection of CourseMediaLink.

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

func (CourseMediaLinkCollection) Validate

func (mt CourseMediaLinkCollection) Validate() (err error)

Validate validates the CourseMediaLinkCollection 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,omitempty" xml:"end_time,omitempty" form:"end_time,omitempty"`
	// Course location
	Location *string `json:"location,omitempty" xml:"location,omitempty" form:"location,omitempty"`
	// Course start date/time
	StartTime *time.Time `json:"start_time,omitempty" xml:"start_time,omitempty" form:"start_time,omitempty"`
}

CoursePatchPayload is the type used to patch courses

func (*CoursePatchPayload) Validate

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

Validate validates the CoursePatchPayload type instance.

type CoursePayload

type CoursePayload 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 (*CoursePayload) Validate

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

Validate validates the CoursePayload 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.

func (*CreateCourseContext) Unauthorized

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

Unauthorized sends a HTTP response with status code 401.

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.

func (*CreateRegistrationContext) CreatedExtended

CreatedExtended sends a HTTP response with status code 201.

func (*CreateRegistrationContext) Unauthorized

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

Unauthorized sends a HTTP response with status code 401.

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) 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.

func (*DeleteCourseContext) Unauthorized

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

Unauthorized sends a HTTP response with status code 401.

type ListCourseContext

type ListCourseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Name *string
}

ListCourseContext provides the course list action context.

func NewListCourseContext

func NewListCourseContext(ctx context.Context, service *goa.Service) (*ListCourseContext, error)

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

func (*ListCourseContext) OK

OK sends a HTTP response with status code 200.

func (*ListCourseContext) Unauthorized

func (ctx *ListCourseContext) Unauthorized(r *goa.Error) error

Unauthorized sends a HTTP response with status code 401.

type ListRegistrationContext

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

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.

func (*ListRegistrationContext) OKExtended

OKExtended sends a HTTP response with status code 200.

func (*ListRegistrationContext) Unauthorized

func (ctx *ListRegistrationContext) Unauthorized(r *goa.Error) error

Unauthorized sends a HTTP response with status code 401.

type LoginSessionContext

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

LoginSessionContext provides the session login action context.

func NewLoginSessionContext

func NewLoginSessionContext(ctx context.Context, service *goa.Service) (*LoginSessionContext, error)

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

func (*LoginSessionContext) NoContent

func (ctx *LoginSessionContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*LoginSessionContext) Unauthorized

func (ctx *LoginSessionContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type PatchCourseContext

type PatchCourseContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID      int
	Payload *PatchCoursePayload
}

PatchCourseContext provides the course patch action context.

func NewPatchCourseContext

func NewPatchCourseContext(ctx context.Context, service *goa.Service) (*PatchCourseContext, error)

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

func (*PatchCourseContext) BadRequest

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

BadRequest sends a HTTP response with status code 400.

func (*PatchCourseContext) NoContent

func (ctx *PatchCourseContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*PatchCourseContext) NotFound

func (ctx *PatchCourseContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*PatchCourseContext) Unauthorized

func (ctx *PatchCourseContext) Unauthorized(r *goa.Error) error

Unauthorized sends a HTTP response with status code 401.

type PatchCoursePayload

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

PatchCoursePayload is the course patch action payload.

func (*PatchCoursePayload) Validate

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

Validate runs the validation rules defined in the design.

type PatchRegistrationContext

type PatchRegistrationContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID      int
	Payload *PatchRegistrationPayload
}

PatchRegistrationContext provides the registration patch action context.

func NewPatchRegistrationContext

func NewPatchRegistrationContext(ctx context.Context, service *goa.Service) (*PatchRegistrationContext, error)

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

func (*PatchRegistrationContext) BadRequest

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

BadRequest sends a HTTP response with status code 400.

func (*PatchRegistrationContext) NoContent

func (ctx *PatchRegistrationContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*PatchRegistrationContext) NotFound

func (ctx *PatchRegistrationContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*PatchRegistrationContext) Unauthorized

func (ctx *PatchRegistrationContext) Unauthorized(r *goa.Error) error

Unauthorized sends a HTTP response with status code 401.

type PatchRegistrationPayload

type PatchRegistrationPayload struct {
	// Attendee address
	Address *Address `json:"address,omitempty" xml:"address,omitempty" form:"address,omitempty"`
	// Attendee first name
	FirstName *string `json:"first_name,omitempty" xml:"first_name,omitempty" form:"first_name,omitempty"`
	// Attendee last name
	LastName *string `json:"last_name,omitempty" xml:"last_name,omitempty" form:"last_name,omitempty"`
}

PatchRegistrationPayload is the registration patch action payload.

func (*PatchRegistrationPayload) Validate

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

Validate runs the validation rules defined in the design.

type PublicController

type PublicController interface {
	goa.Muxer
	goa.FileServer
}

PublicController is the controller interface for the Public actions.

type RegistrationController

type RegistrationController interface {
	goa.Muxer
	Create(*CreateRegistrationContext) error
	List(*ListRegistrationContext) error
	Patch(*PatchRegistrationContext) 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 RegistrationMediaExtended

type RegistrationMediaExtended struct {
	// Attendee address
	Address *Address `json:"address" xml:"address" form:"address"`
	// Course being taught
	Course *CourseMedia `json:"course" xml:"course" form:"course"`
	// 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"`
}

RegistrationMediaExtended media type.

Identifier: application/vnd.goworkshop.registration+json

func (*RegistrationMediaExtended) Validate

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

Validate validates the RegistrationMediaExtended media type instance.

type RegistrationMediaExtendedCollection

type RegistrationMediaExtendedCollection []*RegistrationMediaExtended

RegistrationMediaExtendedCollection media type is a collection of RegistrationMediaExtended.

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

func (RegistrationMediaExtendedCollection) Validate

func (mt RegistrationMediaExtendedCollection) Validate() (err error)

Validate validates the RegistrationMediaExtendedCollection 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 RegistrationPatchPayload

type RegistrationPatchPayload struct {
	// Attendee address
	Address *Address `json:"address,omitempty" xml:"address,omitempty" form:"address,omitempty"`
	// Attendee first name
	FirstName *string `json:"first_name,omitempty" xml:"first_name,omitempty" form:"first_name,omitempty"`
	// Attendee last name
	LastName *string `json:"last_name,omitempty" xml:"last_name,omitempty" form:"last_name,omitempty"`
}

RegistrationPatchPayload is the type used to patch registrations

func (*RegistrationPatchPayload) Validate

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

Validate validates the RegistrationPatchPayload 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 SessionController

type SessionController interface {
	goa.Muxer
	Login(*LoginSessionContext) error
}

SessionController is the controller interface for the Session actions.

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.

func (*ShowCourseContext) Unauthorized

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

Unauthorized sends a HTTP response with status code 401.

type ShowRegistrationContext

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

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.

func (*ShowRegistrationContext) OKExtended

OKExtended sends a HTTP response with status code 200.

func (*ShowRegistrationContext) Unauthorized

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

Unauthorized sends a HTTP response with status code 401.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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