client

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InfoUserPath

func InfoUserPath() string

InfoUserPath computes a request path to the info action of user.

func LoginUserPath

func LoginUserPath() string

LoginUserPath computes a request path to the login action of user.

func LogoutUserPath

func LogoutUserPath() string

LogoutUserPath computes a request path to the logout action of user.

func RegisterUserPath

func RegisterUserPath() string

RegisterUserPath computes a request path to the register action of user.

Types

type Client

type Client struct {
	*goaclient.Client
	APIKeySigner goaclient.Signer
	Encoder      *goa.HTTPEncoder
	Decoder      *goa.HTTPDecoder
}

Client is the goaAPIKeyUserAuth service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) DecodeLoginresponse

func (c *Client) DecodeLoginresponse(resp *http.Response) (*Loginresponse, error)

DecodeLoginresponse decodes the Loginresponse instance encoded in resp body.

func (*Client) DecodeRegisteruser

func (c *Client) DecodeRegisteruser(resp *http.Response) (*Registeruser, error)

DecodeRegisteruser decodes the Registeruser instance encoded in resp body.

func (*Client) DecodeUsercommonresponse

func (c *Client) DecodeUsercommonresponse(resp *http.Response) (*Usercommonresponse, error)

DecodeUsercommonresponse decodes the Usercommonresponse instance encoded in resp body.

func (*Client) DecodeUserdataresponse

func (c *Client) DecodeUserdataresponse(resp *http.Response) (*Userdataresponse, error)

DecodeUserdataresponse decodes the Userdataresponse instance encoded in resp body.

func (*Client) InfoUser

func (c *Client) InfoUser(ctx context.Context, path string) (*http.Response, error)

This action is secure with the api_key scheme

func (*Client) LoginUser

func (c *Client) LoginUser(ctx context.Context, path string) (*http.Response, error)

This action does not require auth

func (*Client) LogoutUser

func (c *Client) LogoutUser(ctx context.Context, path string) (*http.Response, error)

This action is secure with the api_key scheme

func (*Client) NewInfoUserRequest

func (c *Client) NewInfoUserRequest(ctx context.Context, path string) (*http.Request, error)

NewInfoUserRequest create the request corresponding to the info action endpoint of the user resource.

func (*Client) NewLoginUserRequest

func (c *Client) NewLoginUserRequest(ctx context.Context, path string) (*http.Request, error)

NewLoginUserRequest create the request corresponding to the login action endpoint of the user resource.

func (*Client) NewLogoutUserRequest

func (c *Client) NewLogoutUserRequest(ctx context.Context, path string) (*http.Request, error)

NewLogoutUserRequest create the request corresponding to the logout action endpoint of the user resource.

func (*Client) NewRegisterUserRequest

func (c *Client) NewRegisterUserRequest(ctx context.Context, path string) (*http.Request, error)

NewRegisterUserRequest create the request corresponding to the register action endpoint of the user resource.

func (*Client) RegisterUser

func (c *Client) RegisterUser(ctx context.Context, path string) (*http.Response, error)

This endpoint will be used to register a user

func (*Client) SetAPIKeySigner

func (c *Client) SetAPIKeySigner(signer goaclient.Signer)

SetAPIKeySigner sets the request signer for the api_key security scheme.

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 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 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.

Jump to

Keyboard shortcuts

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