app

package
v0.0.0-...-04d3a30 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MountUserController

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

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

func NewAPIKeySecurity

func NewAPIKeySecurity() *goa.APIKeySecurity

NewAPIKeySecurity creates a api_key security definition.

func UseAPIKeyMiddleware

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

UseAPIKeyMiddleware mounts the api_key auth middleware onto the service.

Types

type InfoUserContext

type InfoUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

InfoUserContext provides the user info action context.

func NewInfoUserContext

func NewInfoUserContext(ctx context.Context, service *goa.Service) (*InfoUserContext, error)

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

func (*InfoUserContext) OK

OK sends a HTTP response with status code 200.

func (*InfoUserContext) Unauthorized

func (ctx *InfoUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type LoginUserContext

type LoginUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

LoginUserContext provides the user login action context.

func NewLoginUserContext

func NewLoginUserContext(ctx context.Context, service *goa.Service) (*LoginUserContext, error)

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

func (*LoginUserContext) OK

func (ctx *LoginUserContext) OK(r *Loginresponse) error

OK sends a HTTP response with status code 200.

func (*LoginUserContext) Unauthorized

func (ctx *LoginUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type Loginresponse

type Loginresponse struct {
	// Response code
	Code string `form:"code" json:"code" xml:"code"`
	// Response Message
	Message string `form:"message" json:"message" xml:"message"`
	// Secret key
	SecretKey string `form:"secret_key" json:"secret_key" xml:"secret_key"`
	// Error Code
	Status int `form:"status" json:"status" xml:"status"`
}

After login response (default view)

Identifier: application/vnd.loginresponse; view=default

func (*Loginresponse) Validate

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

Validate validates the Loginresponse media type instance.

type LogoutUserContext

type LogoutUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

LogoutUserContext provides the user logout action context.

func NewLogoutUserContext

func NewLogoutUserContext(ctx context.Context, service *goa.Service) (*LogoutUserContext, error)

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

func (*LogoutUserContext) OK

OK sends a HTTP response with status code 200.

func (*LogoutUserContext) Unauthorized

func (ctx *LogoutUserContext) Unauthorized() error

Unauthorized sends a HTTP response with status code 401.

type RegisterUserContext

type RegisterUserContext struct {
	context.Context
	*goa.ResponseData
	*goa.RequestData
}

RegisterUserContext provides the user register action context.

func NewRegisterUserContext

func NewRegisterUserContext(ctx context.Context, 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) OK

OK sends a HTTP response with status code 200.

type Registeruser

type Registeruser struct {
	// Input email
	Email string `form:"email" json:"email" xml:"email"`
	// Input name
	Name string `form:"name" json:"name" xml:"name"`
	// Input password
	Password string `form:"password" json:"password" xml:"password"`
	// Re-enter password
	RePassword string `form:"re_password" json:"re_password" xml:"re_password"`
}

This will be a common response for most the user end points (default view)

Identifier: application/vnd.registeruser; view=default

func (*Registeruser) Validate

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

Validate validates the Registeruser media type instance.

type UserController

type UserController interface {
	goa.Muxer
	Info(*InfoUserContext) error
	Login(*LoginUserContext) error
	Logout(*LogoutUserContext) error
	Register(*RegisterUserContext) error
}

UserController is the controller interface for the User actions.

type UserPayload

type UserPayload struct {
	// User Email
	UserEmail string `form:"UserEmail" json:"UserEmail" xml:"UserEmail"`
	// User Id
	UserID int `form:"UserId" json:"UserId" xml:"UserId"`
	// User Name
	UserName string `form:"UserName" json:"UserName" xml:"UserName"`
}

User data payload

func (*UserPayload) Validate

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

Validate validates the UserPayload type instance.

type Usercommonresponse

type Usercommonresponse struct {
	// Response code
	Code string `form:"code" json:"code" xml:"code"`
	// Response Message
	Message string `form:"message" json:"message" xml:"message"`
	// Error Code
	Status int `form:"status" json:"status" xml:"status"`
}

This will be a common response for most the user end points (default view)

Identifier: application/vnd.usercommonresponse; view=default

func (*Usercommonresponse) Validate

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

Validate validates the Usercommonresponse media type instance.

type Userdataresponse

type Userdataresponse struct {
	// Response code
	Code string `form:"code" json:"code" xml:"code"`
	// User Info
	Data *UserPayload `form:"data" json:"data" xml:"data"`
	// Response Message
	Message string `form:"message" json:"message" xml:"message"`
	// Error Code
	Status int `form:"status" json:"status" xml:"status"`
}

This will be response when user/info endpoint called (default view)

Identifier: application/vnd.userdataresponse; view=default

func (*Userdataresponse) Validate

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

Validate validates the Userdataresponse media type instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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