client

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserPath

func CreateUserPath() string

CreateUserPath computes a request path to the create action of user.

func FindByEmailUserPath

func FindByEmailUserPath() string

FindByEmailUserPath computes a request path to the findByEmail action of user.

func FindUserPath

func FindUserPath() string

FindUserPath computes a request path to the find action of user.

func FindUsersUserPath

func FindUsersUserPath() string

FindUsersUserPath computes a request path to the findUsers action of user.

func ForgotPasswordUpdateUserPath

func ForgotPasswordUpdateUserPath() string

ForgotPasswordUpdateUserPath computes a request path to the forgotPasswordUpdate action of user.

func ForgotPasswordUserPath

func ForgotPasswordUserPath() string

ForgotPasswordUserPath computes a request path to the forgotPassword action of user.

func GetAllUserPath

func GetAllUserPath() string

GetAllUserPath computes a request path to the getAll action of user.

func GetMeUserPath

func GetMeUserPath() string

GetMeUserPath computes a request path to the getMe action of user.

func GetUserPath

func GetUserPath(userID string) string

GetUserPath computes a request path to the get action of user.

func ResetVerificationTokenUserPath

func ResetVerificationTokenUserPath() string

ResetVerificationTokenUserPath computes a request path to the resetVerificationToken action of user.

func UpdateUserPath

func UpdateUserPath(userID string) string

UpdateUserPath computes a request path to the update action of user.

func VerifyUserPath

func VerifyUserPath() string

VerifyUserPath computes a request path to the verify 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) CreateUser

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

Creates user

func (*Client) DecodeErrorResponse

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

DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.

func (*Client) DecodeResetToken

func (c *Client) DecodeResetToken(resp *http.Response) (*ResetToken, error)

DecodeResetToken decodes the ResetToken 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) DecodeUsersPage

func (c *Client) DecodeUsersPage(resp *http.Response) (*UsersPage, error)

DecodeUsersPage decodes the UsersPage 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) FindByEmailUser

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

Find a user by email

func (*Client) FindUser

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

Find a user by email+password

func (*Client) FindUsersUser

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

Find (filter) users by some filter.

func (*Client) ForgotPasswordUpdateUser

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

Password token validation & password update

func (*Client) ForgotPasswordUser

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

Forgot password action (sending email to user with link for resseting password)

func (*Client) GetAllUser

func (c *Client) GetAllUser(ctx context.Context, path string, limit *int, offset *int, order *string, sorting *string) (*http.Response, error)

Retrieves all active users

func (*Client) GetMeUser

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

Retrieves the user information for the authenticated user

func (*Client) GetUser

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

Get user by id

func (*Client) NewCreateUserRequest

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

NewCreateUserRequest create the request corresponding to the create action endpoint of the user resource.

func (*Client) NewFindByEmailUserRequest

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

NewFindByEmailUserRequest create the request corresponding to the findByEmail action endpoint of the user resource.

func (*Client) NewFindUserRequest

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

NewFindUserRequest create the request corresponding to the find action endpoint of the user resource.

func (*Client) NewFindUsersUserRequest

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

NewFindUsersUserRequest create the request corresponding to the findUsers action endpoint of the user resource.

func (*Client) NewForgotPasswordUpdateUserRequest

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

NewForgotPasswordUpdateUserRequest create the request corresponding to the forgotPasswordUpdate action endpoint of the user resource.

func (*Client) NewForgotPasswordUserRequest

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

NewForgotPasswordUserRequest create the request corresponding to the forgotPassword action endpoint of the user resource.

func (*Client) NewGetAllUserRequest

func (c *Client) NewGetAllUserRequest(ctx context.Context, path string, limit *int, offset *int, order *string, sorting *string) (*http.Request, error)

NewGetAllUserRequest create the request corresponding to the getAll action endpoint of the user resource.

func (*Client) NewGetMeUserRequest

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

NewGetMeUserRequest create the request corresponding to the getMe action endpoint of the user resource.

func (*Client) NewGetUserRequest

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

NewGetUserRequest create the request corresponding to the get action endpoint of the user resource.

func (*Client) NewResetVerificationTokenUserRequest

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

NewResetVerificationTokenUserRequest create the request corresponding to the resetVerificationToken action endpoint of the user resource.

func (*Client) NewUpdateUserRequest

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

NewUpdateUserRequest create the request corresponding to the update action endpoint of the user resource.

func (*Client) NewVerifyUserRequest

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

NewVerifyUserRequest create the request corresponding to the verify action endpoint of the user resource.

func (*Client) ResetVerificationTokenUser

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

Reset verification token

func (*Client) UpdateUser

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

Update user

func (*Client) VerifyUser

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

Verify a user by token

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 FilterPayload

type FilterPayload struct {
	// Users filter.
	Filter []*FilterProperty `form:"filter,omitempty" json:"filter,omitempty" yaml:"filter,omitempty" xml:"filter,omitempty"`
	// Page number (1-based).
	Page int `form:"page" json:"page" yaml:"page" xml:"page"`
	// Items per page.
	PageSize int `form:"pageSize" json:"pageSize" yaml:"pageSize" xml:"pageSize"`
	// Sort specification.
	Sort *OrderSpec `form:"sort,omitempty" json:"sort,omitempty" yaml:"sort,omitempty" xml:"sort,omitempty"`
}

FilterPayload user type.

func (*FilterPayload) Validate

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

Validate validates the FilterPayload type instance.

type FilterProperty

type FilterProperty struct {
	// Property name
	Property string `form:"property" json:"property" yaml:"property" xml:"property"`
	// Property value to match
	Value string `form:"value" json:"value" yaml:"value" xml:"value"`
}

FilterProperty user type.

func (*FilterProperty) Validate

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

Validate validates the FilterProperty type instance.

type ForgotPasswordPayload

type ForgotPasswordPayload struct {
	// Email of the user
	Email *string `form:"email,omitempty" json:"email,omitempty" yaml:"email,omitempty" xml:"email,omitempty"`
	// New password
	Password string `form:"password" json:"password" yaml:"password" xml:"password"`
	// Forgot password token
	Token string `form:"token" json:"token" yaml:"token" xml:"token"`
}

Password Reset payload

func (*ForgotPasswordPayload) Validate

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

Validate validates the ForgotPasswordPayload type instance.

type OrderSpec

type OrderSpec struct {
	// Sort order. Can be 'asc' or 'desc'.
	Direction string `form:"direction" json:"direction" yaml:"direction" xml:"direction"`
	// Sort by property
	Property string `form:"property" json:"property" yaml:"property" xml:"property"`
}

OrderSpec user type.

func (*OrderSpec) Validate

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

Validate validates the OrderSpec type instance.

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

func (*Users) Validate

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

Validate validates the Users media type instance.

type UsersPage

type UsersPage struct {
	// Users list
	Items []*Users `form:"items,omitempty" json:"items,omitempty" yaml:"items,omitempty" xml:"items,omitempty"`
	// Page number (1-based).
	Page *int `form:"page,omitempty" json:"page,omitempty" yaml:"page,omitempty" xml:"page,omitempty"`
	// Items per page.
	PageSize *int `form:"pageSize,omitempty" json:"pageSize,omitempty" yaml:"pageSize,omitempty" xml:"pageSize,omitempty"`
}

UsersPage media type (default view)

Identifier: application/mt.ckan.users-page+json; view=default

func (*UsersPage) Validate

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

Validate validates the UsersPage media type instance.

Jump to

Keyboard shortcuts

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