Documentation
¶
Index ¶
- Constants
- type Bus
- type BusRoutePattern
- type BusStopPole
- type Importer
- func (i *Importer) DeleteAllDataIndices() error
- func (i *Importer) ImportBus(ctx context.Context, b []*odpt.Bus) error
- func (i *Importer) ImportBusRoutePattern(ctx context.Context, bsr []*odpt.BusRoutePattern) error
- func (i *Importer) ImportBusStopPole(ctx context.Context, bsp []*odpt.BusStopPole) error
- func (i *Importer) ImportPassengerSurvey(ctx context.Context, ps []*odpt.PassengerSurvey) error
- type Location
- type PassengerSurvey
Constants ¶
View Source
const ( IndexNameBus = "bus" IndexNameBusStopPole = "bus-stop-pole" IndexNameBusRoutePattern = "bus-route-pattern" IndexNamePassengerSurvey = "passenger-survey" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bus ¶
type Bus struct { Date time.Time `json:"date"` Location Location `json:"location"` Operator string `json:"operator"` Route string `json:"route"` Number string `json:"busNumber"` StartingBusStopPole string `json:"startingPole"` StartingBusStopPoleLocation Location `json:"startingPoleLocation"` TerminalBusStopPole string `json:"terminalPole"` TerminalBusStopPoleLocation Location `json:"terminalPoleLocation"` FromBusStop string `json:"fromStop"` FromBusStopLocation Location `json:"fromStopLocation"` FromBusStopTime time.Time `json:"leftLastStopAt"` ToBusStop string `json:"toStop,omitempty"` ToBusStopLocation *Location `json:"toStopLocation,omitempty"` ProgressPercent int `json:"progressPercent"` SpeedKmPerHour float32 `json:"speedKmPerHour"` FacingDegrees float32 `json:"azimuth"` DoorStatus string `json:"doorStatus"` }
func FromODPTBus ¶
func FromODPTBus(b []*odpt.Bus, poles odpt.BusStopPoleLookup) []*Bus
type BusRoutePattern ¶
type BusRoutePattern struct { Date time.Time `json:"date"` Title string `json:"title"` Kana string `json:"kana"` Operator string `json:"operator"` Route string `json:"route"` Pattern string `json:"pattern"` Location *Location `json:"location,omitempty"` Next *Location `json:"nextLocation,omitempty"` Direction string `json:"direction"` SameAs string `json:"sameAs"` }
func FromODPTBusRoutePattern ¶
func FromODPTBusRoutePattern(bsr []*odpt.BusRoutePattern, poles odpt.BusStopPoleLookup) []*BusRoutePattern
type BusStopPole ¶
type BusStopPole struct { Date time.Time `json:"date"` Title string `json:"title"` Location Location `json:"location"` }
func FromODPTBusStopPole ¶
func FromODPTBusStopPole(bsp []*odpt.BusStopPole) []*BusStopPole
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
func NewImporter ¶
func NewImporter( esClient *elasticsearch.Client, stationLookup odpt.StationLookup, busStopPoleLookup odpt.BusStopPoleLookup) *Importer
func (*Importer) DeleteAllDataIndices ¶
func (*Importer) ImportBusRoutePattern ¶
func (*Importer) ImportBusStopPole ¶
func (*Importer) ImportPassengerSurvey ¶
type Location ¶
func FromODPTLocation ¶
type PassengerSurvey ¶
type PassengerSurvey struct { Date time.Time `json:"date"` IncludeAlighting bool `json:"includeAlighting"` Operator string `json:"operator"` SurveyYear int `json:"surveyYear"` PassengersPerDay int `json:"passengersPerDay"` Line string `json:"line"` Station string `json:"station"` Location Location `json:"location"` }
func FromODPTPassengerSurvey ¶
func FromODPTPassengerSurvey(ps []*odpt.PassengerSurvey, stations odpt.StationLookup) []*PassengerSurvey
Click to show internal directories.
Click to hide internal directories.