vlgo

package
Version: v0.0.0-...-c17ea1b Latest Latest
Warning

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

Go to latest
Published: May 30, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageType = &imageTypeList{
	Identity: 0,
	Profile:  1,
}

ImageType types of image requests.

Functions

This section is empty.

Types

type Client

type Client struct {
	User  *UserService
	Image *ImageService
	// contains filtered or unexported fields
}

Client is a Verification Layer client for making requests.

func NewImageService

func NewImageService(httpClient *http.Client) *Client

NewImageService returns a new UserService.

func NewUserService

func NewUserService(httpClient *http.Client) *Client

NewUserService returns a new UserService.

type Enum

type Enum int

Enum a kind of alias for int values.

func (Enum) ValueOfImageType

func (mode Enum) ValueOfImageType() string

ValueOfImageType returns value for ImageType.

type ImageService

type ImageService struct {
	// contains filtered or unexported fields
}

ImageService provides an interface for image endpoints.

func (*ImageService) ImageFileToBase64

func (imageService *ImageService) ImageFileToBase64(filePath string) string

ImageFileToBase64 read image file and creates base64 encoded string.

func (*ImageService) UploadIdentity

func (imageService *ImageService) UploadIdentity(imageUpload ImageUpload) (*ImageUploadResponse, *http.Response, error)

UploadIdentity uploads identity image of user. Takes user id and image path as parameters. Returns image upload response, http response and error.

func (*ImageService) UploadProfile

func (imageService *ImageService) UploadProfile(imageUpload ImageUpload) (*ImageUploadResponse, *http.Response, error)

UploadProfile uploads profile image of user. Takes user id and image path as parameters. Returns image upload response, http response and error.

type ImageUpload

type ImageUpload struct {
	Image  string `json:"image"`
	UserID string `json:"userId"`
}

ImageUpload is request model for image upload.

type ImageUploadResponse

type ImageUploadResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
}

ImageUploadResponse is response model for image upload.

type User

type User struct {
	Country     string `json:"country"`
	DateOfBirth string `json:"dateOfBirth"`
	Name        string `json:"name"`
	Surname     string `json:"surname"`
}

User is request body for sending user data.

type UserResponse

type UserResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Type    string `json:"type"`
	UserID  string `json:"userId,omitempty"`
}

UserResponse is the response model of send user data request.

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService provides an interface for user endpoints.

func (*UserService) SendUserData

func (s *UserService) SendUserData(user User) (*UserResponse, *http.Response, error)

SendUserData sends user data using with Client. Takes user as a parameter. Returns user response, http response and error.

func (*UserService) VerifyUser

func (s *UserService) VerifyUser(verifyUser VerifyUser) (*UserVerificationResponse, *http.Response, error)

VerifyUser verifies user with given user id and language. func (client *Client) VerifyUser(verifyUser VerifyUser) (*UserVerificationResponse, *http.Response, error) {

type UserVerificationResponse

type UserVerificationResponse struct {
	Code             int `json:"code"`
	VerificationRate int `json:"verificationRate"`
}

UserVerificationResponse is response model of user verification request.

type VerifyUser

type VerifyUser struct {
	UserID   string `json:"userId"`
	Language string `json:"language"`
}

VerifyUser is request model of user verification.

Jump to

Keyboard shortcuts

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