request

package
v0.0.0-...-afd247e Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriverRegRequest

type DriverRegRequest struct {
	Id            primitive.ObjectID `json:"id"`
	LicenseNumber string             `json:"licenseNumber"`
	DateOfBirth   time.Time          `json:"dateOfBirth"`
	Firstnames    string             `json:"firstnames"`
	Surname       string             `json:"surname"`
}

func (*DriverRegRequest) Reg

func (r *DriverRegRequest) Reg() (*model.Driver, error)

type EmailVerifyRequest

type EmailVerifyRequest struct {
	Email string `query:"email" valid:"email"`
	Token string `query:"token" valid:"required"`
}

func (*EmailVerifyRequest) Verify

func (e *EmailVerifyRequest) Verify() (*model.User, error)

type ExistanceRequest

type ExistanceRequest struct {
	Phone   string `json:"phone"`
	Email   string `json:"email"`
	License string `json:"license"`
}

func (*ExistanceRequest) Check

func (r *ExistanceRequest) Check() map[string]bool

type ForgetPasswordRequest

type ForgetPasswordRequest struct {
	Phone    string `json:"phone" valid:"numeric,stringlength(8|11),optional"`
	Email    string `json:"email" valid:"email,optional"`
	Token    string `json:"token" valid:"required"`
	Password string `json:"password" valid:"stringlength(6|32)"`
}

func (*ForgetPasswordRequest) Verify

func (r *ForgetPasswordRequest) Verify() (err error)

type LoginRequest

type LoginRequest struct {
	Phone    string `json:"phone"`
	Email    string `json:"email"`
	License  string `json:"license"`
	Password string `json:"password"`
}

func (*LoginRequest) PasswordLogin

func (r *LoginRequest) PasswordLogin() (*model.User, error)

type RefreshTokenRequest

type RefreshTokenRequest struct {
	Token string `json:"token"`
}

func (*RefreshTokenRequest) Validate

func (r *RefreshTokenRequest) Validate(c config.Config) (*model.User, error)

type TransportOperatorRegRequest

type TransportOperatorRegRequest struct {
	Id            primitive.ObjectID `json:"id"`
	LicenseNumber string             `json:"licenseNumber"`
	Name          string             `json:"name"`
}

func (*TransportOperatorRegRequest) Reg

type UserRegRequest

type UserRegRequest struct {
	Phone    string `json:"phone" valid:"numeric,stringlength(8|11)"`
	Code     string `json:"code" valid:"numeric"`
	Email    string `json:"email" valid:"email"`
	Password string `json:"password" valid:"stringlength(6|32)"`
}

func (*UserRegRequest) Reg

func (r *UserRegRequest) Reg() (*model.User, error)

type UserUpdateRequest

type UserUpdateRequest struct {
	Password string `json:"password" valid:"stringlength(6|32)"`
}

func (*UserUpdateRequest) Replace

func (r *UserUpdateRequest) Replace(user *model.User) (err error)

type VehicleCreateRequest

type VehicleCreateRequest struct {
	DriverId     primitive.ObjectID `json:"driverId" valid:"-"`
	Registration string             `json:"registration" valid:"numeric,stringlength(5|9)"`
	IsDiesel     bool               `json:"isDiesel" valid:"required"`
}

func (*VehicleCreateRequest) Create

func (r *VehicleCreateRequest) Create() (*model.Vehicle, error)

type VerificationRequest

type VerificationRequest struct {
	Phone string `json:"phone"`
	Email string `json:"email"`
}

func (*VerificationRequest) Send

func (r *VerificationRequest) Send() (err error)

Jump to

Keyboard shortcuts

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