client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterUserPath

func RegisterUserPath() string

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

func ResendVerificationUserPath

func ResendVerificationUserPath() string

ResendVerificationUserPath computes a request path to the resendVerification action of user.

Types

type Client

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

Client is the user service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) DecodeErrorResponse

func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)

DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.

func (*Client) DecodeUsers

func (c *Client) DecodeUsers(resp *http.Response) (*Users, error)

DecodeUsers decodes the Users instance encoded in resp body.

func (*Client) DownloadSwaggerJSON

func (c *Client) DownloadSwaggerJSON(ctx context.Context, dest string) (int64, error)

DownloadSwaggerJSON downloads swagger.json and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) DownloadSwaggerUI

func (c *Client) DownloadSwaggerUI(ctx context.Context, filename, dest string) (int64, error)

DownloadSwaggerUI downloads /files with the given filename and writes it to the file dest. It returns the number of bytes downloaded in case of success.

func (*Client) NewRegisterUserRequest

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

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

func (*Client) NewResendVerificationUserRequest

func (c *Client) NewResendVerificationUserRequest(ctx context.Context, path string, payload *ResendVerificationPayload, contentType string) (*http.Request, error)

NewResendVerificationUserRequest create the request corresponding to the resendVerification action endpoint of the user resource.

func (*Client) RegisterUser

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

Creates user

func (*Client) ResendVerificationUser

func (c *Client) ResendVerificationUser(ctx context.Context, path string, payload *ResendVerificationPayload, contentType string) (*http.Response, error)

Resends verification email and resets valiation tokens

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

func (*Users) Validate

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

Validate validates the Users media type instance.

Jump to

Keyboard shortcuts

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