journal

package
v0.0.0-...-dd27294 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package journal contains a tool for building trip journals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryGtfsrtSource

type DirectoryGtfsrtSource struct {
	// contains filtered or unexported fields
}

func NewDirectoryGtfsrtSource

func NewDirectoryGtfsrtSource(baseDir string) (*DirectoryGtfsrtSource, error)

func (*DirectoryGtfsrtSource) Next

func (s *DirectoryGtfsrtSource) Next() *gtfs.Realtime

type GtfsrtSource

type GtfsrtSource interface {
	// TODO: change this to return (*gtfs.RealTime, error) and add logic in BuildJournal to be resilient to this
	Next() *gtfs.Realtime
}

TODO: rename Source

type Journal

type Journal struct {
	Trips []Trip
}

func BuildJournal

func BuildJournal(source GtfsrtSource, startTime, endTime time.Time) *Journal

type StopTime

type StopTime struct {
	StopID        string
	ArrivalTime   *time.Time
	DepartureTime *time.Time
	Track         *string

	LastObserved time.Time
	MarkedPast   *time.Time
}

type Trip

type Trip struct {
	TripUID     string
	TripID      string
	RouteID     string
	DirectionID gtfs.DirectionID
	StartTime   time.Time
	VehicleID   string
	IsAssigned  bool

	StopTimes []StopTime

	// Metadata follows
	LastObserved        time.Time
	MarkedPast          *time.Time
	NumUpdates          int
	NumScheduleChanges  int
	NumScheduleRewrites int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL