Documentation
¶
Index ¶
- func MountSwaggerController(service *goa.Service, ctrl SwaggerController)
- func MountUserController(service *goa.Service, ctrl UserController)
- type CreateUserContext
- type CreateUserPayload
- type Credentials
- type EmailPayload
- type FilterPayload
- type FilterProperty
- type FindByEmailUserContext
- type FindUserContext
- type FindUsersUserContext
- type ForgotPasswordPayload
- type ForgotPasswordUpdateUserContext
- type ForgotPasswordUserContext
- type GetAllUserContext
- type GetMeUserContext
- type GetUserContext
- type OrderSpec
- type ResetToken
- type ResetVerificationTokenUserContext
- type SwaggerController
- type UpdateUserContext
- type UpdateUserPayload
- type UserController
- type Users
- type UsersPage
- type VerifyUserContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Types ¶
type CreateUserContext ¶
type CreateUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *CreateUserPayload
}
CreateUserContext provides the user create action context.
func NewCreateUserContext ¶
func NewCreateUserContext(ctx context.Context, r *http.Request, 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 (*CreateUserContext) Created ¶
func (ctx *CreateUserContext) Created(r *Users) error
Created 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.
type CreateUserPayload ¶
type CreateUserPayload struct {
// Status of user account
Active bool `form:"active" json:"active" yaml:"active" xml:"active"`
// Email of user
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
// External id of user
ExternalID *string `form:"externalId,omitempty" json:"externalId,omitempty" yaml:"externalId,omitempty" xml:"externalId,omitempty"`
// List of namespaces this user belongs to
Namespaces []string `form:"namespaces,omitempty" json:"namespaces,omitempty" yaml:"namespaces,omitempty" xml:"namespaces,omitempty"`
// List of organizations to which this user belongs to
Organizations []string `form:"organizations,omitempty" json:"organizations,omitempty" yaml:"organizations,omitempty" xml:"organizations,omitempty"`
// Password of user
Password *string `form:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty" xml:"password,omitempty"`
// Roles of user
Roles []string `form:"roles,omitempty" json:"roles,omitempty" yaml:"roles,omitempty" xml:"roles,omitempty"`
// Token for email verification
Token *string `form:"token,omitempty" json:"token,omitempty" yaml:"token,omitempty" xml:"token,omitempty"`
}
CreateUserPayload
func (*CreateUserPayload) Validate ¶
func (ut *CreateUserPayload) Validate() (err error)
Validate validates the CreateUserPayload type instance.
type Credentials ¶
type Credentials struct {
// Email of user
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
// Password of user
Password string `form:"password" json:"password" yaml:"password" xml:"password"`
}
Email and password credentials
func (*Credentials) Validate ¶
func (ut *Credentials) Validate() (err error)
Validate validates the Credentials type instance.
type EmailPayload ¶
type EmailPayload struct {
// Email of user
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
}
Email payload
func (*EmailPayload) Validate ¶
func (ut *EmailPayload) Validate() (err error)
Validate validates the EmailPayload type instance.
type FilterPayload ¶
type FilterPayload struct {
// Users filter.
Filter []*FilterProperty `form:"filter,omitempty" json:"filter,omitempty" yaml:"filter,omitempty" xml:"filter,omitempty"`
// Page number (1-based).
Page int `form:"page" json:"page" yaml:"page" xml:"page"`
// Items per page.
PageSize int `form:"pageSize" json:"pageSize" yaml:"pageSize" xml:"pageSize"`
// Sort specification.
Sort *OrderSpec `form:"sort,omitempty" json:"sort,omitempty" yaml:"sort,omitempty" xml:"sort,omitempty"`
}
FilterPayload user type.
func (*FilterPayload) Validate ¶
func (ut *FilterPayload) Validate() (err error)
Validate validates the FilterPayload type instance.
type FilterProperty ¶
type FilterProperty struct {
// Property name
Property string `form:"property" json:"property" yaml:"property" xml:"property"`
// Property value to match
Value string `form:"value" json:"value" yaml:"value" xml:"value"`
}
FilterProperty user type.
func (*FilterProperty) Validate ¶
func (ut *FilterProperty) Validate() (err error)
Validate validates the FilterProperty type instance.
type FindByEmailUserContext ¶
type FindByEmailUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *EmailPayload
}
FindByEmailUserContext provides the user findByEmail action context.
func NewFindByEmailUserContext ¶
func NewFindByEmailUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*FindByEmailUserContext, error)
NewFindByEmailUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller findByEmail action.
func (*FindByEmailUserContext) InternalServerError ¶
func (ctx *FindByEmailUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*FindByEmailUserContext) NotFound ¶
func (ctx *FindByEmailUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*FindByEmailUserContext) OK ¶
func (ctx *FindByEmailUserContext) OK(r *Users) error
OK sends a HTTP response with status code 200.
type FindUserContext ¶
type FindUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *Credentials
}
FindUserContext provides the user find action context.
func NewFindUserContext ¶
func NewFindUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*FindUserContext, error)
NewFindUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller find action.
func (*FindUserContext) BadRequest ¶
func (ctx *FindUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*FindUserContext) InternalServerError ¶
func (ctx *FindUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*FindUserContext) NotFound ¶
func (ctx *FindUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*FindUserContext) OK ¶
func (ctx *FindUserContext) OK(r *Users) error
OK sends a HTTP response with status code 200.
type FindUsersUserContext ¶
type FindUsersUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *FilterPayload
}
FindUsersUserContext provides the user findUsers action context.
func NewFindUsersUserContext ¶
func NewFindUsersUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*FindUsersUserContext, error)
NewFindUsersUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller findUsers action.
func (*FindUsersUserContext) BadRequest ¶
func (ctx *FindUsersUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*FindUsersUserContext) InternalServerError ¶
func (ctx *FindUsersUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*FindUsersUserContext) OK ¶
func (ctx *FindUsersUserContext) OK(r *UsersPage) error
OK sends a HTTP response with status code 200.
type ForgotPasswordPayload ¶
type ForgotPasswordPayload struct {
// Email of the user
Email *string `form:"email,omitempty" json:"email,omitempty" yaml:"email,omitempty" xml:"email,omitempty"`
// New password
Password string `form:"password" json:"password" yaml:"password" xml:"password"`
// Forgot password token
Token string `form:"token" json:"token" yaml:"token" xml:"token"`
}
Password Reset payload
func (*ForgotPasswordPayload) Validate ¶
func (ut *ForgotPasswordPayload) Validate() (err error)
Validate validates the ForgotPasswordPayload type instance.
type ForgotPasswordUpdateUserContext ¶
type ForgotPasswordUpdateUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *ForgotPasswordPayload
}
ForgotPasswordUpdateUserContext provides the user forgotPasswordUpdate action context.
func NewForgotPasswordUpdateUserContext ¶
func NewForgotPasswordUpdateUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*ForgotPasswordUpdateUserContext, error)
NewForgotPasswordUpdateUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller forgotPasswordUpdate action.
func (*ForgotPasswordUpdateUserContext) BadRequest ¶
func (ctx *ForgotPasswordUpdateUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ForgotPasswordUpdateUserContext) InternalServerError ¶
func (ctx *ForgotPasswordUpdateUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*ForgotPasswordUpdateUserContext) NotFound ¶
func (ctx *ForgotPasswordUpdateUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*ForgotPasswordUpdateUserContext) OK ¶
func (ctx *ForgotPasswordUpdateUserContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type ForgotPasswordUserContext ¶
type ForgotPasswordUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *EmailPayload
}
ForgotPasswordUserContext provides the user forgotPassword action context.
func NewForgotPasswordUserContext ¶
func NewForgotPasswordUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*ForgotPasswordUserContext, error)
NewForgotPasswordUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller forgotPassword action.
func (*ForgotPasswordUserContext) BadRequest ¶
func (ctx *ForgotPasswordUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ForgotPasswordUserContext) InternalServerError ¶
func (ctx *ForgotPasswordUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*ForgotPasswordUserContext) OK ¶
func (ctx *ForgotPasswordUserContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type GetAllUserContext ¶
type GetAllUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Limit *int
Offset *int
Order *string
Sorting *string
}
GetAllUserContext provides the user getAll action context.
func NewGetAllUserContext ¶
func NewGetAllUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetAllUserContext, error)
NewGetAllUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller getAll action.
func (*GetAllUserContext) InternalServerError ¶
func (ctx *GetAllUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*GetAllUserContext) NotFound ¶
func (ctx *GetAllUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*GetAllUserContext) OK ¶
func (ctx *GetAllUserContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.
type GetMeUserContext ¶
type GetMeUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
}
GetMeUserContext provides the user getMe action context.
func NewGetMeUserContext ¶
func NewGetMeUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetMeUserContext, error)
NewGetMeUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller getMe action.
func (*GetMeUserContext) BadRequest ¶
func (ctx *GetMeUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*GetMeUserContext) InternalServerError ¶
func (ctx *GetMeUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*GetMeUserContext) NotFound ¶
func (ctx *GetMeUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*GetMeUserContext) OK ¶
func (ctx *GetMeUserContext) OK(r *Users) error
OK sends a HTTP response with status code 200.
type GetUserContext ¶
type GetUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
UserID string
}
GetUserContext provides the user get action context.
func NewGetUserContext ¶
func NewGetUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*GetUserContext, error)
NewGetUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller get action.
func (*GetUserContext) BadRequest ¶
func (ctx *GetUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*GetUserContext) InternalServerError ¶
func (ctx *GetUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*GetUserContext) NotFound ¶
func (ctx *GetUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*GetUserContext) OK ¶
func (ctx *GetUserContext) OK(r *Users) error
OK sends a HTTP response with status code 200.
type OrderSpec ¶
type OrderSpec struct {
// Sort order. Can be 'asc' or 'desc'.
Direction string `form:"direction" json:"direction" yaml:"direction" xml:"direction"`
// Sort by property
Property string `form:"property" json:"property" yaml:"property" xml:"property"`
}
OrderSpec user type.
type ResetToken ¶
type ResetToken struct {
// User email
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
// User ID
ID string `form:"id" json:"id" yaml:"id" xml:"id"`
// New token
Token string `form:"token" json:"token" yaml:"token" xml:"token"`
}
ResetToken media type (default view)
Identifier: resettokenmedia; view=default
func (*ResetToken) Validate ¶
func (mt *ResetToken) Validate() (err error)
Validate validates the ResetToken media type instance.
type ResetVerificationTokenUserContext ¶
type ResetVerificationTokenUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *EmailPayload
}
ResetVerificationTokenUserContext provides the user resetVerificationToken action context.
func NewResetVerificationTokenUserContext ¶
func NewResetVerificationTokenUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*ResetVerificationTokenUserContext, error)
NewResetVerificationTokenUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller resetVerificationToken action.
func (*ResetVerificationTokenUserContext) BadRequest ¶
func (ctx *ResetVerificationTokenUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ResetVerificationTokenUserContext) InternalServerError ¶
func (ctx *ResetVerificationTokenUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*ResetVerificationTokenUserContext) NotFound ¶
func (ctx *ResetVerificationTokenUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*ResetVerificationTokenUserContext) OK ¶
func (ctx *ResetVerificationTokenUserContext) OK(r *ResetToken) error
OK sends a HTTP response with status code 200.
type SwaggerController ¶
type SwaggerController interface {
goa.Muxer
goa.FileServer
}
SwaggerController is the controller interface for the Swagger actions.
type UpdateUserContext ¶
type UpdateUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
UserID string
Payload *UpdateUserPayload
}
UpdateUserContext provides the user update action context.
func NewUpdateUserContext ¶
func NewUpdateUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*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) BadRequest ¶
func (ctx *UpdateUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*UpdateUserContext) InternalServerError ¶
func (ctx *UpdateUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*UpdateUserContext) NotFound ¶
func (ctx *UpdateUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*UpdateUserContext) OK ¶
func (ctx *UpdateUserContext) OK(r *Users) error
OK sends a HTTP response with status code 200.
type UpdateUserPayload ¶
type UpdateUserPayload struct {
// Status of user account
Active bool `form:"active" json:"active" yaml:"active" xml:"active"`
// Email of user
Email *string `form:"email,omitempty" json:"email,omitempty" yaml:"email,omitempty" xml:"email,omitempty"`
// External id of user
ExternalID *string `form:"externalId,omitempty" json:"externalId,omitempty" yaml:"externalId,omitempty" xml:"externalId,omitempty"`
// List of namespaces this user belongs to
Namespaces []string `form:"namespaces,omitempty" json:"namespaces,omitempty" yaml:"namespaces,omitempty" xml:"namespaces,omitempty"`
// List of organizations to which this user belongs to
Organizations []string `form:"organizations,omitempty" json:"organizations,omitempty" yaml:"organizations,omitempty" xml:"organizations,omitempty"`
// Password of user
Password *string `form:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty" xml:"password,omitempty"`
// Roles of user
Roles []string `form:"roles,omitempty" json:"roles,omitempty" yaml:"roles,omitempty" xml:"roles,omitempty"`
// Token for email verification
Token *string `form:"token,omitempty" json:"token,omitempty" yaml:"token,omitempty" xml:"token,omitempty"`
}
UpdateUserPayload
func (*UpdateUserPayload) Validate ¶
func (ut *UpdateUserPayload) Validate() (err error)
Validate validates the UpdateUserPayload type instance.
type UserController ¶
type UserController interface {
goa.Muxer
Create(*CreateUserContext) error
Find(*FindUserContext) error
FindByEmail(*FindByEmailUserContext) error
FindUsers(*FindUsersUserContext) error
ForgotPassword(*ForgotPasswordUserContext) error
ForgotPasswordUpdate(*ForgotPasswordUpdateUserContext) error
Get(*GetUserContext) error
GetAll(*GetAllUserContext) error
GetMe(*GetMeUserContext) error
ResetVerificationToken(*ResetVerificationTokenUserContext) error
Update(*UpdateUserContext) error
Verify(*VerifyUserContext) error
}
UserController is the controller interface for the User actions.
type Users ¶
type Users struct {
// Status of user account
Active bool `form:"active" json:"active" yaml:"active" xml:"active"`
// Email of user
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
// External id of user
ExternalID string `form:"externalId" json:"externalId" yaml:"externalId" xml:"externalId"`
// Unique user ID
ID string `form:"id" json:"id" yaml:"id" xml:"id"`
// List of namespaces this user belongs to
Namespaces []string `form:"namespaces,omitempty" json:"namespaces,omitempty" yaml:"namespaces,omitempty" xml:"namespaces,omitempty"`
// List of organizations to which this user belongs to
Organizations []string `form:"organizations,omitempty" json:"organizations,omitempty" yaml:"organizations,omitempty" xml:"organizations,omitempty"`
// Roles of user
Roles []string `form:"roles" json:"roles" yaml:"roles" xml:"roles"`
}
users media type (default view)
Identifier: application/vnd.goa.user+json; view=default
type UsersPage ¶
type UsersPage struct {
// Users list
Items []*Users `form:"items,omitempty" json:"items,omitempty" yaml:"items,omitempty" xml:"items,omitempty"`
// Page number (1-based).
Page *int `form:"page,omitempty" json:"page,omitempty" yaml:"page,omitempty" xml:"page,omitempty"`
// Items per page.
PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty" yaml:"pageSize,omitempty" xml:"pageSize,omitempty"`
}
UsersPage media type (default view)
Identifier: application/mt.ckan.users-page+json; view=default
type VerifyUserContext ¶
type VerifyUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Token *string
}
VerifyUserContext provides the user verify action context.
func NewVerifyUserContext ¶
func NewVerifyUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*VerifyUserContext, error)
NewVerifyUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller verify action.
func (*VerifyUserContext) BadRequest ¶
func (ctx *VerifyUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*VerifyUserContext) InternalServerError ¶
func (ctx *VerifyUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*VerifyUserContext) NotFound ¶
func (ctx *VerifyUserContext) NotFound(r error) error
NotFound sends a HTTP response with status code 404.
func (*VerifyUserContext) OK ¶
func (ctx *VerifyUserContext) OK(resp []byte) error
OK sends a HTTP response with status code 200.