departures

package
v0.0.0-...-70a2b83 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(ctx context.Context, client APIClient, stops []Stop, nResults int) ([]hafas.Conn, error)

Compile compiles a list of departures for a given list of stops, lines, and directions.

Types

type APIClient

type APIClient interface {
	StBoard(ctx context.Context, stopName, stopID string, ts time.Time, nResults int) ([]hafas.Conn, error)
	FindStop(ctx context.Context, query string) (*hafas.Stop, error)
}

type Stop

type Stop struct {
	// stop name, e.g. "Zürich, Brunau/Mutschellenstr."
	Name string
	// map key: line name, e.g. "72" or "*" for all
	// values: list of line terminals, e.g.
	//   ["Zürich, Milchbuck", "Zürich, Albisriederplatz"]
	//   empty list means all directions
	LineDirections map[string][]string
	// time it takes you to walk to this stop from your starting point
	TimeToStop time.Duration
}

Stop is a public transport stop to list departures for.

Jump to

Keyboard shortcuts

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