Documentation ¶
Index ¶
- Constants
- func WithSvcOptAddress(r string) *config.Option
- func WithSvcOptDbConf(r driver.DbConnectorConfig) *config.Option
- func WithSvcOptHandler(r *ApiHandler) *config.Option
- type APIResponse
- type ApiHandler
- func (api *ApiHandler) CreateBooking(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) CreateCustomer(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) CreateDriver(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) DeleteCustomer(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) DeleteDriver(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) GetAddress(w http.ResponseWriter, r *http.Request)
- func (api ApiHandler) GetAuthToken(r *http.Request) string
- func (api *ApiHandler) GetBooking(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) GetCustomer(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) GetCustomerCoords(w http.ResponseWriter, r *http.Request, mobile string)
- func (api *ApiHandler) GetDriver(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) GetDriverCoords(w http.ResponseWriter, r *http.Request, mobile string)
- func (api *ApiHandler) GetDriversList(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) GetLocation(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) IndexPage(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) Login(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) Logout(w http.ResponseWriter, r *http.Request)
- func (api ApiHandler) ReplyErrContent(w http.ResponseWriter, r *http.Request, code int, msg string)
- func (api *ApiHandler) UpdateBooking(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateBookingCustomerStatus(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateBookingDriverStatus(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateBookingDropTime(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateBookingPickupTime(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateCustomer(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateCustomerCoords(w http.ResponseWriter, r *http.Request, loc models.Location)
- func (api *ApiHandler) UpdateCustomerOtp(w http.ResponseWriter, r *http.Request, otp models.Otp)
- func (api *ApiHandler) UpdateCustomerPassword(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateCustomerStatus(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateDriver(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateDriverCoords(w http.ResponseWriter, r *http.Request, loc models.Location)
- func (api *ApiHandler) UpdateDriverOtp(w http.ResponseWriter, r *http.Request, otp models.Otp)
- func (api *ApiHandler) UpdateDriverPassword(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateDriverStatus(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateLocation(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateOtp(w http.ResponseWriter, r *http.Request)
- func (api *ApiHandler) UpdateVehicleStatus(w http.ResponseWriter, r *http.Request)
- type Service
Constants ¶
View Source
const ( MsgLoginOkay = "Login successful" MsgStatusOK = "Success" MsgStatusNOK = "Error" )
Variables ¶
This section is empty.
Functions ¶
func WithSvcOptAddress ¶
WithSvcOptAddress opts for port#
func WithSvcOptDbConf ¶
func WithSvcOptDbConf(r driver.DbConnectorConfig) *config.Option
WithSvcOptDbConf opts for db connector
func WithSvcOptHandler ¶
func WithSvcOptHandler(r *ApiHandler) *config.Option
WithSvcOptHandler opts for handler
Types ¶
type APIResponse ¶
type ApiHandler ¶
type ApiHandler struct { }
func (*ApiHandler) CreateBooking ¶
func (api *ApiHandler) CreateBooking(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) CreateCustomer ¶
func (api *ApiHandler) CreateCustomer(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) CreateDriver ¶
func (api *ApiHandler) CreateDriver(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) DeleteCustomer ¶
func (api *ApiHandler) DeleteCustomer(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) DeleteDriver ¶
func (api *ApiHandler) DeleteDriver(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) GetAddress ¶
func (api *ApiHandler) GetAddress(w http.ResponseWriter, r *http.Request)
func (ApiHandler) GetAuthToken ¶
func (api ApiHandler) GetAuthToken(r *http.Request) string
func (*ApiHandler) GetBooking ¶
func (api *ApiHandler) GetBooking(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) GetCustomer ¶
func (api *ApiHandler) GetCustomer(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) GetCustomerCoords ¶
func (api *ApiHandler) GetCustomerCoords(w http.ResponseWriter, r *http.Request, mobile string)
func (*ApiHandler) GetDriver ¶
func (api *ApiHandler) GetDriver(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) GetDriverCoords ¶
func (api *ApiHandler) GetDriverCoords(w http.ResponseWriter, r *http.Request, mobile string)
func (*ApiHandler) GetDriversList ¶
func (api *ApiHandler) GetDriversList(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) GetLocation ¶
func (api *ApiHandler) GetLocation(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) IndexPage ¶
func (api *ApiHandler) IndexPage(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) Login ¶
func (api *ApiHandler) Login(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) Logout ¶
func (api *ApiHandler) Logout(w http.ResponseWriter, r *http.Request)
func (ApiHandler) ReplyErrContent ¶
func (api ApiHandler) ReplyErrContent(w http.ResponseWriter, r *http.Request, code int, msg string)
ReplyErrContent send 204 msg
http.StatusNoContent http.StatusText(http.StatusNoContent)
func (*ApiHandler) UpdateBooking ¶
func (api *ApiHandler) UpdateBooking(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateBookingCustomerStatus ¶
func (api *ApiHandler) UpdateBookingCustomerStatus(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateBookingDriverStatus ¶
func (api *ApiHandler) UpdateBookingDriverStatus(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateBookingDropTime ¶
func (api *ApiHandler) UpdateBookingDropTime(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateBookingPickupTime ¶
func (api *ApiHandler) UpdateBookingPickupTime(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateCustomer ¶
func (api *ApiHandler) UpdateCustomer(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateCustomerCoords ¶
func (api *ApiHandler) UpdateCustomerCoords(w http.ResponseWriter, r *http.Request, loc models.Location)
func (*ApiHandler) UpdateCustomerOtp ¶
func (api *ApiHandler) UpdateCustomerOtp(w http.ResponseWriter, r *http.Request, otp models.Otp)
func (*ApiHandler) UpdateCustomerPassword ¶
func (api *ApiHandler) UpdateCustomerPassword(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateCustomerStatus ¶
func (api *ApiHandler) UpdateCustomerStatus(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateDriver ¶
func (api *ApiHandler) UpdateDriver(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateDriverCoords ¶
func (api *ApiHandler) UpdateDriverCoords(w http.ResponseWriter, r *http.Request, loc models.Location)
func (*ApiHandler) UpdateDriverOtp ¶
func (api *ApiHandler) UpdateDriverOtp(w http.ResponseWriter, r *http.Request, otp models.Otp)
func (*ApiHandler) UpdateDriverPassword ¶
func (api *ApiHandler) UpdateDriverPassword(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateDriverStatus ¶
func (api *ApiHandler) UpdateDriverStatus(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateLocation ¶
func (api *ApiHandler) UpdateLocation(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateOtp ¶
func (api *ApiHandler) UpdateOtp(w http.ResponseWriter, r *http.Request)
func (*ApiHandler) UpdateVehicleStatus ¶
func (api *ApiHandler) UpdateVehicleStatus(w http.ResponseWriter, r *http.Request)
type Service ¶
type Service struct { Router *chi.Mux Address string Api *ApiHandler Config driver.DbConnectorConfig DB *sql.DB Context context.Context }
var ApiService *Service
api global handler
func NewService ¶
NewService service new instance
func (*Service) BearerChecker ¶
BearerChecker check token
Click to show internal directories.
Click to hide internal directories.