Documentation
¶
Index ¶
- Constants
- type Alert
- type AlertTime
- type AlertType
- type Bool
- type Calendar
- type Capacity
- type Client
- func (c *Client) LoadFreeBikeStatus(url string) (*FreeBikeStatusResponse, error)
- func (c *Client) LoadGBFS(url string) (*GBFSResponse, error)
- func (c *Client) LoadGBFSVersions(url string) (*VersionsResponse, error)
- func (c *Client) LoadStationInformation(url string) (*StationInformationResponse, error)
- func (c *Client) LoadStationStatus(url string) (*StationStatusResponse, error)
- func (c *Client) LoadSystemAlerts(url string) (*SystemAlertsResponse, error)
- func (c *Client) LoadSystemCalendar(url string) (*SystemCalendarResponse, error)
- func (c *Client) LoadSystemHours(url string) (*SystemHoursResponse, error)
- func (c *Client) LoadSystemInformation(url string) (*SystemInformationResponse, error)
- func (c *Client) LoadSystemPricingPlans(url string) (*SystemPricingPlansResponse, error)
- func (c *Client) LoadSystemRegions(url string) (*SystemRegionsResponse, error)
- func (c *Client) LoadSystems(url string) ([]System, error)
- func (c *Client) LoadVehicleTypes(url string) (*VehicleTypesResponse, error)
- type Clock
- type DataFeeds
- type Date
- type Feed
- type FormFactor
- type FreeBikeStatus
- type FreeBikeStatusData
- type FreeBikeStatusResponse
- type GBFSResponse
- type Header
- type ID
- type LanguageFeeds
- type Plan
- type Price
- type Pricing
- type PropulsionType
- type Region
- type RentalApps
- type RentalAppsStore
- type RentalHours
- type RentalMethod
- type RentalURIs
- type StationInformation
- type StationInformationData
- type StationInformationResponse
- type StationStatus
- type StationStatusData
- type StationStatusResponse
- type System
- type SystemAlertsData
- type SystemAlertsResponse
- type SystemCalendarData
- type SystemCalendarResponse
- type SystemHoursData
- type SystemHoursResponse
- type SystemInformation
- type SystemInformationResponse
- type SystemPricingPlans
- type SystemPricingPlansResponse
- type SystemRegions
- type SystemRegionsResponse
- type Timestamp
- type UserType
- type VehicleAvailability
- type VehicleType
- type VehicleTypesData
- type VehicleTypesResponse
- type Version
- type VersionsData
- type VersionsResponse
- type Weekday
Constants ¶
View Source
const PropulsionTypeCombustion = "combustion"
View Source
const PropulsionTypeElectric = "electric"
View Source
const PropulsionTypeElectricAssist = "electric_assist"
View Source
const PropulsionTypeHuman = "human"
View Source
const SystemsNABSA = "https://github.com/NABSA/gbfs/raw/master/systems.csv"
North American Bike Share Association URL to systems.csv See https://github.com/NABSA/gbfs#systems-implementing-gbfs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID ID `json:"alert_id"` Type AlertType `json:"type"` Times []AlertTime `json:"times,omitempty"` StationIDs []string `json:"station_ids,omitempty"` RegionIDs []string `json:"region_ids,omitempty"` URL string `json:"url,omitempty"` Summary string `json:"summary"` Description string `json:"description,omitempty"` LastUpdated Timestamp `json:"last_updated,omitempty"` }
type AlertType ¶
type AlertType string
const AlertOther AlertType = "OTHER"
const AlertStationClosure AlertType = "STATION_CLOSURE"
const AlertStationMove AlertType = "STATION_MOVE"
const AlertSystemClosure AlertType = "SYSTEM_CLOSURE"
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents abstraction on top of all GBFS operations
func (*Client) LoadFreeBikeStatus ¶
func (c *Client) LoadFreeBikeStatus(url string) (*FreeBikeStatusResponse, error)
func (*Client) LoadGBFSVersions ¶
func (c *Client) LoadGBFSVersions(url string) (*VersionsResponse, error)
func (*Client) LoadStationInformation ¶
func (c *Client) LoadStationInformation(url string) (*StationInformationResponse, error)
func (*Client) LoadStationStatus ¶
func (c *Client) LoadStationStatus(url string) (*StationStatusResponse, error)
func (*Client) LoadSystemAlerts ¶
func (c *Client) LoadSystemAlerts(url string) (*SystemAlertsResponse, error)
func (*Client) LoadSystemCalendar ¶
func (c *Client) LoadSystemCalendar(url string) (*SystemCalendarResponse, error)
func (*Client) LoadSystemHours ¶
func (c *Client) LoadSystemHours(url string) (*SystemHoursResponse, error)
func (*Client) LoadSystemInformation ¶
func (c *Client) LoadSystemInformation(url string) (*SystemInformationResponse, error)
func (*Client) LoadSystemPricingPlans ¶
func (c *Client) LoadSystemPricingPlans(url string) (*SystemPricingPlansResponse, error)
func (*Client) LoadSystemRegions ¶
func (c *Client) LoadSystemRegions(url string) (*SystemRegionsResponse, error)
func (*Client) LoadSystems ¶
LoadSystem gets URL to systems.csv file and returns parsed systems
func (*Client) LoadVehicleTypes ¶
func (c *Client) LoadVehicleTypes(url string) (*VehicleTypesResponse, error)
type FormFactor ¶
type FormFactor string
const FormFactorBicycle FormFactor = "bicycle"
const FormFactorCar FormFactor = "car"
const FormFactorMoped FormFactor = "moped"
const FormFactorOther FormFactor = "other"
const FormFactorScooter FormFactor = "scooter"
type FreeBikeStatus ¶
type FreeBikeStatus struct { BikeID ID `json:"bike_id"` SystemID ID `json:"system_id"` // added in v3.0-RC Lat float64 `json:"lat"` Lon float64 `json:"lon"` IsReserved Bool `json:"is_reserved"` IsDisabled Bool `json:"is_disabled"` RentalURIs RentalURIs `json:"rental_uris"` // added in v1.1 VehicleTypeID ID `json:"vehicle_type_id"` // added in v2.1-RC LastReported Timestamp `json:"last_reported"` // added in v2.1-RC CurrentRangeMeters float64 `json:"current_range_meters"` // added in v2.1-RC StationID ID `json:"station_id"` // added in v2.1-RC PricingPlanID ID `json:"pricing_plan_id"` // added in v2.1-RC }
type FreeBikeStatusData ¶
type FreeBikeStatusData struct {
Bikes []FreeBikeStatus `json:"bikes"`
}
type FreeBikeStatusResponse ¶
type FreeBikeStatusResponse struct { Header Data FreeBikeStatusData `json:"data"` }
type GBFSResponse ¶
type GBFSResponse struct { Header Data LanguageFeeds `json:"data"` }
GBFSResponse represent a single system or geographic area in which vehicles are operated.
type Header ¶
type Header struct { LastUpdated Timestamp `json:"last_updated"` TTL int `json:"ttl"` Version string `json:"version"` // added in v1.1 }
Every JSON file presented in the specification contains the same common header information at the top level of the JSON response object.
type LanguageFeeds ¶
func (LanguageFeeds) GetDataFeeds ¶
func (lf LanguageFeeds) GetDataFeeds(language string) (*DataFeeds, error)
func (*LanguageFeeds) UnmarshalJSON ¶
func (lf *LanguageFeeds) UnmarshalJSON(data []byte) error
type Plan ¶
type Plan struct { ID ID `json:"plan_id"` URL string `json:"url,omitempty"` Name string `json:"name"` Currency string `json:"currency"` Price Price `json:"price"` IsTaxable Bool `json:"is_taxable"` Description string `json:"description"` PerKmPricing []Pricing `json:"per_km_pricing,omitempty"` // added in v2.1-RC2 PerMinPricing []Pricing `json:"per_min_pricing,omitempty"` // added in v2.1-RC2 }
type PropulsionType ¶
type PropulsionType string
type RentalApps ¶
type RentalApps struct { Android RentalAppsStore `json:"android,omitempty"` IOS RentalAppsStore `json:"ios,omitempty"` }
type RentalAppsStore ¶
type RentalHours ¶
type RentalMethod ¶
type RentalMethod string
const RentalMethodAccountNumber RentalMethod = "ACCOUNTNUMBER"
const RentalMethodAndroidPay RentalMethod = "ANDROIDPAY"
const RentalMethodApplePay RentalMethod = "APPLEPAY"
const RentalMethodCreditCard RentalMethod = "CREDITCARD"
const RentalMethodKey RentalMethod = "KEY"
const RentalMethodPayPass RentalMethod = "PAYPASS"
const RentalMethodPhone RentalMethod = "PHONE"
const RentalMethodTransitCard RentalMethod = "TRANSITCARD"
type RentalURIs ¶
type StationInformation ¶
type StationInformation struct { ID ID `json:"station_id"` Name string `json:"name"` ShortName string `json:"short_name,omitempty"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Address string `json:"address,omitempty"` CrossStreet string `json:"cross_street,omitempty"` RegionID ID `json:"region_id,omitempty"` PostCode string `json:"post_code,omitempty"` RentalMethods []RentalMethod `json:"rental_methods,omitempty"` IsVirtualStation *bool `json:"is_virtual_station,omitempty"` // added in v2.1-RC StationArea interface{} `json:"station_area,omitempty"` // added in v2.1-RC Capacity int `json:"capacity,omitempty"` VehicleCapacity Capacity `json:"vehicle_capacity"` // added in v2.1-RC IsValetStation *bool `json:"is_valet_station,omitempty"` // added in v2.1-RC RentalURIs RentalURIs `json:"rental_uris,omitempty"` // added in v1.1 VehicleTypeCapacity Capacity `json:"vehicle_type_capacity,omitempty"` // added in v2.1 }
type StationInformationData ¶
type StationInformationData struct {
Stations []StationInformation `json:"stations"`
}
type StationInformationResponse ¶
type StationInformationResponse struct { Header Data StationInformationData `json:"data"` }
type StationStatus ¶
type StationStatus struct { ID ID `json:"station_id"` NumBikesAvailable uint `json:"num_bikes_available"` NumBikesDisabled uint `json:"num_bikes_disabled,omitempty"` NumDocksAvailable uint `json:"num_docks_available,omitempty"` IsInstalled Bool `json:"is_installed"` IsRenting Bool `json:"is_renting"` IsReturning Bool `json:"is_returning"` LastReported Timestamp `json:"last_reported"` VehicleTypesAvailable []VehicleAvailability `json:"vehicle_types_available,omitempty"` // added in v2.1-RC VehicleDocksAvailable []VehicleAvailability `json:"vehicle_docks_available"` // added in v2.1-RC }
type StationStatusData ¶
type StationStatusData struct {
Stations []StationStatus `json:"stations"`
}
type StationStatusResponse ¶
type StationStatusResponse struct { Header Data StationStatusData `json:"data"` }
type System ¶
type System struct { ID string `json:"id" db:"id"` CountryCode string `json:"country_code" db:"country_code"` Name string `json:"name" db:"name"` Location string `json:"location" db:"location"` URL string `json:"url" db:"url"` AutoDiscoveryURL string `json:"auto_discovery_url" db:"auto_discovery_url"` }
System represents system publishing GBFS feeds
type SystemAlertsData ¶
type SystemAlertsData struct {
Alerts []Alert `json:"alerts"`
}
type SystemAlertsResponse ¶
type SystemAlertsResponse struct { Header Data SystemAlertsData `json:"data"` }
type SystemCalendarData ¶
type SystemCalendarData struct {
Calendars []Calendar `json:"calendars"`
}
type SystemCalendarResponse ¶
type SystemCalendarResponse struct { Header Data SystemCalendarData `json:"data"` }
type SystemHoursData ¶
type SystemHoursData struct {
RentalHours []RentalHours `json:"rental_hours"`
}
type SystemHoursResponse ¶
type SystemHoursResponse struct { Header Data SystemHoursData `json:"data"` }
type SystemInformation ¶
type SystemInformation struct { SystemID ID `json:"system_id"` Language string `json:"language"` Name string `json:"name"` ShortName string `json:"short_name,omitempty"` Operator string `json:"operator,omitempty"` URL string `json:"url,omitempty"` PurchaseURL string `json:"purchase_url,omitempty"` StartDate Date `json:"start_date,omitempty"` PhoneNumber string `json:"phone_number,omitempty"` Email string `json:"email,omitempty"` FeedContactEmail string `json:"feed_contact_email,omitempty"` // added in v1.1 Timezone string `json:"timezone"` LicenseID string `json:"license_id,omitempty"` LicenseURL string `json:"license_url,omitempty"` AttributionOrganizationName string `json:"attribution_organization_name,omitempty"` AttributionURL string `json:"attribution_url,omitempty"` RentalApps RentalApps `json:"rental_apps,omitempty"` // added in v1.1 }
type SystemInformationResponse ¶
type SystemInformationResponse struct { Header Data SystemInformation `json:"data"` }
type SystemPricingPlans ¶
type SystemPricingPlans struct {
Plans []Plan `json:"plans"`
}
type SystemPricingPlansResponse ¶
type SystemPricingPlansResponse struct { Header Data SystemPricingPlans `json:"data"` }
type SystemRegions ¶
type SystemRegions struct {
Regions []Region `json:"regions"`
}
type SystemRegionsResponse ¶
type SystemRegionsResponse struct { Header Data SystemRegions `json:"data"` }
type UserType ¶
type UserType string
const UserTypeMember UserType = "member"
const UserTypeNonMember UserType = "nonmember"
type VehicleAvailability ¶
type VehicleType ¶
type VehicleType struct { VehicleTypeID ID `json:"vehicle_type_id"` FormFactor FormFactor `json:"form_factor"` PropulsionType PropulsionType `json:"propulsion_type"` MaxRangeMeters float64 `json:"max_range_meters,omitempty"` Name string `json:"name,omitempty"` }
type VehicleTypesData ¶
type VehicleTypesData struct {
VehicleTypes []VehicleType `json:"vehicle_types"`
}
type VehicleTypesResponse ¶
type VehicleTypesResponse struct { Header Data VehicleTypesData `json:"data"` }
type VersionsData ¶
type VersionsData struct {
Versions []Version `json:"versions"`
}
type VersionsResponse ¶
type VersionsResponse struct { Header Data VersionsData `json:"data"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.