database

package
v0.0.0-...-533293a Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *gorm.DB
)

Functions

This section is empty.

Types

type CarsRepository

type CarsRepository struct {
	DB *gorm.DB
}

func (*CarsRepository) CreateCar

func (c *CarsRepository) CreateCar(car *models.Car) (*models.Car, error)

func (*CarsRepository) DeleteCar

func (c *CarsRepository) DeleteCar(id string) (string, error)

func (*CarsRepository) GetCarByID

func (c *CarsRepository) GetCarByID(id string) (*models.Car, error)

func (*CarsRepository) GetCars

func (c *CarsRepository) GetCars(limit, offset *int) ([]*models.Car, error)

func (*CarsRepository) UpdateCar

func (c *CarsRepository) UpdateCar(id string, car *models.Car) (*models.Car, error)

type DriversRepository

type DriversRepository struct {
	DB *gorm.DB
}

func (*DriversRepository) CreateDriver

func (d *DriversRepository) CreateDriver(driver *models.Driver) (*models.Driver, error)

func (*DriversRepository) Delete

func (d *DriversRepository) Delete(id string) (string, error)

func (*DriversRepository) GetDriverByID

func (d *DriversRepository) GetDriverByID(id string) (*models.Driver, error)

func (*DriversRepository) GetDrivers

func (d *DriversRepository) GetDrivers(limit, offset *int) ([]*models.Driver, error)

func (*DriversRepository) Update

func (d *DriversRepository) Update(id string, driver *models.Driver) (*models.Driver, error)

type UsersRepository

type UsersRepository struct {
	DB *gorm.DB
}

func (*UsersRepository) CreateUser

func (u *UsersRepository) CreateUser(user *models.User) (*models.User, error)

func (*UsersRepository) DeleteUser

func (u *UsersRepository) DeleteUser(id string) (string, error)

func (*UsersRepository) GetAllUsers

func (u *UsersRepository) GetAllUsers(limit, offset *int) ([]*models.User, error)

func (*UsersRepository) GetUserByEmail

func (u *UsersRepository) GetUserByEmail(email string) (*models.User, error)

func (*UsersRepository) GetUserByField

func (u *UsersRepository) GetUserByField(field, value string) (*models.User, error)

func (*UsersRepository) GetUserByID

func (u *UsersRepository) GetUserByID(id string) (*models.User, error)

func (*UsersRepository) UpdateRefresh

func (u *UsersRepository) UpdateRefresh(user *models.User, refreshToken string) (*models.User, error)

func (*UsersRepository) UpdateUser

func (u *UsersRepository) UpdateUser(id string, user *models.User) (*models.User, error)

type WaybillsRepository

type WaybillsRepository struct {
	DB *gorm.DB
}

func (*WaybillsRepository) CreateWaybill

func (w *WaybillsRepository) CreateWaybill(waybill *models.Waybill) (*models.Waybill, error)

func (*WaybillsRepository) DeleteWaybill

func (w *WaybillsRepository) DeleteWaybill(id string) (string, error)

func (*WaybillsRepository) GetAllWaybills

func (w *WaybillsRepository) GetAllWaybills(limit, offset *int) ([]*models.Waybill, error)

func (*WaybillsRepository) GetAllWaybillsByUserID

func (w *WaybillsRepository) GetAllWaybillsByUserID(id string, limit, offset *int) ([]*models.Waybill, error)

func (*WaybillsRepository) GetWaybillByID

func (w *WaybillsRepository) GetWaybillByID(id string) (*models.Waybill, error)

func (*WaybillsRepository) UpdateWaybill

func (w *WaybillsRepository) UpdateWaybill(id string, waybill *models.Waybill) (*models.Waybill, error)

Jump to

Keyboard shortcuts

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