models

package
v0.0.0-...-5e1457b Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADMIN_ROLE_ID  = 1
	DRIVER_ROLE_ID = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Trip

type Trip struct {
	Id         uint         `json:"id" db:"trip_id"`
	UserId     uint         `json:"user_id" db:"user_id"`
	StartedAt  time.Time    `json:"started_at" db:"started_at"`
	FinishedAt sql.NullTime `json:"finished_at" db:"finished_at"`
}

type User

type User struct {
	Id        uint   `json:"id" db:"user_id"`
	FirstName string `json:"first_name" db:"first_name"`
	LastName  string `json:"last_name" db:"last_name"`
	Email     string `json:"email" db:"email"`
	Password  string `json:"password" db:"password"`
	RoleId    uint   `json:"role_id" db:"role_id"`
}

func (*User) HashPassword

func (usr *User) HashPassword() error

func (User) MarshalJSON

func (usr User) MarshalJSON() ([]byte, error)

func (*User) ValidatePassword

func (usr *User) ValidatePassword(attemptedPassword string) error

Jump to

Keyboard shortcuts

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