app

package
v0.0.0-...-bc1ff5d Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountHref

func AccountHref(accountID interface{}) string

AccountHref returns the resource href.

func MountAccountController

func MountAccountController(service goa.Service, ctrl AccountController)

MountAccountController "mounts" a Account resource controller on the given service.

func MountSeriesController

func MountSeriesController(service goa.Service, ctrl SeriesController)

MountSeriesController "mounts" a Series 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 SeriesHref

func SeriesHref(accountID, seriesID interface{}) string

SeriesHref returns the resource href.

func UserHref

func UserHref(accountID, userID interface{}) string

UserHref returns the resource href.

Types

type Account

type Account struct {
	// Date of creation
	CreatedAt string
	// Email of account owner
	CreatedBy string
	// API href of account
	Href string
	// ID of account
	ID int
	// Name of account
	Name string
}

A tenant account Identifier: application/vnd.congo.api.account+json

func LoadAccount

func LoadAccount(raw interface{}) (*Account, error)

LoadAccount loads raw data into an instance of Account 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 (*Account) Dump

func (mt *Account) Dump(view AccountViewEnum) (map[string]interface{}, error)

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

func (*Account) Validate

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

Validate validates the media type instance.

type AccountController

type AccountController interface {
	Create(*CreateAccountContext) error
	Delete(*DeleteAccountContext) error
	Show(*ShowAccountContext) error
	Update(*UpdateAccountContext) error
}

AccountController is the controller interface for the Account actions.

type AccountViewEnum

type AccountViewEnum string

object views

const (
	// Account default view
	AccountDefaultView AccountViewEnum = "default"
	// Account link view
	AccountLinkView AccountViewEnum = "link"
)

type CreateAccountContext

type CreateAccountContext struct {
	*goa.Context
	Payload *CreateAccountPayload
}

CreateAccountContext provides the account create action context.

func NewCreateAccountContext

func NewCreateAccountContext(c *goa.Context) (*CreateAccountContext, error)

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

func (*CreateAccountContext) Created

func (ctx *CreateAccountContext) Created() error

Created sends a HTTP response with status code 201.

type CreateAccountPayload

type CreateAccountPayload struct {
	// Name of account
	Name string
}

CreateAccountPayload is the account create action payload.

func NewCreateAccountPayload

func NewCreateAccountPayload(raw interface{}) (*CreateAccountPayload, error)

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

type CreateSeriesContext

type CreateSeriesContext struct {
	*goa.Context
	AccountID int
	Payload   *CreateSeriesPayload
}

CreateSeriesContext provides the series create action context.

func NewCreateSeriesContext

func NewCreateSeriesContext(c *goa.Context) (*CreateSeriesContext, error)

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

func (*CreateSeriesContext) Created

func (ctx *CreateSeriesContext) Created() error

Created sends a HTTP response with status code 201.

type CreateSeriesPayload

type CreateSeriesPayload struct {
	Name string
}

CreateSeriesPayload is the series create action payload.

func NewCreateSeriesPayload

func NewCreateSeriesPayload(raw interface{}) (*CreateSeriesPayload, error)

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

type CreateUserContext

type CreateUserContext struct {
	*goa.Context
	AccountID int
	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 {
	Email     string
	FirstName string
	LastName  string
}

CreateUserPayload is the user create action payload.

func NewCreateUserPayload

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

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

type DeleteAccountContext

type DeleteAccountContext struct {
	*goa.Context
	AccountID int
}

DeleteAccountContext provides the account delete action context.

func NewDeleteAccountContext

func NewDeleteAccountContext(c *goa.Context) (*DeleteAccountContext, error)

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

func (*DeleteAccountContext) NoContent

func (ctx *DeleteAccountContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*DeleteAccountContext) NotFound

func (ctx *DeleteAccountContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type ListSeriesContext

type ListSeriesContext struct {
	*goa.Context
	AccountID int
}

ListSeriesContext provides the series list action context.

func NewListSeriesContext

func NewListSeriesContext(c *goa.Context) (*ListSeriesContext, error)

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

func (*ListSeriesContext) OK

OK sends a HTTP response with status code 200.

type ListUserContext

type ListUserContext struct {
	*goa.Context
	AccountID int
}

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 Series

type Series struct {
	// Account that owns bottle
	Account *Account
	// Date of creation
	CreatedAt string
	// API href of series
	Href string
	// ID of series
	ID   int
	Name string
	// Date of last update
	UpdatedAt string
}

A recurring event or conference Identifier: application/vnd.congo.api.series+json

func LoadSeries

func LoadSeries(raw interface{}) (*Series, error)

LoadSeries loads raw data into an instance of Series 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 (*Series) Dump

func (mt *Series) Dump(view SeriesViewEnum) (map[string]interface{}, error)

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

func (*Series) Validate

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

Validate validates the media type instance.

type SeriesCollection

type SeriesCollection []*Series

SeriesCollection media type Identifier: application/vnd.congo.api.series+json; type=collection

func LoadSeriesCollection

func LoadSeriesCollection(raw interface{}) (SeriesCollection, error)

LoadSeriesCollection loads raw data into an instance of SeriesCollection 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 (SeriesCollection) Dump

func (mt SeriesCollection) Dump(view SeriesCollectionViewEnum) ([]map[string]interface{}, error)

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

func (SeriesCollection) Validate

func (mt SeriesCollection) Validate() (err error)

Validate validates the media type instance.

type SeriesCollectionViewEnum

type SeriesCollectionViewEnum string

array views

const (
	// SeriesCollection default view
	SeriesCollectionDefaultView SeriesCollectionViewEnum = "default"
	// SeriesCollection tiny view
	SeriesCollectionTinyView SeriesCollectionViewEnum = "tiny"
)

type SeriesController

type SeriesController interface {
	Create(*CreateSeriesContext) error
	List(*ListSeriesContext) error
	Show(*ShowSeriesContext) error
	Update(*UpdateSeriesContext) error
}

SeriesController is the controller interface for the Series actions.

type SeriesPayload

type SeriesPayload struct {
	Name string
}

SeriesPayload type

type SeriesViewEnum

type SeriesViewEnum string

object views

const (
	// Series default view
	SeriesDefaultView SeriesViewEnum = "default"
	// Series full view
	SeriesFullView SeriesViewEnum = "full"
	// Series tiny view
	SeriesTinyView SeriesViewEnum = "tiny"
)

type ShowAccountContext

type ShowAccountContext struct {
	*goa.Context
	AccountID int
}

ShowAccountContext provides the account show action context.

func NewShowAccountContext

func NewShowAccountContext(c *goa.Context) (*ShowAccountContext, error)

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

func (*ShowAccountContext) NotFound

func (ctx *ShowAccountContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowAccountContext) OK

func (ctx *ShowAccountContext) OK(resp *Account, view AccountViewEnum) error

OK sends a HTTP response with status code 200.

type ShowSeriesContext

type ShowSeriesContext struct {
	*goa.Context
	AccountID int
	SeriesID  int
}

ShowSeriesContext provides the series show action context.

func NewShowSeriesContext

func NewShowSeriesContext(c *goa.Context) (*ShowSeriesContext, error)

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

func (*ShowSeriesContext) NotFound

func (ctx *ShowSeriesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

func (*ShowSeriesContext) OK

func (ctx *ShowSeriesContext) OK(resp *Series, view SeriesViewEnum) error

OK sends a HTTP response with status code 200.

type ShowUserContext

type ShowUserContext struct {
	*goa.Context
	AccountID int
	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 UpdateAccountContext

type UpdateAccountContext struct {
	*goa.Context
	AccountID int
	Payload   *UpdateAccountPayload
}

UpdateAccountContext provides the account update action context.

func NewUpdateAccountContext

func NewUpdateAccountContext(c *goa.Context) (*UpdateAccountContext, error)

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

func (*UpdateAccountContext) NoContent

func (ctx *UpdateAccountContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateAccountContext) NotFound

func (ctx *UpdateAccountContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type UpdateAccountPayload

type UpdateAccountPayload struct {
	// Name of account
	Name string
}

UpdateAccountPayload is the account update action payload.

func NewUpdateAccountPayload

func NewUpdateAccountPayload(raw interface{}) (*UpdateAccountPayload, error)

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

type UpdateSeriesContext

type UpdateSeriesContext struct {
	*goa.Context
	AccountID int
	SeriesID  int
	Payload   *UpdateSeriesPayload
}

UpdateSeriesContext provides the series update action context.

func NewUpdateSeriesContext

func NewUpdateSeriesContext(c *goa.Context) (*UpdateSeriesContext, error)

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

func (*UpdateSeriesContext) NoContent

func (ctx *UpdateSeriesContext) NoContent() error

NoContent sends a HTTP response with status code 204.

func (*UpdateSeriesContext) NotFound

func (ctx *UpdateSeriesContext) NotFound() error

NotFound sends a HTTP response with status code 404.

type UpdateSeriesPayload

type UpdateSeriesPayload struct {
	Name string
}

UpdateSeriesPayload is the series update action payload.

func NewUpdateSeriesPayload

func NewUpdateSeriesPayload(raw interface{}) (*UpdateSeriesPayload, error)

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

type UpdateUserContext

type UpdateUserContext struct {
	*goa.Context
	AccountID int
	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 {
	Email     string
	FirstName string
	LastName  string
}

UpdateUserPayload is the user update action payload.

func NewUpdateUserPayload

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

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

type User

type User struct {
	// Date of creation
	CreatedAt 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
}

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

func LoadUser

func LoadUser(raw interface{}) (*User, 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 (*User) Dump

func (mt *User) Dump(view UserViewEnum) (map[string]interface{}, 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.congo.api.user+json; type=collection

func LoadUserCollection

func LoadUserCollection(raw interface{}) (UserCollection, 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 (UserCollection) Dump

func (mt UserCollection) Dump() ([]map[string]interface{}, 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 UserCollectionViewEnum

type UserCollectionViewEnum string

array views

const (
	// UserCollection default view
	UserCollectionDefaultView UserCollectionViewEnum = "default"
)

type UserController

type UserController interface {
	Create(*CreateUserContext) error
	List(*ListUserContext) error
	Show(*ShowUserContext) error
	Update(*UpdateUserContext) error
}

UserController is the controller interface for the User actions.

type UserPayload

type UserPayload struct {
	Email     string
	FirstName string
	LastName  string
}

UserPayload type

type UserViewEnum

type UserViewEnum string

object 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