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 FindByEmailUserContext
- type FindUserContext
- type GetAllUserContext
- type GetMeUserContext
- type GetUserContext
- type ResetToken
- type ResetVerificationTokenUserContext
- type SwaggerController
- type UpdateUserContext
- type UpdateUserPayload
- type UserController
- type Users
- 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 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 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 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
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 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.