validations

package
v0.0.0-...-847e23e Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeEmailRequest

type ChangeEmailRequest struct {
	Email    string `validate:"required,email,max=64" json:"email"`
	Password string `validate:"required,password" json:"password"`
}

ChangeEmailRequest is the request body for updating a user's email

type ChangePasswordRequest

type ChangePasswordRequest struct {
	CurrentPassword string `validate:"required,password" json:"current_password"`
	NewPassword     string `validate:"required,password" json:"new_password"`
}

ChangePasswordRequest is the request body for updating a user's password

type ChangePasswordWithEmailRequest

type ChangePasswordWithEmailRequest struct {
	Email            string `validate:"required,email,min=5,max=64" json:"email"`
	NewPassword      string `validate:"required,min=8,max=64,password" json:"new_password"`
	VerificationCode string `validate:"required" json:"verification_code"`
}

type ChangePasswordWithPhoneNumberRequest

type ChangePasswordWithPhoneNumberRequest struct {
	PhoneNumber      string `validate:"required,min=10" json:"phone_number"`
	NewPassword      string `validate:"required,min=8,max=64,password" json:"new_password"`
	VerificationCode string `validate:"required" json:"verification_code"`
}

type DeleteSessionRequest

type DeleteSessionRequest struct {
	RefreshToken string `validate:"required" json:"refresh_token"`
}

type ErrorResponse

type ErrorResponse struct {
	Field    string `json:"field"`
	Reason   string `json:"reason"`
	Expected string `json:"expected,omitempty"`
}

func ValidateStruct

func ValidateStruct(validatorStruct interface{}) []ErrorResponse

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `validate:"required" json:"refresh_token"`
}

type ResetPasswordCompleteRequest

type ResetPasswordCompleteRequest struct {
	Email    string `validate:"required,email,min=5,max=64" json:"email"`
	Token    string `validate:"required" json:"token"`
	Password string `validate:"required,min=8,max=64,password" json:"password"`
}

type ResetPasswordRequest

type ResetPasswordRequest struct {
	Email string `validate:"required,email,min=5,max=64" json:"email"`
}

type ResetPasswordWithPhoneNumberRequest

type ResetPasswordWithPhoneNumberRequest struct {
	PhoneNumber string `validate:"required,min=10" json:"phone_number"`
}

type SendVerificationCodeRequest

type SendVerificationCodeRequest struct {
	Type string `validate:"required" json:"type"`
}

SendVerificationCodeRequest is the request body for sending a verification email or phone

type SignInRequest

type SignInRequest struct {
	Email    string `validate:"required,email" json:"email"`
	Password string `validate:"required,password" json:"password"`
}

type SignInWithPhoneNumber

type SignInWithPhoneNumber struct {
	PhoneNumber string `validate:"required,min=10" json:"phone_number"`
	Password    string `validate:"required,min=8,max=64,password" json:"password"`
}

type SignUpRequest

type SignUpRequest struct {
	Name     string `validate:"required,min=3,max=64"`
	Email    string `validate:"required,email"`
	Password string `validate:"required,password"`
}

type SocialAuth

type SocialAuth struct {
	Provider string `validate:"required" json:"provider"`
	Name     string `validate:"max=64,omitempty" json:"name"`
	Code     string `validate:"required,min=10" json:"code"`
	Email    string `validate:"max=64,omitempty" json:"email"`
	UserId   string `validate:"omitempty" json:"user_id"`
	Picture  string `validate:"omitempty" json:"picture"`
}

type SocialAuthComplete

type SocialAuthComplete struct {
	Name  string `validate:"required,max=64" json:"name"`
	Email string `validate:"required,email,min=5,max=64" json:"email"`
}

type StoreDeviceInfoRequest

type StoreDeviceInfoRequest struct {
	Name  string `json:"device_name"`
	IP    string `json:"device_ip"`
	OS    string `json:"device_os"`
	Token string `json:"device_token"`
}

type UserPhoneNumberUpdateRequest

type UserPhoneNumberUpdateRequest struct {
	PhoneNumber string `validate:"required" json:"phone_number"`
}

UserPhoneNumberUpdateRequest is the request body for updating a user's phone number

type UserProfileUpdateRequest

type UserProfileUpdateRequest struct {
	Picture   string `json:"picture,omitempty" validate:"omitempty,url"`
	Gender    string `json:"gender,omitempty" validate:"oneof=F M O,omitempty,max=1"`
	Birthdate string `json:"birthdate,omitempty" validate:"omitempty"`
	Education string `json:"education,omitempty" validate:"omitempty"`
	Locale    string `json:"locale,omitempty" validate:"omitempty"`
	Timezone  string `json:"timezone,omitempty" validate:"omitempty"`
}

UserProfileUpdateRequest @Description User profile update request

type UserUpdateRequest

type UserUpdateRequest struct {
	Name string `json:"name,omitempty" validate:"omitempty,min=2,max=50"`
}

UserUpdateRequest @Description User update request

type VerifyEmailRequest

type VerifyEmailRequest struct {
	VerificationCode string `validate:"required" json:"verification_code"`
}

type VerifyPhoneRequest

type VerifyPhoneRequest struct {
	VerificationCode string `validate:"required" json:"verification_code"`
}

type VerifyRequest

type VerifyRequest struct {
	Code string `validate:"required" json:"code"`
}

VerifyRequest is the request body for verifying a user's email

Jump to

Keyboard shortcuts

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