cab

package
v0.0.0-...-c435964 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DummyCabs

func DummyCabs(db *pg.DB)

DummyCabs creates dummy cabs

Types

type Cab

type Cab struct {
	ID        string        `json:"id" pg:"type:uuid,default:gen_random_uuid()"`
	Type      model.CabType `json:"type" pg:",notnull"`
	Model     string        `json:"model" pg:",notnull"`
	WorkingAc bool          `json:"workingAC" pg:",notnull"`
	Number    int           `json:"number" pg:",notnull"`
	NamePlate string        `json:"namePlate" pg:",unique,notnull"`
	Pic       string        `json:"pic" pg:",notnull"`
	DriverID  string        `json:"driver" pg:"type:uuid,unique,notnull"`
	Available bool          `json:"available" pg:",use_zero,notnull"`
}

Cab model

type Repo

type Repo struct {
	DB *pg.DB
}

Repo contains all Cab related functions

func (*Repo) GetCabByID

func (cr *Repo) GetCabByID(ID string) (*Cab, error)

GetCabByID gets cab by id

func (*Repo) NearbyCabsSub

func (cr *Repo) NearbyCabsSub(ctx context.Context, input model.NearbyCabInput) (chan []*model.NearbyCab, error)

NearbyCabsSub returns a channel which sends nearby cabs

Jump to

Keyboard shortcuts

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