Documentation ¶
Index ¶
- Variables
- func AddDir(c *pgx.Conn, dir string) (err error)
- func AddFareObject(c *pgx.Conn, f *FareObject) (err error)
- func AddXml(c *pgx.Conn, file io.ReadCloser) (err error)
- func AddZip(c *pgx.Conn, path string) (err error)
- func GetDatasets(dir string, nocs string) (err error)
- type ApiResponse
- type ApiResult
- type AttrRef
- type DistanceMatrixElement
- type DistanceMatrixElementPrice
- type Fare
- type FareObject
- type FareObjectReferences
- type FareObjects
- type FareTable
- type FareTableCell
- type FareTableRowColumn
- type FareZone
- type GeographicalIntervalPrice
- type Line
- type Naptan
- type Noc
- type Operator
- type PreassignedFareProduct
- type PriceGroup
- type SalesOfferPackage
- type ScheduledStopPoint
- type ScheduledStopPointRef
- type Tariff
- type TopographicPlaceView
- type UserProfile
- type ValidBetween
- type XmlTime
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFareNotInTable = errors.New("fare not in table")
Functions ¶
func AddFareObject ¶
func AddFareObject(c *pgx.Conn, f *FareObject) (err error)
func AddXml ¶
func AddXml(c *pgx.Conn, file io.ReadCloser) (err error)
func GetDatasets ¶
Types ¶
type ApiResponse ¶
type ApiResponse struct {
Results []ApiResult `json:"results"`
}
type DistanceMatrixElement ¶
type Fare ¶
type Fare struct { Amount currency.Amount `json:"amount"` ValidBetween ValidBetween `json:"validBetween"` UserProfile UserProfile `json:"userProfile"` SalesOfferPackage SalesOfferPackage `json:"salesOfferPackage"` PreassignedFareProduct PreassignedFareProduct `json:"preassignedFareProduct"` }
Type Fare is used when finding fares from an imported FareObject
type FareObject ¶
type FareObject struct { XMLName xml.Name `xml:"PublicationDelivery"` References FareObjectReferences `xml:"PublicationRequest>topics>NetworkFrameTopic>NetworkFilterByValue>objectReferences"` Currency string `xml:"dataObjects>CompositeFrame>FrameDefaults>DefaultCurrency"` Operators []Operator `xml:"dataObjects>CompositeFrame>frames>ResourceFrame>organisations>Operator"` Lines []Line `xml:"dataObjects>CompositeFrame>frames>ServiceFrame>lines>Line"` ScheduledStopPoints []ScheduledStopPoint `xml:"dataObjects>CompositeFrame>frames>ServiceFrame>scheduledStopPoints>ScheduledStopPoint"` FareZones []FareZone `xml:"dataObjects>CompositeFrame>frames>FareFrame>fareZones>FareZone"` Tariffs []Tariff `xml:"dataObjects>CompositeFrame>frames>FareFrame>tariffs>Tariff"` UserProfiles []UserProfile `xml:"dataObjects>CompositeFrame>frames>FareFrame>usageParameters>UserProfile"` FareProducts []PreassignedFareProduct `xml:"dataObjects>CompositeFrame>frames>FareFrame>fareProducts>PreassignedFareProduct"` SalesOfferPackages []SalesOfferPackage `xml:"dataObjects>CompositeFrame>frames>FareFrame>salesOfferPackages>SalesOfferPackage"` PriceGroups []PriceGroup `xml:"dataObjects>CompositeFrame>frames>FareFrame>priceGroups>PriceGroup"` FareTables []FareTable `xml:"dataObjects>CompositeFrame>frames>FareFrame>fareTables>FareTable"` }
func ParseXml ¶
func ParseXml(data []byte) (FareObject, error)
type FareObjectReferences ¶
type FareObjects ¶
type FareObjects struct {
Objects []FareObject
}
type FareTable ¶
type FareTable struct { TariffRef AttrRef `xml:"usedIn>TariffRef"` UserProfileRef AttrRef `xml:"pricesFor>UserProfileRef"` SalesOfferPackageRef AttrRef `xml:"pricesFor>SalesOfferPackageRef"` PreassignedFareProductRef AttrRef `xml:"pricesFor>PreassignedFareProductRef"` Columns []FareTableRowColumn `xml:"columns>FareTableColumn"` Rows []FareTableRowColumn `xml:"rows>FareTableRow"` Cells []FareTableCell `xml:"includes>FareTable>cells>Cell"` }
type FareTableCell ¶
type FareTableCell struct { Id string `xml:"id,attr"` DistanceMatrixElementPrice DistanceMatrixElementPrice `xml:"DistanceMatrixElementPrice"` ColumnRef AttrRef `xml:"ColumnRef"` RowRef AttrRef `xml:"RowRef"` }
type FareTableRowColumn ¶
type FareZone ¶
type FareZone struct { Id string `xml:"id,attr"` Name string `xml:"Name"` Members []ScheduledStopPointRef `xml:"members>ScheduledStopPointRef"` }
type PreassignedFareProduct ¶
type PreassignedFareProduct struct { Id string `xml:"id,attr" json:"id"` Name string `xml:"Name" json:"name"` ChargingMoment string `xml:"ChargingMomentType" json:"chargingMoment"` TariffBasis string `xml:"ConditionSummary>TariffBasis" json:"tariffBasis"` ProductType string `xml:"ProductType" json:"productType"` }
type PriceGroup ¶
type PriceGroup struct { Id string `xml:"id,attr"` GeographicalIntervalPrice []GeographicalIntervalPrice `xml:"members>GeographicalIntervalPrice"` }
type SalesOfferPackage ¶
type ScheduledStopPoint ¶
type ScheduledStopPoint struct { ScheduledStopPointRef string `xml:"id,attr"` Name string `xml:"Name"` TopographicPlaceView TopographicPlaceView `xml:"TopographicPlaceView"` }
type ScheduledStopPointRef ¶
type Tariff ¶
type Tariff struct { Id string `xml:"id,attr"` Name string `xml:"Name"` OperatorRef AttrRef `xml:"OperatorRef"` LineRef AttrRef `xml:"LineRef"` TariffBasis string `xml:"TariffBasis"` DistanceMatrixElements []DistanceMatrixElement `xml:"fareStructureElements>FareStructureElement>distanceMatrixElements>DistanceMatrixElement"` TripType string `xml:"fareStructureElements>FareStructureElement>GenericParameterAssignment>limitations>RoundTrip>TripType"` ValidBetween ValidBetween `xml:"validityConditions>ValidBetween"` }
type TopographicPlaceView ¶
type UserProfile ¶
type ValidBetween ¶
Click to show internal directories.
Click to hide internal directories.