app

package
v0.0.0-...-b8fb0c1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalAuthorize

func MarshalAuthorize(source *Authorize, inErr error) (target map[string]interface{}, err error)

MarshalAuthorize validates and renders an instance of Authorize into a interface{} using view "default".

func MarshalLogin

func MarshalLogin(source *Login, inErr error) (target map[string]interface{}, err error)

MarshalLogin validates and renders an instance of Login into a interface{} using view "default".

func MarshalProposal

func MarshalProposal(source *Proposal, inErr error) (target map[string]interface{}, err error)

MarshalProposal validates and renders an instance of Proposal into a interface{} using view "default".

func MarshalProposalCollection

func MarshalProposalCollection(source ProposalCollection, inErr error) (target []map[string]interface{}, err error)

MarshalProposalCollection validates and renders an instance of ProposalCollection into a interface{} using view "default".

func MarshalProposalLink(source *Proposal, inErr error) (target map[string]interface{}, err error)

MarshalProposalLink validates and renders an instance of Proposal into a interface{} using view "link".

func MarshalProposalModel

func MarshalProposalModel(source *ProposalModel, inErr error) (target map[string]interface{}, err error)

MarshalProposalModel validates and renders an instance of ProposalModel into a interface{}

func MarshalReview

func MarshalReview(source *Review, inErr error) (target map[string]interface{}, err error)

MarshalReview validates and renders an instance of Review into a interface{} using view "default".

func MarshalReviewCollection

func MarshalReviewCollection(source ReviewCollection, inErr error) (target []map[string]interface{}, err error)

MarshalReviewCollection validates and renders an instance of ReviewCollection into a interface{} using view "default".

func MarshalReviewLink(source *Review, inErr error) (target map[string]interface{}, err error)

MarshalReviewLink validates and renders an instance of Review into a interface{} using view "link".

func MarshalReviewModel

func MarshalReviewModel(source *ReviewModel, inErr error) (target map[string]interface{}, err error)

MarshalReviewModel validates and renders an instance of ReviewModel into a interface{}

func MarshalUser

func MarshalUser(source *User, inErr error) (target map[string]interface{}, err error)

MarshalUser validates and renders an instance of User into a interface{} using view "default".

func MarshalUserCollection

func MarshalUserCollection(source UserCollection, inErr error) (target []map[string]interface{}, err error)

MarshalUserCollection validates and renders an instance of UserCollection into a interface{} using view "default".

func MarshalUserLink(source *User, inErr error) (target map[string]interface{}, err error)

MarshalUserLink validates and renders an instance of User into a interface{} using view "link".

func MarshalUserModel

func MarshalUserModel(source *UserModel, inErr error) (target map[string]interface{}, err error)

MarshalUserModel validates and renders an instance of UserModel into a interface{}

func MountAuthController

func MountAuthController(service goa.Service, ctrl AuthController)

MountAuthController "mounts" a Auth resource controller on the given service.

func MountProposalController

func MountProposalController(service goa.Service, ctrl ProposalController)

MountProposalController "mounts" a Proposal resource controller on the given service.

func MountReviewController

func MountReviewController(service goa.Service, ctrl ReviewController)

MountReviewController "mounts" a Review resource controller on the given service.

func MountUserController

func MountUserController(service goa.Service, ctrl UserController)

MountUserController "mounts" a User resource controller on the given service.

func ProposalHref

func ProposalHref(userID, proposalID interface{}) string

ProposalHref returns the resource href.

func ReviewHref

func ReviewHref(userID, proposalID, reviewID interface{}) string

ReviewHref returns the resource href.

func UserHref

func UserHref(userID interface{}) string

UserHref returns the resource href.

Types

type AuthController

type AuthController interface {
	goa.Controller
	Callback(*CallbackAuthContext) error
	Oauth(*OauthAuthContext) error
	Refresh(*RefreshAuthContext) error
	Token(*TokenAuthContext) error
}

AuthController is the controller interface for the Auth actions.

type Authorize

type Authorize struct {
	// access token
	AccessToken string
	// Time to expiration in seconds
	ExpiresIn int
	// type of token
	TokenType string
}

Token authorization response Identifier: application/vnd.authorize+json

func LoadAuthorize

func LoadAuthorize(raw interface{}) (res *Authorize, err error)

LoadAuthorize loads raw data into an instance of Authorize running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalAuthorize

func UnmarshalAuthorize(source interface{}, inErr error) (target *Authorize, err error)

UnmarshalAuthorize unmarshals and validates a raw interface{} into an instance of Authorize

func (*Authorize) Dump

func (mt *Authorize) Dump() (res map[string]interface{}, err error)

Dump produces raw data from an instance of Authorize running all the validations. See LoadAuthorize for the definition of raw data.

func (*Authorize) Validate

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

Validate validates the media type instance.

type CallbackAuthContext

type CallbackAuthContext struct {
	*goa.Context
	Provider string
}

CallbackAuthContext provides the auth callback action context.

func NewCallbackAuthContext

func NewCallbackAuthContext(c *goa.Context) (*CallbackAuthContext, error)

NewCallbackAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller callback action.

func (*CallbackAuthContext) OK

func (ctx *CallbackAuthContext) OK(resp *Authorize) error

OK sends a HTTP response with status code 200.

type CreateProposalContext

type CreateProposalContext struct {
	*goa.Context
	UserID  int
	Payload *CreateProposalPayload
}

CreateProposalContext provides the proposal create action context.

func NewCreateProposalContext

func NewCreateProposalContext(c *goa.Context) (*CreateProposalContext, error)

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

func (*CreateProposalContext) Created

func (ctx *CreateProposalContext) Created() error

Created sends a HTTP response with status code 201.

type CreateProposalPayload

type CreateProposalPayload struct {
	Abstract  string
	Detail    string
	Firstname string
	Title     string
	Withdrawn bool
}

CreateProposalPayload is the proposal create action payload.

func NewCreateProposalPayload

func NewCreateProposalPayload(raw interface{}) (p *CreateProposalPayload, err error)

NewCreateProposalPayload instantiates a CreateProposalPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalCreateProposalPayload

func UnmarshalCreateProposalPayload(source interface{}, inErr error) (target *CreateProposalPayload, err error)

UnmarshalCreateProposalPayload unmarshals and validates a raw interface{} into an instance of CreateProposalPayload

type CreateReviewContext

type CreateReviewContext struct {
	*goa.Context
	ProposalID int
	UserID     int
	Payload    *CreateReviewPayload
}

CreateReviewContext provides the review create action context.

func NewCreateReviewContext

func NewCreateReviewContext(c *goa.Context) (*CreateReviewContext, error)

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

func (*CreateReviewContext) Created

func (ctx *CreateReviewContext) Created() error

Created sends a HTTP response with status code 201.

type CreateReviewPayload

type CreateReviewPayload struct {
	Comment string
	Rating  int
}

CreateReviewPayload is the review create action payload.

func NewCreateReviewPayload

func NewCreateReviewPayload(raw interface{}) (p *CreateReviewPayload, err error)

NewCreateReviewPayload instantiates a CreateReviewPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalCreateReviewPayload

func UnmarshalCreateReviewPayload(source interface{}, inErr error) (target *CreateReviewPayload, err error)

UnmarshalCreateReviewPayload unmarshals and validates a raw interface{} into an instance of CreateReviewPayload

type CreateUserContext

type CreateUserContext struct {
	*goa.Context
	Payload *CreateUserPayload
}

CreateUserContext provides the user create action context.

func NewCreateUserContext

func NewCreateUserContext(c *goa.Context) (*CreateUserContext, error)

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

func (*CreateUserContext) Created

func (ctx *CreateUserContext) Created() error

Created sends a HTTP response with status code 201.

type CreateUserPayload

type CreateUserPayload struct {
	Bio       string
	City      string
	Country   string
	Email     string
	Firstname string
	Lastname  string
	Role      string
	State     string
}

CreateUserPayload is the user create action payload.

func NewCreateUserPayload

func NewCreateUserPayload(raw interface{}) (p *CreateUserPayload, err error)

NewCreateUserPayload instantiates a CreateUserPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalCreateUserPayload

func UnmarshalCreateUserPayload(source interface{}, inErr error) (target *CreateUserPayload, err error)

UnmarshalCreateUserPayload unmarshals and validates a raw interface{} into an instance of CreateUserPayload

type DeleteProposalContext

type DeleteProposalContext struct {
	*goa.Context
	ProposalID int
	UserID     int
}

DeleteProposalContext provides the proposal delete action context.

func NewDeleteProposalContext

func NewDeleteProposalContext(c *goa.Context) (*DeleteProposalContext, error)

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

func (*DeleteProposalContext) NoContent

func (ctx *DeleteProposalContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteProposalContext) NotFound

func (ctx *DeleteProposalContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type DeleteReviewContext

type DeleteReviewContext struct {
	*goa.Context
	ProposalID int
	ReviewID   int
	UserID     int
}

DeleteReviewContext provides the review delete action context.

func NewDeleteReviewContext

func NewDeleteReviewContext(c *goa.Context) (*DeleteReviewContext, error)

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

func (*DeleteReviewContext) NoContent

func (ctx *DeleteReviewContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteReviewContext) NotFound

func (ctx *DeleteReviewContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type DeleteUserContext

type DeleteUserContext struct {
	*goa.Context
	UserID int
}

DeleteUserContext provides the user delete action context.

func NewDeleteUserContext

func NewDeleteUserContext(c *goa.Context) (*DeleteUserContext, error)

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

func (*DeleteUserContext) NoContent

func (ctx *DeleteUserContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteUserContext) NotFound

func (ctx *DeleteUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type ListProposalContext

type ListProposalContext struct {
	*goa.Context
	UserID int
}

ListProposalContext provides the proposal list action context.

func NewListProposalContext

func NewListProposalContext(c *goa.Context) (*ListProposalContext, error)

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

func (*ListProposalContext) OK

OK sends a HTTP response with status code 200.

type ListReviewContext

type ListReviewContext struct {
	*goa.Context
	ProposalID int
	UserID     int
}

ListReviewContext provides the review list action context.

func NewListReviewContext

func NewListReviewContext(c *goa.Context) (*ListReviewContext, error)

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

func (*ListReviewContext) OK

OK sends a HTTP response with status code 200.

type ListUserContext

type ListUserContext struct {
	*goa.Context
}

ListUserContext provides the user list action context.

func NewListUserContext

func NewListUserContext(c *goa.Context) (*ListUserContext, error)

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

func (*ListUserContext) OK

func (ctx *ListUserContext) OK(resp UserCollection) error

OK sends a HTTP response with status code 200.

type Login

type Login struct {
	// UUID of requesting application
	Application string
	// email
	Email string
	// password
	Password string
}

Login media type Identifier: application/vnd.login+json

func LoadLogin

func LoadLogin(raw interface{}) (res *Login, err error)

LoadLogin loads raw data into an instance of Login running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalLogin

func UnmarshalLogin(source interface{}, inErr error) (target *Login, err error)

UnmarshalLogin unmarshals and validates a raw interface{} into an instance of Login

func (*Login) Dump

func (mt *Login) Dump() (res map[string]interface{}, err error)

Dump produces raw data from an instance of Login running all the validations. See LoadLogin for the definition of raw data.

func (*Login) Validate

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

Validate validates the media type instance.

type OauthAuthContext

type OauthAuthContext struct {
	*goa.Context
	Provider string
}

OauthAuthContext provides the auth oauth action context.

func NewOauthAuthContext

func NewOauthAuthContext(c *goa.Context) (*OauthAuthContext, error)

NewOauthAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller oauth action.

func (*OauthAuthContext) OK

func (ctx *OauthAuthContext) OK(resp *Authorize) error

OK sends a HTTP response with status code 200.

type Proposal

type Proposal struct {
	// Response abstract
	Abstract string
	// Response detail
	Detail string
	// API href of user
	Href string
	// ID of user
	ID int
	// Response title
	Title string
}

A response to a CFP Identifier: application/vnd.proposal+json

func LoadProposal

func LoadProposal(raw interface{}) (res *Proposal, err error)

LoadProposal loads raw data into an instance of Proposal running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalProposal

func UnmarshalProposal(source interface{}, inErr error) (target *Proposal, err error)

UnmarshalProposal unmarshals and validates a raw interface{} into an instance of Proposal

func (*Proposal) Dump

func (mt *Proposal) Dump(view ProposalViewEnum) (res map[string]interface{}, err error)

Dump produces raw data from an instance of Proposal running all the validations. See LoadProposal for the definition of raw data.

func (*Proposal) Validate

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

Validate validates the media type instance.

type ProposalCollection

type ProposalCollection []*Proposal

ProposalCollection media type Identifier: application/vnd.proposal+json; type=collection

func LoadProposalCollection

func LoadProposalCollection(raw interface{}) (res ProposalCollection, err error)

LoadProposalCollection loads raw data into an instance of ProposalCollection running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalProposalCollection

func UnmarshalProposalCollection(source interface{}, inErr error) (target ProposalCollection, err error)

UnmarshalProposalCollection unmarshals and validates a raw interface{} into an instance of ProposalCollection

func (ProposalCollection) Dump

func (mt ProposalCollection) Dump() (res []map[string]interface{}, err error)

Dump produces raw data from an instance of ProposalCollection running all the validations. See LoadProposalCollection for the definition of raw data.

func (ProposalCollection) Validate

func (mt ProposalCollection) Validate() (err error)

Validate validates the media type instance.

type ProposalController

ProposalController is the controller interface for the Proposal actions.

type ProposalModel

type ProposalModel struct {
	Abstract  string
	Detail    string
	Firstname string
	Title     string
	Withdrawn bool
}

ProposalModel type

func UnmarshalProposalModel

func UnmarshalProposalModel(source interface{}, inErr error) (target *ProposalModel, err error)

UnmarshalProposalModel unmarshals and validates a raw interface{} into an instance of ProposalModel

type ProposalViewEnum

type ProposalViewEnum string

Proposal views

const (
	// Proposal default view
	ProposalDefaultView ProposalViewEnum = "default"
	// Proposal link view
	ProposalLinkView ProposalViewEnum = "link"
)

type RefreshAuthContext

type RefreshAuthContext struct {
	*goa.Context
	Payload *RefreshAuthPayload
}

RefreshAuthContext provides the auth refresh action context.

func NewRefreshAuthContext

func NewRefreshAuthContext(c *goa.Context) (*RefreshAuthContext, error)

NewRefreshAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller refresh action.

func (*RefreshAuthContext) Created

func (ctx *RefreshAuthContext) Created(resp *Authorize) error

Created sends a HTTP response with status code 201.

type RefreshAuthPayload

type RefreshAuthPayload struct {
	// UUID of requesting application
	Application string
	// email
	Email string
	// password
	Password string
}

RefreshAuthPayload is the auth refresh action payload.

func NewRefreshAuthPayload

func NewRefreshAuthPayload(raw interface{}) (p *RefreshAuthPayload, err error)

NewRefreshAuthPayload instantiates a RefreshAuthPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalRefreshAuthPayload

func UnmarshalRefreshAuthPayload(source interface{}, inErr error) (target *RefreshAuthPayload, err error)

UnmarshalRefreshAuthPayload unmarshals and validates a raw interface{} into an instance of RefreshAuthPayload

type Review

type Review struct {
	// Review comments
	Comment string
	// API href of user
	Href string
	// ID of user
	ID int
	// Rating of proposal, from 1-5
	Rating int
}

A review is submitted by a reviewer Identifier: application/vnd.review+json

func LoadReview

func LoadReview(raw interface{}) (res *Review, err error)

LoadReview loads raw data into an instance of Review running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalReview

func UnmarshalReview(source interface{}, inErr error) (target *Review, err error)

UnmarshalReview unmarshals and validates a raw interface{} into an instance of Review

func (*Review) Dump

func (mt *Review) Dump(view ReviewViewEnum) (res map[string]interface{}, err error)

Dump produces raw data from an instance of Review running all the validations. See LoadReview for the definition of raw data.

func (*Review) Validate

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

Validate validates the media type instance.

type ReviewCollection

type ReviewCollection []*Review

ReviewCollection media type Identifier: application/vnd.review+json; type=collection

func LoadReviewCollection

func LoadReviewCollection(raw interface{}) (res ReviewCollection, err error)

LoadReviewCollection loads raw data into an instance of ReviewCollection running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalReviewCollection

func UnmarshalReviewCollection(source interface{}, inErr error) (target ReviewCollection, err error)

UnmarshalReviewCollection unmarshals and validates a raw interface{} into an instance of ReviewCollection

func (ReviewCollection) Dump

func (mt ReviewCollection) Dump() (res []map[string]interface{}, err error)

Dump produces raw data from an instance of ReviewCollection running all the validations. See LoadReviewCollection for the definition of raw data.

func (ReviewCollection) Validate

func (mt ReviewCollection) Validate() (err error)

Validate validates the media type instance.

type ReviewController

type ReviewController interface {
	goa.Controller
	Create(*CreateReviewContext) error
	Delete(*DeleteReviewContext) error
	List(*ListReviewContext) error
	Show(*ShowReviewContext) error
	Update(*UpdateReviewContext) error
}

ReviewController is the controller interface for the Review actions.

type ReviewModel

type ReviewModel struct {
	Comment string
	Rating  int
}

ReviewModel type

func UnmarshalReviewModel

func UnmarshalReviewModel(source interface{}, inErr error) (target *ReviewModel, err error)

UnmarshalReviewModel unmarshals and validates a raw interface{} into an instance of ReviewModel

type ReviewViewEnum

type ReviewViewEnum string

Review views

const (
	// Review default view
	ReviewDefaultView ReviewViewEnum = "default"
	// Review link view
	ReviewLinkView ReviewViewEnum = "link"
)

type ShowProposalContext

type ShowProposalContext struct {
	*goa.Context
	ProposalID int
	UserID     int
}

ShowProposalContext provides the proposal show action context.

func NewShowProposalContext

func NewShowProposalContext(c *goa.Context) (*ShowProposalContext, error)

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

func (*ShowProposalContext) NotFound

func (ctx *ShowProposalContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowProposalContext) OK

func (ctx *ShowProposalContext) OK(resp *Proposal, view ProposalViewEnum) error

OK sends a HTTP response with status code 200.

type ShowReviewContext

type ShowReviewContext struct {
	*goa.Context
	ProposalID int
	ReviewID   int
	UserID     int
}

ShowReviewContext provides the review show action context.

func NewShowReviewContext

func NewShowReviewContext(c *goa.Context) (*ShowReviewContext, error)

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

func (*ShowReviewContext) NotFound

func (ctx *ShowReviewContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowReviewContext) OK

func (ctx *ShowReviewContext) OK(resp *Review, view ReviewViewEnum) error

OK sends a HTTP response with status code 200.

type ShowUserContext

type ShowUserContext struct {
	*goa.Context
	UserID int
}

ShowUserContext provides the user show action context.

func NewShowUserContext

func NewShowUserContext(c *goa.Context) (*ShowUserContext, error)

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

func (*ShowUserContext) NotFound

func (ctx *ShowUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowUserContext) OK

func (ctx *ShowUserContext) OK(resp *User, view UserViewEnum) error

OK sends a HTTP response with status code 200.

type TokenAuthContext

type TokenAuthContext struct {
	*goa.Context
	Payload *TokenAuthPayload
}

TokenAuthContext provides the auth token action context.

func NewTokenAuthContext

func NewTokenAuthContext(c *goa.Context) (*TokenAuthContext, error)

NewTokenAuthContext parses the incoming request URL and body, performs validations and creates the context used by the auth controller token action.

func (*TokenAuthContext) Created

func (ctx *TokenAuthContext) Created(resp *Authorize) error

Created sends a HTTP response with status code 201.

type TokenAuthPayload

type TokenAuthPayload struct {
	// UUID of requesting application
	Application string
	// email
	Email string
	// password
	Password string
}

TokenAuthPayload is the auth token action payload.

func NewTokenAuthPayload

func NewTokenAuthPayload(raw interface{}) (p *TokenAuthPayload, err error)

NewTokenAuthPayload instantiates a TokenAuthPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalTokenAuthPayload

func UnmarshalTokenAuthPayload(source interface{}, inErr error) (target *TokenAuthPayload, err error)

UnmarshalTokenAuthPayload unmarshals and validates a raw interface{} into an instance of TokenAuthPayload

type UpdateProposalContext

type UpdateProposalContext struct {
	*goa.Context
	ProposalID int
	UserID     int
	Payload    *UpdateProposalPayload
}

UpdateProposalContext provides the proposal update action context.

func NewUpdateProposalContext

func NewUpdateProposalContext(c *goa.Context) (*UpdateProposalContext, error)

NewUpdateProposalContext parses the incoming request URL and body, performs validations and creates the context used by the proposal controller update action.

func (*UpdateProposalContext) NoContent

func (ctx *UpdateProposalContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateProposalContext) NotFound

func (ctx *UpdateProposalContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type UpdateProposalPayload

type UpdateProposalPayload struct {
	Abstract  string
	Detail    string
	Firstname string
	Title     string
	Withdrawn bool
}

UpdateProposalPayload is the proposal update action payload.

func NewUpdateProposalPayload

func NewUpdateProposalPayload(raw interface{}) (p *UpdateProposalPayload, err error)

NewUpdateProposalPayload instantiates a UpdateProposalPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalUpdateProposalPayload

func UnmarshalUpdateProposalPayload(source interface{}, inErr error) (target *UpdateProposalPayload, err error)

UnmarshalUpdateProposalPayload unmarshals and validates a raw interface{} into an instance of UpdateProposalPayload

type UpdateReviewContext

type UpdateReviewContext struct {
	*goa.Context
	ProposalID int
	ReviewID   int
	UserID     int
	Payload    *UpdateReviewPayload
}

UpdateReviewContext provides the review update action context.

func NewUpdateReviewContext

func NewUpdateReviewContext(c *goa.Context) (*UpdateReviewContext, error)

NewUpdateReviewContext parses the incoming request URL and body, performs validations and creates the context used by the review controller update action.

func (*UpdateReviewContext) NoContent

func (ctx *UpdateReviewContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateReviewContext) NotFound

func (ctx *UpdateReviewContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type UpdateReviewPayload

type UpdateReviewPayload struct {
	Comment string
	Rating  int
}

UpdateReviewPayload is the review update action payload.

func NewUpdateReviewPayload

func NewUpdateReviewPayload(raw interface{}) (p *UpdateReviewPayload, err error)

NewUpdateReviewPayload instantiates a UpdateReviewPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalUpdateReviewPayload

func UnmarshalUpdateReviewPayload(source interface{}, inErr error) (target *UpdateReviewPayload, err error)

UnmarshalUpdateReviewPayload unmarshals and validates a raw interface{} into an instance of UpdateReviewPayload

type UpdateUserContext

type UpdateUserContext struct {
	*goa.Context
	UserID  int
	Payload *UpdateUserPayload
}

UpdateUserContext provides the user update action context.

func NewUpdateUserContext

func NewUpdateUserContext(c *goa.Context) (*UpdateUserContext, error)

NewUpdateUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller update action.

func (*UpdateUserContext) NoContent

func (ctx *UpdateUserContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateUserContext) NotFound

func (ctx *UpdateUserContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type UpdateUserPayload

type UpdateUserPayload struct {
	Bio       string
	City      string
	Country   string
	Email     string
	Firstname string
	Lastname  string
	Role      string
	State     string
}

UpdateUserPayload is the user update action payload.

func NewUpdateUserPayload

func NewUpdateUserPayload(raw interface{}) (p *UpdateUserPayload, err error)

NewUpdateUserPayload instantiates a UpdateUserPayload from a raw request body. It validates each field and returns an error if any validation fails.

func UnmarshalUpdateUserPayload

func UnmarshalUpdateUserPayload(source interface{}, inErr error) (target *UpdateUserPayload, err error)

UnmarshalUpdateUserPayload unmarshals and validates a raw interface{} into an instance of UpdateUserPayload

type User

type User struct {
	// Biography of user
	Bio string
	// City of residence
	City string
	// Country of residence
	Country string
	// Email address of user
	Email string
	// First name of user
	Firstname string
	// API href of user
	Href string
	// ID of user
	ID int
	// Last name of user
	Lastname string
	// State of residence
	State string
}

A user belonging to a tenant account Identifier: application/vnd.user+json

func LoadUser

func LoadUser(raw interface{}) (res *User, err error)

LoadUser loads raw data into an instance of User running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalUser

func UnmarshalUser(source interface{}, inErr error) (target *User, err error)

UnmarshalUser unmarshals and validates a raw interface{} into an instance of User

func (*User) Dump

func (mt *User) Dump(view UserViewEnum) (res map[string]interface{}, err error)

Dump produces raw data from an instance of User running all the validations. See LoadUser for the definition of raw data.

func (*User) Validate

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

Validate validates the media type instance.

type UserCollection

type UserCollection []*User

UserCollection media type Identifier: application/vnd.user+json; type=collection

func LoadUserCollection

func LoadUserCollection(raw interface{}) (res UserCollection, err error)

LoadUserCollection loads raw data into an instance of UserCollection running all the validations. Raw data is defined by data that the JSON unmarshaler would create when unmarshaling into a variable of type interface{}. See https://golang.org/pkg/encoding/json/#Unmarshal for the complete list of supported data types.

func UnmarshalUserCollection

func UnmarshalUserCollection(source interface{}, inErr error) (target UserCollection, err error)

UnmarshalUserCollection unmarshals and validates a raw interface{} into an instance of UserCollection

func (UserCollection) Dump

func (mt UserCollection) Dump() (res []map[string]interface{}, err error)

Dump produces raw data from an instance of UserCollection running all the validations. See LoadUserCollection for the definition of raw data.

func (UserCollection) Validate

func (mt UserCollection) Validate() (err error)

Validate validates the media type instance.

type UserController

type UserController interface {
	goa.Controller
	Create(*CreateUserContext) error
	Delete(*DeleteUserContext) error
	List(*ListUserContext) error
	Show(*ShowUserContext) error
	Update(*UpdateUserContext) error
}

UserController is the controller interface for the User actions.

type UserModel

type UserModel struct {
	Bio       string
	City      string
	Country   string
	Email     string
	Firstname string
	Lastname  string
	Role      string
	State     string
}

UserModel type

func UnmarshalUserModel

func UnmarshalUserModel(source interface{}, inErr error) (target *UserModel, err error)

UnmarshalUserModel unmarshals and validates a raw interface{} into an instance of UserModel

type UserViewEnum

type UserViewEnum string

User views

const (
	// User default view
	UserDefaultView UserViewEnum = "default"
	// User link view
	UserLinkView UserViewEnum = "link"
)

Jump to

Keyboard shortcuts

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