Documentation ¶
Index ¶
- Constants
- type Booking
- func (u *Booking) Bind(r *http.Request) error
- func (u *Booking) CreateBooking(ctx context.Context, db *sql.DB, data *Booking) (bool, error)
- func (u *Booking) DeleteBooking(ctx context.Context, db *sql.DB, id string) (bool, error)
- func (u *Booking) Exists(ctx context.Context, db *sql.DB, id int) int
- func (u *Booking) GetBooking(ctx context.Context, db *sql.DB, id string) (*Booking, error)
- func (u *Booking) UpdateBooking(ctx context.Context, db *sql.DB, data *Booking) (bool, error)
- func (u *Booking) UpdateBookingDropoffTime(ctx context.Context, db *sql.DB, data *Booking) (bool, error)
- func (u *Booking) UpdateBookingPickupTime(ctx context.Context, db *sql.DB, data *Booking) (bool, error)
- func (u *Booking) UpdateBookingStatus(ctx context.Context, db *sql.DB, data *Booking) (bool, error)
- type ChangePassworInfo
- type ChangeStatusInfo
- type Customer
- func (u *Customer) Bind(r *http.Request) error
- func (u *Customer) CreateCustomer(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) DeleteCustomer(ctx context.Context, db *sql.DB, mobile string) (bool, error)
- func (u *Customer) Exists(ctx context.Context, db *sql.DB, mobile string) int
- func (u *Customer) GetCustomer(ctx context.Context, db *sql.DB, mobile string) (*Customer, error)
- func (u *Customer) UpdateCustomer(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) UpdateCustomerCoords(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) UpdateCustomerOtp(ctx context.Context, db *sql.DB, mobile, otp, otpexp string) (bool, error)
- func (u *Customer) UpdateCustomerOtpExpiry(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) UpdateCustomerPass(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) UpdateCustomerPassTmp(ctx context.Context, db *sql.DB, data *Customer) (bool, error)
- func (u *Customer) UpdateCustomerStatus(ctx context.Context, db *sql.DB, status, mobile string) (bool, error)
- type DriveListInfo
- type Driver
- func (u *Driver) Bind(r *http.Request) error
- func (u *Driver) CreateDriver(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) DeleteDriver(ctx context.Context, db *sql.DB, mobile string) (bool, error)
- func (u *Driver) Exists(ctx context.Context, db *sql.DB, mobile string) int
- func (u *Driver) GetDriver(ctx context.Context, db *sql.DB, mobile string) (*Driver, error)
- func (u *Driver) GetDriversNearestLocation(ctx context.Context, db *sql.DB, lat, lon float64, distance int) ([]DriveListInfo, error)
- func (u *Driver) UpdateDriver(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) UpdateDriverCoords(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) UpdateDriverOtp(ctx context.Context, db *sql.DB, mobile, otp, otpexp string) (bool, error)
- func (u *Driver) UpdateDriverOtpExpiry(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) UpdateDriverPass(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) UpdateDriverPassTmp(ctx context.Context, db *sql.DB, data *Driver) (bool, error)
- func (u *Driver) UpdateDriverStatus(ctx context.Context, db *sql.DB, status, mobile string) (bool, error)
- func (u *Driver) UpdateDriverVehicleStatus(ctx context.Context, db *sql.DB, status, mobile string, lat, lon float64) (bool, error)
- type Location
- type Otp
- type User
- type UserLogin
- type VehicleStatusInfo
Constants ¶
View Source
const ( NearestDistance = 50 //km distance nearest NearestTopCount = 10 //top# nearest distance VehicleStatusOpen = "open" VehicleStatusBooked = "booked" VehicleStatusCanceled = "canceled" VehicleStatusTripStart = "trip-start" VehicleStatusTripEnd = "trip-end" VehicleStatusCompleted = "completed" VehicleStatusGasUp = "gas-up" VehicleStatusPanic = "panic" )
View Source
const ( UserTypeCustomer = "customer" UserTypeDriver = "driver" )
View Source
const ( UserStatusPending = "pending" UserStatusActive = "active" UserStatusDeleted = "deleted" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Booking ¶
type Booking struct { ID int64 `json:"id"` MobileCustomer string `json:"mobile_customer"` MobileDriver string `json:"mobile_driver"` Src string `json:"src"` SrcLatitude float64 `json:"src_latitude"` SrcLongitude float64 `json:"src_longitude"` Dst string `json:"dst"` DstLatitude float64 `json:"dst_latitude"` DstLongitude float64 `json:"dst_longitude"` Status string `json:"status"` PickupTime string `json:"pickup_time"` Dropofftime string `json:"dropoff_time"` Remarks string `json:"remarks"` RemarksBy string `json:"remarks_by"` Created string `json:"created"` Modified string `json:"modified"` }
func (*Booking) CreateBooking ¶
func (*Booking) DeleteBooking ¶
func (*Booking) GetBooking ¶
func (*Booking) UpdateBooking ¶
func (*Booking) UpdateBookingDropoffTime ¶
func (*Booking) UpdateBookingPickupTime ¶
type ChangePassworInfo ¶
type ChangeStatusInfo ¶
type Customer ¶
type Customer User
func (*Customer) CreateCustomer ¶
func (*Customer) DeleteCustomer ¶
func (*Customer) GetCustomer ¶
func (*Customer) UpdateCustomer ¶
func (*Customer) UpdateCustomerCoords ¶
func (*Customer) UpdateCustomerOtp ¶
func (*Customer) UpdateCustomerOtpExpiry ¶
func (*Customer) UpdateCustomerPass ¶
func (*Customer) UpdateCustomerPassTmp ¶
type DriveListInfo ¶
type DriveListInfo struct { ID int64 `json:"id"` Mobile string `json:"mobile"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Status string `json:"status"` VehicleStatus string `json:"vehicle_status"` Distance float64 `json:"distance"` }
type Driver ¶
type Driver User
func (*Driver) CreateDriver ¶
func (*Driver) DeleteDriver ¶
func (*Driver) GetDriversNearestLocation ¶
func (*Driver) UpdateDriver ¶
func (*Driver) UpdateDriverCoords ¶
func (*Driver) UpdateDriverOtp ¶
func (*Driver) UpdateDriverOtpExpiry ¶
func (*Driver) UpdateDriverPass ¶
func (*Driver) UpdateDriverPassTmp ¶
func (*Driver) UpdateDriverStatus ¶
type Location ¶
type User ¶
type User struct { ID int64 `json:"id"` Mobile string `json:"mobile"` Firstname string `json:"firstname"` Lastname string `json:"lastname"` Status string `json:"status"` Pass string `json:"pass"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Created string `json:"created"` Modified string `json:"modified"` Type string `json:"type"` VehicleStatus string `json:"-"` Otp string `json:"otp"` OtpExpiry string `json:"otp_expiry"` Logged int `json:"logged"` OtpExpired int `json:"-"` }
Click to show internal directories.
Click to hide internal directories.