Documentation
¶
Index ¶
- Constants
- type AssumableServiceType
- type Centroid
- type Country
- type Fastpay
- type FastpayCountry
- type GeoInfo
- type GoingHome
- type H2HobService
- type H4B
- type Hob
- type HobData
- type HobService
- type HobStatus
- type HobsCache
- type I18nText
- type Icons
- type JobSettings
- type JsonDuration
- type Location
- type Misc
- type MockHobsCache
- type Phone
- type Prebook
- type Priority
- type ServiceType
- func GetServiceType(hob string, serviceType string) (*ServiceType, error)
- func GetTieredServiceTypeList(hob string) ([]*ServiceType, error)
- func ProtoToServiceType(s *hobpb.ServiceType) *ServiceType
- func ReadServiceType(scope *server.Request, hob string, serviceType string) (*ServiceType, error)
- func ReadTieredServiceTypeList(scope *server.Request, hob string) ([]*ServiceType, error)
- type ServiceTypeStatus
- type ServiceTypes
- type TieredServiceTypes
- type VehicleOptions
Constants ¶
View Source
const ( HobStatusBeta = HobStatus("BETA") HobStatusEnabled = HobStatus("ENABLED") HobStatusDisabled = HobStatus("DISABLED") HobStatusHidden = HobStatus("HIDDEN") )
View Source
const ( ServiceTypeStatusEnabled = ServiceTypeStatus("ENABLED") ServiceTypeStatusDisabled = ServiceTypeStatus("DISABLED") ServiceTypeStatusBeta = ServiceTypeStatus("BETA") )
View Source
const ( GoingHomeDisabled = GoingHome("DISABLED") GoingHomeAlways = GoingHome("ALWAYS") GoingHomePriority = GoingHome("PRIORITY") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssumableServiceType ¶
type AssumableServiceType struct { Id string `json:"id"` // service type AlwaysAssume bool `json:"alwaysAssume"` // Always assume this service type AssumeForNewDrivers bool `json:"assumeForNewDrivers"` // Assume for new drivers }
func ProtoToAssumableServiceTypes ¶
func ProtoToAssumableServiceTypes(types []*hobpb.AssumableServiceType) []*AssumableServiceType
type Fastpay ¶
type Fastpay struct { Enabled bool `json:"enabled"` Countries map[string][]FastpayCountry `json:"countries"` }
type FastpayCountry ¶
type H2HobService ¶
type H2HobService struct{}
func (*H2HobService) Multiconfig ¶
func (c *H2HobService) Multiconfig(hobs, hobHashes, serviceTypesHashes []string) (newHobs, newHobsConfigs, newHobsHashes, newServiceTypesConfigs, newServiceTypesHashes []string, err error)
func (*H2HobService) ReadServiceTypes ¶
func (c *H2HobService) ReadServiceTypes(hob string) (ServiceTypes, error)
type Hob ¶
type Hob struct { Code string `json:"code" readOnly:"true"` Name string `json:"name"` Status HobStatus `json:"status" enum:"BETA,ENABLED,DISABLED,HIDDEN"` Country Country `json:"country"` Currency string `json:"currency"` Language string `json:"language"` GeoInfo GeoInfo `json:"geoInfo"` Phone Phone `json:"phone"` Timezone string `json:"timezone"` DefaultLocale string `json:"defaultLocale"` Locale string `json:"locale"` Misc Misc `json:"misc"` FastestFirst bool `json:"fastestFirst"` // Specified whether the "fastest first" feature in the passenger app is enabled H4B H4B `json:"h4b"` Prebook Prebook `json:"prebook"` VehicleOptions VehicleOptions `json:"vehicleOptions"` JobOfferVolumeOverride bool `json:"jobOfferVolumeOverride" description:"Allow user to override job offer volume"` CustomJobRingtone bool `json:"customJobRingtone"` Fastpay Fastpay `json:"fastpay"` }
Hob represents one of our regulatory areas
func ProtoToHob ¶
type HobData ¶
type HobData struct { Hob *Hob `json:"hob"` HobHash string `json:"hobHash"` ServiceTypes ServiceTypes `json:"serviceTypes"` ServiceTypesHash string `json:"serviceTypesHash"` }
type HobService ¶
type HobsCache ¶
type HobsCache interface { ReadHob(hob string) *Hob ReadServiceTypes(hob string) ServiceTypes }
var (
Cache HobsCache = MemoryHobsCache()
)
func MemoryHobsCache ¶
func MemoryHobsCache() HobsCache
type Icons ¶
type Icons struct { SelectorActive string `json:"selectorActive"` SelectorInactive string `json:"selectorInactive"` PrebookList string `json:"prebookList"` }
func ProtoToIcons ¶
type JobSettings ¶
type JobSettings struct { Enabled bool `json:"enabled"` CashJobs bool `json:"cashJobs"` CardPayment bool `json:"cardPayment"` CardToCashSwitch bool `json:"cardToCashSwitch"` FareScreenType uint32 `json:"fareScreenType"` // fareTypeMeterTip=0, fareTypeMeterTipTollsNoTipOnTolls=1, fareTypeFixedPriceTipTollsNoTipOnTolls=2 FixedToVirtualMeterEnabled bool `json:"fixedToVirtualEnabled"` ShowDriverAllocatedAlert bool `json:"showDriverAllocatedAlert"` SoonToClear bool `json:"soonToClear"` PriorityEnabled bool `json:"priorityEnabled"` // @DEPRECATED remove in favour of struct Priority Priority `json:"priority"` GoingHome GoingHome `json:"goingHome" enum:"DISABLED,ALWAYS,PRIORITY" description:"How do we determine if going home is available"` }
func ProtoToJobSettings ¶
func ProtoToJobSettings(j *hobpb.JobSettings) JobSettings
type JsonDuration ¶
type JsonDuration string
func (JsonDuration) Duration ¶
func (jsonDuration JsonDuration) Duration() time.Duration
type Misc ¶
type Misc struct { DriverTermsUrl string `json:"driverTerms"` // The URL used in the driver app to point to Hailos' Terms&Conditions FallbackOnOsm bool `json:"fallbackOnOsm"` // The flag used in the driver app to indicate whether to use a fallback to Open Street Maps EnableProdDebugMenu bool `json:"enableProdDebugMenu"` DistanceDisplayUnit int32 `json:"distanceDisplayUnit"` // Indicates whether the city uses miles or km in the driver app (MILES_UNIT = 0, KM_UNIT = 1) PayWithHailo bool `json:"payWithHailo"` ShowRouteToPickup bool `json:"showRouteToPickup"` CancellationPolicy string `json:"cancellationPolicy"` // The URL to the Hob cancellation policy ShowStats bool `json:"showStats"` ShowAcceptRate bool `json:"showAcceptRate"` HelpCentreUrl string `json:"helpCentre"` // The URL used in the driver app to point to Hailo Help pages }
miscellaneous fields used by https://github.com/HailoOSS/go-api-lib/blob/master/driverconfig/driverconfig.go#L49 as this is a library not really sure what service to put them, so will stick them here for now.
type MockHobsCache ¶
func (*MockHobsCache) ReadHob ¶
func (c *MockHobsCache) ReadHob(hob string) *Hob
func (*MockHobsCache) ReadServiceTypes ¶
func (c *MockHobsCache) ReadServiceTypes(hob string) ServiceTypes
type Priority ¶
type Priority struct { Enabled bool `json:"enabled"` MorningPeakText string `json:"morningPeakText"` EveningPeakText string `json:"eveningPeakText"` PeakTimeReminder bool `json:"peak_time_reminder"` }
func ProtoToPriority ¶
type ServiceType ¶
type ServiceType struct { Id string `json:"id" readOnly:"true"` Name string `json:"name"` Status ServiceTypeStatus `json:"status" enum:"BETA,ENABLED,DISABLED"` Tier uint32 `json:"tier" description:"Preference order on PMUH screen"` FreeWaitingTime JsonDuration `json:"freeWaitingTime"` MaxUnverifiedFare float64 `json:"maxUnverifiedFare"` // i.e. 50.00 MinAcceptableFare float64 `json:"minAcceptableFare"` // i.e. 2.20 MinUnverifiedFare float64 `json:"minUnverifiedFare"` //i.e. 2.50 MaxFare float64 `json:"maxFare"` // i.e. 999.00 MinFare float64 `json:"minFare"` // i.e. 2.50 FastPayFeePercentage uint32 `json:"fastpayFeePercentage"` FastPayMode uint32 `json:"fastpayMode" enum:"0,1,2" description:"FAST_PAY_DISABLED = 0, FAST_PAY_DRIVER_PAYS = 1, FAST_PAY_CUSTOMER_PAYS = 2" ` // FAST_PAY_DISABLED = 0, FAST_PAY_DRIVER_PAYS = 1, FAST_PAY_CUSTOMER_PAYS = 2 HailoJobSettings JobSettings `json:"hailoJobSettings"` TollsAndExtras bool `json:"tollsAndExtras"` AutoOffShift JsonDuration `json:"autoOffShift"` VirtualMeter bool `json:"virtualMeter" description:"whether the service type uses a virtual meter"` FixedVirtual bool `json:"fixedVirtual" description:"Use fixed fare pricing to calculate virtual meter rate from POB to job end"` PercentOverTaxiRate int32 `json:"percentOverTaxiRate"` MinEta int32 `json:"minEta"` MaxEta int32 `json:"maxEta"` JobHistoryEnabled bool `json:"jobHistoryEnabled"` JobHistoryDeleteEnabled bool `json:"jobHistoryDeleteEnabled"` AlwaysShowDestinationOnOffer bool `json:"alwaysShowDestinationOnOffer"` AssumableServiceTypes []*AssumableServiceType `json:"assumableServiceTypes"` GoingHomeEnabled bool `json:"goingHomeEnabled"` Icons Icons `json:"icons"` VehicleOptions VehicleOptions `json:"vehicleOptions"` }
func GetServiceType ¶
func GetServiceType(hob string, serviceType string) (*ServiceType, error)
ServiceType returns the service type for the given parameters
func GetTieredServiceTypeList ¶
func GetTieredServiceTypeList(hob string) ([]*ServiceType, error)
func ProtoToServiceType ¶
func ProtoToServiceType(s *hobpb.ServiceType) *ServiceType
func ReadServiceType ¶
Deprecated, use GetServiceType(hob, serviceType) instead
func ReadTieredServiceTypeList ¶
func ReadTieredServiceTypeList(scope *server.Request, hob string) ([]*ServiceType, error)
Depricated, use GetTieredServiceTypeList instead
type ServiceTypeStatus ¶
type ServiceTypeStatus string
type ServiceTypes ¶
type ServiceTypes map[string]*ServiceType
func GetServiceTypes ¶
func GetServiceTypes(hob string) (ServiceTypes, error)
ServiceTypes returns all the service types for the given hob
func ReadServiceTypes ¶
func ReadServiceTypes(scope *server.Request, hob string) (ServiceTypes, error)
Deprecated, use ServiceTypes instead
func (ServiceTypes) Ids ¶
func (serviceTypes ServiceTypes) Ids() []string
type TieredServiceTypes ¶
type TieredServiceTypes []*ServiceType
func (TieredServiceTypes) Len ¶
func (t TieredServiceTypes) Len() int
func (TieredServiceTypes) Less ¶
func (t TieredServiceTypes) Less(i, j int) bool
func (TieredServiceTypes) Swap ¶
func (t TieredServiceTypes) Swap(i, j int)
type VehicleOptions ¶
type VehicleOptions struct { Accessible bool `json:"accessible"` // Show accessible on/off switch Passengers []int32 `json:"passengers"` // Number of seats available in vehicles. Ex: 5, 6 }
Options to display to the user when booking for this hob
func ProtoToVehicleOptions ¶
func ProtoToVehicleOptions(vehicleOptions *hobpb.OverrideVehicleOptions) VehicleOptions
Click to show internal directories.
Click to hide internal directories.