app

package
v0.0.0-...-91404a6 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountMusicController

func MountMusicController(service *goa.Service, ctrl MusicController)

MountMusicController "mounts" a Music resource controller on the given service.

func MountRecommendationsController

func MountRecommendationsController(service *goa.Service, ctrl RecommendationsController)

MountRecommendationsController "mounts" a Recommendations 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 MountUserController

func MountUserController(service *goa.Service, ctrl UserController)

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

func MusicHref

func MusicHref(id interface{}) string

MusicHref returns the resource href.

func NewAPIKeySecurity

func NewAPIKeySecurity() *goa.APIKeySecurity

NewAPIKeySecurity creates a APIKey security definition.

func NewBasicAuthSecurity

func NewBasicAuthSecurity() *goa.BasicAuthSecurity

NewBasicAuthSecurity creates a BasicAuth security definition.

func UseAPIKeyMiddleware

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

UseAPIKeyMiddleware mounts the APIKey auth middleware onto the service.

func UseBasicAuthMiddleware

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

UseBasicAuthMiddleware mounts the BasicAuth auth middleware onto the service.

func UserHref

func UserHref(id interface{}) string

UserHref returns the resource href.

Types

type BluelensMusic

type BluelensMusic struct {
	Href string   `form:"href" json:"href" xml:"href"`
	ID   string   `form:"id" json:"id" xml:"id"`
	Tags []string `form:"tags,omitempty" json:"tags,omitempty" xml:"tags,omitempty"`
}

Media type of a music resource (default view)

Identifier: application/vnd.bluelens.music+json; view=default

func (*BluelensMusic) Validate

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

Validate validates the BluelensMusic media type instance.

type BluelensMusicCollection

type BluelensMusicCollection []*BluelensMusic

BluelensMusicCollection is the media type for an array of BluelensMusic (default view)

Identifier: application/vnd.bluelens.music+json; type=collection; view=default

func (BluelensMusicCollection) Validate

func (mt BluelensMusicCollection) Validate() (err error)

Validate validates the BluelensMusicCollection media type instance.

type BluelensMusicFull

type BluelensMusicFull struct {
	Href string   `form:"href" json:"href" xml:"href"`
	ID   string   `form:"id" json:"id" xml:"id"`
	Tags []string `form:"tags,omitempty" json:"tags,omitempty" xml:"tags,omitempty"`
}

Media type of a music resource (full view)

Identifier: application/vnd.bluelens.music+json; view=full

func (*BluelensMusicFull) Validate

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

Validate validates the BluelensMusicFull media type instance.

type BluelensMusicFullCollection

type BluelensMusicFullCollection []*BluelensMusicFull

BluelensMusicCollection is the media type for an array of BluelensMusic (full view)

Identifier: application/vnd.bluelens.music+json; type=collection; view=full

func (BluelensMusicFullCollection) Validate

func (mt BluelensMusicFullCollection) Validate() (err error)

Validate validates the BluelensMusicFullCollection media type instance.

type BluelensMusicLink struct {
	Href string `form:"href" json:"href" xml:"href"`
}

Media type of a music resource (link view)

Identifier: application/vnd.bluelens.music+json; view=link

func (*BluelensMusicLink) Validate

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

Validate validates the BluelensMusicLink media type instance.

type BluelensMusicLinkCollection

type BluelensMusicLinkCollection []*BluelensMusicLink

BluelensMusicCollection is the media type for an array of BluelensMusic (link view)

Identifier: application/vnd.bluelens.music+json; type=collection; view=link

func (BluelensMusicLinkCollection) Validate

func (mt BluelensMusicLinkCollection) Validate() (err error)

Validate validates the BluelensMusicLinkCollection media type instance.

type BluelensRecommendations

type BluelensRecommendations struct {
	// Links to related resources
	Links   *BluelensRecommendationsLinks `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"`
	MusicID []string                      `form:"musicID,omitempty" json:"musicID,omitempty" xml:"musicID,omitempty"`
}

A list of recommendations for the specified user (default view)

Identifier: application/vnd.bluelens.recommendations+json; view=default

func (*BluelensRecommendations) Validate

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

Validate validates the BluelensRecommendations media type instance.

type BluelensRecommendationsAll

type BluelensRecommendationsAll struct {
	List    BluelensMusicCollection `form:"list" json:"list" xml:"list"`
	MusicID []string                `form:"musicID,omitempty" json:"musicID,omitempty" xml:"musicID,omitempty"`
	User    *BluelensUser           `form:"user" json:"user" xml:"user"`
}

A list of recommendations for the specified user (all view)

Identifier: application/vnd.bluelens.recommendations+json; view=all

func (*BluelensRecommendationsAll) Validate

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

Validate validates the BluelensRecommendationsAll media type instance.

type BluelensRecommendationsLinks struct {
	List BluelensMusicLinkCollection `form:"list,omitempty" json:"list,omitempty" xml:"list,omitempty"`
	User *BluelensUserLink           `form:"user,omitempty" json:"user,omitempty" xml:"user,omitempty"`
}

BluelensRecommendationsLinks contains links to related resources of BluelensRecommendations.

func (*BluelensRecommendationsLinks) Validate

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

Validate validates the BluelensRecommendationsLinks type instance.

type BluelensUser

type BluelensUser struct {
	Href string `form:"href" json:"href" xml:"href"`
	ID   string `form:"id" json:"id" xml:"id"`
	// Links to related resources
	Links *BluelensUserLinks `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"`
}

Media type of a user resource (default view)

Identifier: application/vnd.bluelens.user+json; view=default

func (*BluelensUser) Validate

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

Validate validates the BluelensUser media type instance.

type BluelensUserCollection

type BluelensUserCollection []*BluelensUser

BluelensUserCollection is the media type for an array of BluelensUser (default view)

Identifier: application/vnd.bluelens.user+json; type=collection; view=default

func (BluelensUserCollection) Validate

func (mt BluelensUserCollection) Validate() (err error)

Validate validates the BluelensUserCollection media type instance.

type BluelensUserFull

type BluelensUserFull struct {
	Followees BluelensUserCollection  `form:"followees,omitempty" json:"followees,omitempty" xml:"followees,omitempty"`
	History   BluelensMusicCollection `form:"history,omitempty" json:"history,omitempty" xml:"history,omitempty"`
	Href      string                  `form:"href" json:"href" xml:"href"`
	ID        string                  `form:"id" json:"id" xml:"id"`
}

Media type of a user resource (full view)

Identifier: application/vnd.bluelens.user+json; view=full

func (*BluelensUserFull) Validate

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

Validate validates the BluelensUserFull media type instance.

type BluelensUserFullCollection

type BluelensUserFullCollection []*BluelensUserFull

BluelensUserCollection is the media type for an array of BluelensUser (full view)

Identifier: application/vnd.bluelens.user+json; type=collection; view=full

func (BluelensUserFullCollection) Validate

func (mt BluelensUserFullCollection) Validate() (err error)

Validate validates the BluelensUserFullCollection media type instance.

type BluelensUserLink struct {
	Href string `form:"href" json:"href" xml:"href"`
}

Media type of a user resource (link view)

Identifier: application/vnd.bluelens.user+json; view=link

func (*BluelensUserLink) Validate

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

Validate validates the BluelensUserLink media type instance.

type BluelensUserLinkCollection

type BluelensUserLinkCollection []*BluelensUserLink

BluelensUserCollection is the media type for an array of BluelensUser (link view)

Identifier: application/vnd.bluelens.user+json; type=collection; view=link

func (BluelensUserLinkCollection) Validate

func (mt BluelensUserLinkCollection) Validate() (err error)

Validate validates the BluelensUserLinkCollection media type instance.

type BluelensUserLinks struct {
	Followees BluelensUserLinkCollection  `form:"followees,omitempty" json:"followees,omitempty" xml:"followees,omitempty"`
	History   BluelensMusicLinkCollection `form:"history,omitempty" json:"history,omitempty" xml:"history,omitempty"`
}

BluelensUserLinks contains links to related resources of BluelensUser.

func (*BluelensUserLinks) Validate

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

Validate validates the BluelensUserLinks type instance.

type BluelensUserLinksArray

type BluelensUserLinksArray []*BluelensUserLinks

BluelensUserLinksArray contains links to related resources of BluelensUserCollection.

func (BluelensUserLinksArray) Validate

func (ut BluelensUserLinksArray) Validate() (err error)

Validate validates the BluelensUserLinksArray type instance.

type CreateMusicContext

type CreateMusicContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *Music
}

CreateMusicContext provides the music create action context.

func NewCreateMusicContext

func NewCreateMusicContext(ctx context.Context, service *goa.Service) (*CreateMusicContext, error)

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

func (*CreateMusicContext) BadRequest

func (ctx *CreateMusicContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (ctx *CreateMusicContext) CreatedLink(r *BluelensMusicLink) error

CreatedLink sends a HTTP response with status code 201.

func (*CreateMusicContext) InternalServerError

func (ctx *CreateMusicContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*CreateMusicContext) Unauthorized

func (ctx *CreateMusicContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type CreateUserContext

type CreateUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Payload *User
}

CreateUserContext provides the user create action context.

func NewCreateUserContext

func NewCreateUserContext(ctx context.Context, service *goa.Service) (*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) BadRequest

func (ctx *CreateUserContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (ctx *CreateUserContext) CreatedLink(r *BluelensUserLink) error

CreatedLink sends a HTTP response with status code 201.

func (*CreateUserContext) InternalServerError

func (ctx *CreateUserContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*CreateUserContext) Unauthorized

func (ctx *CreateUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type FollowUserContext

type FollowUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	FolloweeID string
	ID         string
	Payload    *FollowUserPayload
}

FollowUserContext provides the user follow action context.

func NewFollowUserContext

func NewFollowUserContext(ctx context.Context, service *goa.Service) (*FollowUserContext, error)

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

func (*FollowUserContext) BadRequest

func (ctx *FollowUserContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*FollowUserContext) InternalServerError

func (ctx *FollowUserContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*FollowUserContext) NotFound

func (ctx *FollowUserContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*FollowUserContext) OK

func (ctx *FollowUserContext) OK(r *BluelensUser) error

OK sends a HTTP response with status code 200.

func (*FollowUserContext) OKFull

func (ctx *FollowUserContext) OKFull(r *BluelensUserFull) error

OKFull sends a HTTP response with status code 200.

func (ctx *FollowUserContext) OKLink(r *BluelensUserLink) error

OKLink sends a HTTP response with status code 200.

func (*FollowUserContext) Unauthorized

func (ctx *FollowUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type FollowUserPayload

type FollowUserPayload struct {
	// ID of the followee.
	FolloweeID *string `form:"followeeID,omitempty" json:"followeeID,omitempty" xml:"followeeID,omitempty"`
}

FollowUserPayload is the user follow action payload.

type ListMusicContext

type ListMusicContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Limit  int
	Offset int
}

ListMusicContext provides the music list action context.

func NewListMusicContext

func NewListMusicContext(ctx context.Context, service *goa.Service) (*ListMusicContext, error)

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

func (*ListMusicContext) InternalServerError

func (ctx *ListMusicContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ListMusicContext) OK

OK sends a HTTP response with status code 200.

func (*ListMusicContext) OKFull

OKFull sends a HTTP response with status code 200.

OKLink sends a HTTP response with status code 200.

func (*ListMusicContext) Unauthorized

func (ctx *ListMusicContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type ListUserContext

type ListUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Limit  int
	Offset int
}

ListUserContext provides the user list action context.

func NewListUserContext

func NewListUserContext(ctx context.Context, service *goa.Service) (*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) InternalServerError

func (ctx *ListUserContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ListUserContext) OK

OK sends a HTTP response with status code 200.

func (*ListUserContext) OKFull

OKFull sends a HTTP response with status code 200.

OKLink sends a HTTP response with status code 200.

func (*ListUserContext) Unauthorized

func (ctx *ListUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type ListenUserContext

type ListenUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID      string
	MusicID string
	Payload *ListenUserPayload
}

ListenUserContext provides the user listen action context.

func NewListenUserContext

func NewListenUserContext(ctx context.Context, service *goa.Service) (*ListenUserContext, error)

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

func (*ListenUserContext) BadRequest

func (ctx *ListenUserContext) BadRequest(r error) error

BadRequest sends a HTTP response with status code 400.

func (*ListenUserContext) InternalServerError

func (ctx *ListenUserContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ListenUserContext) NotFound

func (ctx *ListenUserContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*ListenUserContext) OK

func (ctx *ListenUserContext) OK(r *BluelensUser) error

OK sends a HTTP response with status code 200.

func (*ListenUserContext) OKFull

func (ctx *ListenUserContext) OKFull(r *BluelensUserFull) error

OKFull sends a HTTP response with status code 200.

func (ctx *ListenUserContext) OKLink(r *BluelensUserLink) error

OKLink sends a HTTP response with status code 200.

func (*ListenUserContext) Unauthorized

func (ctx *ListenUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type ListenUserPayload

type ListenUserPayload struct {
	// ID of the music.
	MusicID *string `form:"musicID,omitempty" json:"musicID,omitempty" xml:"musicID,omitempty"`
}

ListenUserPayload is the user listen action payload.

type Music

type Music struct {
	ID   string   `form:"id" json:"id" xml:"id"`
	Tags []string `form:"tags,omitempty" json:"tags,omitempty" xml:"tags,omitempty"`
}

A music resource

func (*Music) Validate

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

Validate validates the Music type instance.

type MusicController

type MusicController interface {
	goa.Muxer
	Create(*CreateMusicContext) error
	List(*ListMusicContext) error
	Show(*ShowMusicContext) error
}

MusicController is the controller interface for the Music actions.

type RecommendRecommendationsContext

type RecommendRecommendationsContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	Limit  int
	UserID string
}

RecommendRecommendationsContext provides the recommendations recommend action context.

func NewRecommendRecommendationsContext

func NewRecommendRecommendationsContext(ctx context.Context, service *goa.Service) (*RecommendRecommendationsContext, error)

NewRecommendRecommendationsContext parses the incoming request URL and body, performs validations and creates the context used by the recommendations controller recommend action.

func (*RecommendRecommendationsContext) InternalServerError

func (ctx *RecommendRecommendationsContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*RecommendRecommendationsContext) NotFound

func (ctx *RecommendRecommendationsContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*RecommendRecommendationsContext) OK

OK sends a HTTP response with status code 200.

func (*RecommendRecommendationsContext) OKAll

OKAll sends a HTTP response with status code 200.

func (*RecommendRecommendationsContext) Unauthorized

func (ctx *RecommendRecommendationsContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type RecommendationsController

type RecommendationsController interface {
	goa.Muxer
	Recommend(*RecommendRecommendationsContext) error
}

RecommendationsController is the controller interface for the Recommendations actions.

type ShowMusicContext

type ShowMusicContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID string
}

ShowMusicContext provides the music show action context.

func NewShowMusicContext

func NewShowMusicContext(ctx context.Context, service *goa.Service) (*ShowMusicContext, error)

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

func (*ShowMusicContext) InternalServerError

func (ctx *ShowMusicContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ShowMusicContext) NotFound

func (ctx *ShowMusicContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*ShowMusicContext) OKFull

func (ctx *ShowMusicContext) OKFull(r *BluelensMusicFull) error

OKFull sends a HTTP response with status code 200.

func (*ShowMusicContext) Unauthorized

func (ctx *ShowMusicContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type ShowUserContext

type ShowUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
	ID string
}

ShowUserContext provides the user show action context.

func NewShowUserContext

func NewShowUserContext(ctx context.Context, service *goa.Service) (*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) InternalServerError

func (ctx *ShowUserContext) InternalServerError(r error) error

InternalServerError sends a HTTP response with status code 500.

func (*ShowUserContext) NotFound

func (ctx *ShowUserContext) NotFound(r error) error

NotFound sends a HTTP response with status code 404.

func (*ShowUserContext) OKFull

func (ctx *ShowUserContext) OKFull(r *BluelensUserFull) error

OKFull sends a HTTP response with status code 200.

func (*ShowUserContext) Unauthorized

func (ctx *ShowUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type SwaggerController

type SwaggerController interface {
	goa.Muxer
	goa.FileServer
}

SwaggerController is the controller interface for the Swagger actions.

type User

type User struct {
	Followees []*User  `form:"followees,omitempty" json:"followees,omitempty" xml:"followees,omitempty"`
	History   []*Music `form:"history,omitempty" json:"history,omitempty" xml:"history,omitempty"`
	ID        string   `form:"id" json:"id" xml:"id"`
}

A user resource

func (*User) Validate

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

Validate validates the User type instance.

type UserController

type UserController interface {
	goa.Muxer
	Create(*CreateUserContext) error
	Follow(*FollowUserContext) error
	List(*ListUserContext) error
	Listen(*ListenUserContext) error
	Show(*ShowUserContext) error
}

UserController is the controller interface for the User actions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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