Documentation
¶
Index ¶
- func MountSwaggerController(service *goa.Service, ctrl SwaggerController)
- func MountUserController(service *goa.Service, ctrl UserController)
- type RegisterUserContext
- type ResendVerificationPayload
- type ResendVerificationUserContext
- type SwaggerController
- type UserController
- type UserPayload
- type Users
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 RegisterUserContext ¶
type RegisterUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *UserPayload
}
RegisterUserContext provides the user register action context.
func NewRegisterUserContext ¶
func NewRegisterUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*RegisterUserContext, error)
NewRegisterUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller register action.
func (*RegisterUserContext) BadRequest ¶
func (ctx *RegisterUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*RegisterUserContext) Created ¶
func (ctx *RegisterUserContext) Created(r *Users) error
Created sends a HTTP response with status code 201.
func (*RegisterUserContext) InternalServerError ¶
func (ctx *RegisterUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
type ResendVerificationPayload ¶
type ResendVerificationPayload struct {
// User email for verification
Email string `form:"email" json:"email" yaml:"email" xml:"email"`
}
Payload for resending email verification. Contains user email
func (*ResendVerificationPayload) Validate ¶
func (ut *ResendVerificationPayload) Validate() (err error)
Validate validates the ResendVerificationPayload type instance.
type ResendVerificationUserContext ¶
type ResendVerificationUserContext struct {
context.Context
*goa.ResponseData
*goa.RequestData
Payload *ResendVerificationPayload
}
ResendVerificationUserContext provides the user resendVerification action context.
func NewResendVerificationUserContext ¶
func NewResendVerificationUserContext(ctx context.Context, r *http.Request, service *goa.Service) (*ResendVerificationUserContext, error)
NewResendVerificationUserContext parses the incoming request URL and body, performs validations and creates the context used by the user controller resendVerification action.
func (*ResendVerificationUserContext) BadRequest ¶
func (ctx *ResendVerificationUserContext) BadRequest(r error) error
BadRequest sends a HTTP response with status code 400.
func (*ResendVerificationUserContext) InternalServerError ¶
func (ctx *ResendVerificationUserContext) InternalServerError(r error) error
InternalServerError sends a HTTP response with status code 500.
func (*ResendVerificationUserContext) OK ¶
func (ctx *ResendVerificationUserContext) OK(resp []byte) 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 UserController ¶
type UserController interface {
goa.Muxer
Register(*RegisterUserContext) error
ResendVerification(*ResendVerificationUserContext) error
}
UserController is the controller interface for the User actions.
type UserPayload ¶
type UserPayload 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"`
// Full name of user
Fullname string `form:"fullname" json:"fullname" yaml:"fullname" xml:"fullname"`
// List of namespaces this user belongs to
Namespaces []string `form:"namespaces,omitempty" json:"namespaces,omitempty" yaml:"namespaces,omitempty" xml:"namespaces,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"`
// Status of user account
SendActivationMail bool `form:"sendActivationMail" json:"sendActivationMail" yaml:"sendActivationMail" xml:"sendActivationMail"`
// Email verification token
Token *string `form:"token,omitempty" json:"token,omitempty" yaml:"token,omitempty" xml:"token,omitempty"`
}
UserPayload
func (*UserPayload) Validate ¶
func (ut *UserPayload) Validate() (err error)
Validate validates the UserPayload type instance.
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"`
// Full name of user
Fullname string `form:"fullname" json:"fullname" yaml:"fullname" xml:"fullname"`
// Unique user ID
ID string `form:"id" json:"id" yaml:"id" xml:"id"`
// 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