brigades

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

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(client *http.Client, gtfs *gtfs.Gtfs, opts Options) error

Main auto-magically creates brigades data

Types

type MatchedTripData

type MatchedTripData map[string]*tripData

MatchedTripData is a mapping from trip_id→tripData that represents trips matched with brigades

func Match

func Match(api *ttableAPI, gtfs *gtfs.Gtfs, stopTimesReader io.Reader) (matches MatchedTripData, err error)

Match matches trips to brigade ids

func (MatchedTripData) MarshalJSON

func (m MatchedTripData) MarshalJSON() ([]byte, error)

MarshalJSON marshals a MatchedTripData into JSON. This JSON has a different structure then MatchedTripData - nested objects will be used:

{
  "{ROUTE_ID}": {
    "{BRIGADE_ID}": [
      {
         "trip_id": "{TRIP_ID}",
         "last_stop_id": "{STOP_ID}",
         "last_stop_pos": [lat, lon], // an array of 2 floats
         "last_stop_timepoint": "HH:MM:SS"
      }
    ]
}

type Options

type Options struct {
	JSONTarget     string
	Apikey         string
	ThrowAPIErrors bool
}

Options represents options for creating brigades.json

Jump to

Keyboard shortcuts

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