fact

package
v0.0.0-...-fa793e7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Binary        = false
	HumanReadable = true
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	ID      string         `json:"id"`
	Title   string         `json:"title"`
	Message string         `json:"message"`
	Trips   []TripSelector `json:"trips"`
}

func (*Alert) AsGTFS

func (a *Alert) AsGTFS() *gtfs.FeedEntity

type Container

type Container struct {
	Schema      string        `json:"$schema,omitempty"`
	Timestamp   time.Time     `json:"timestamp"`
	Alerts      []*Alert      `json:"alerts,omitempty"`
	TripUpdates []*TripUpdate `json:"trip_updates,omitempty"`
}

func (*Container) AsGTFS

func (c *Container) AsGTFS() *gtfs.FeedMessage

func (*Container) DumpGTFS

func (c *Container) DumpGTFS(w io.Writer, humanReadable bool) error

func (*Container) DumpGTFSFile

func (c *Container) DumpGTFSFile(path string, humanReadable bool) error

func (*Container) DumpJSON

func (c *Container) DumpJSON(w io.Writer, humanReadable bool) error

func (*Container) DumpJSONFile

func (c *Container) DumpJSONFile(path string, humanReadable bool) error

func (*Container) TotalFacts

func (c *Container) TotalFacts() int

type StopTimeUpdate

type StopTimeUpdate struct {
	Sequence  int       `json:"stop_sequence"`
	StopID    string    `json:"stop_id,omitempty"`
	Arrival   time.Time `json:"arrival,omitzero"`
	Departure time.Time `json:"departure,omitzero"`
	Cancelled bool      `json:"cancelled,omitempty"`
	Confirmed bool      `json:"confirmed,omitempty"`
	Platform  string    `json:"platform,omitempty"`
	Track     string    `json:"track,omitempty"`
}

func (*StopTimeUpdate) AsGTFS

type TripSelector

type TripSelector struct {
	TripID        string     `json:"trip_id"`
	GTFSStartDate time2.Date `json:"start_date"`
}

func (TripSelector) AsGTFS

func (s TripSelector) AsGTFS() *gtfs.TripDescriptor

type TripUpdate

type TripUpdate struct {
	ID string `json:"id"`
	TripSelector
	AgencyID  string            `json:"agency_id,omitempty"`
	Numbers   []string          `json:"numbers,omitempty"`
	StopTimes []*StopTimeUpdate `json:"stop_times,omitempty"`
	Cancelled bool              `json:"cancelled,omitempty"`
	Detour    bool              `json:"detour,omitempty"`
}

func (*TripUpdate) AsGTFS

func (t *TripUpdate) AsGTFS() *gtfs.FeedEntity

func (*TripUpdate) IsEmpty

func (t *TripUpdate) IsEmpty() bool

Jump to

Keyboard shortcuts

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