repositories

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBDriverRepository

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

func NewDBDriverRepository

func NewDBDriverRepository(db *sqlx.DB) *DBDriverRepository

func (*DBDriverRepository) AddDriver

func (repo *DBDriverRepository) AddDriver(driver models.User) error

func (*DBDriverRepository) GetDrivers

func (repo *DBDriverRepository) GetDrivers(pageSize uint, pageNum uint) ([]models.User, error)

func (*DBDriverRepository) GetDriversByStatus

func (repo *DBDriverRepository) GetDriversByStatus(pageSize uint, pageNum uint, isOnTrip bool) ([]models.User, error)

type DBTripRepository

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

func NewDBTripRepository

func NewDBTripRepository(db *sqlx.DB) *DBTripRepository

func (*DBTripRepository) FinishTripForDriver

func (repo *DBTripRepository) FinishTripForDriver(driverId uint) error

func (*DBTripRepository) StartNewTripForDriver

func (repo *DBTripRepository) StartNewTripForDriver(driverId uint) error

type DBUserRepository

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

func NewDBUserRepository

func NewDBUserRepository(db *sqlx.DB) *DBUserRepository

func (*DBUserRepository) GetUserByEmail

func (repo *DBUserRepository) GetUserByEmail(email string) (models.User, error)

type DriverRepository

type DriverRepository interface {
	GetDrivers(pageSize uint, pageNum uint) ([]models.User, error)
	GetDriversByStatus(pageSize uint, pageNum uint, isOnTrip bool) ([]models.User, error)
	AddDriver(driver models.User) error
}

type MockRepository

type MockRepository struct {
	Users            map[string]models.User
	AreDriversOnTrip map[string]bool
}

func NewMockRepository

func NewMockRepository(initialUsers ...models.User) *MockRepository

func (*MockRepository) AddDriver

func (repo *MockRepository) AddDriver(driver models.User) error

func (*MockRepository) FinishTripForDriver

func (repo *MockRepository) FinishTripForDriver(driver models.User) error

func (*MockRepository) GetDrivers

func (repo *MockRepository) GetDrivers(pageSize uint, pageNum uint) ([]models.User, error)

func (*MockRepository) GetDriversByStatus

func (repo *MockRepository) GetDriversByStatus(pageSize uint, pageNum uint, isOnTrip bool) ([]models.User, error)

func (*MockRepository) GetUserByEmail

func (repo *MockRepository) GetUserByEmail(email string) (models.User, error)

func (*MockRepository) StartNewTripForDriver

func (repo *MockRepository) StartNewTripForDriver(driver models.User) error

type TripRepository

type TripRepository interface {
	StartNewTripForDriver(driverId uint) error
	FinishTripForDriver(driverId uint) error
}

type UserRepository

type UserRepository interface {
	GetUserByEmail(email string) (models.User, error)
}

Jump to

Keyboard shortcuts

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