An open API service indexing awesome lists of open source software.

https://github.com/vector-hector/fptf

Go bindings for fptf
https://github.com/vector-hector/fptf

fptf golang golang-package gtfs open-data public-transport transport

Last synced: 6 months ago
JSON representation

Go bindings for fptf

Awesome Lists containing this project

README

          

# fptf

Go bindings
of [fptf](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md).

This package is just a collection of types and (un)marshall functions, really.
But since fptf requires some optional stuff (e.g. stops can be objects or strings),
you'd kind of have to add a lot of functions to your types. \
This package takes care of that.

## Usage

Import the stuff:

```go
package main

import (
"encoding/json"
"github.com/Vector-Hector/fptf"
)

func main() {
// ...find some data called dat

var journey fptf.Journey
err := json.Unmarshal(dat, &journey)
if err != nil {
panic(err)
}
}
```

All the types specified in the [specs](https://github.com/public-transport/friendly-public-transport-format/blob/1.2.1/spec/readme.md)
can be accessed through this package. \
Just capitalize the first letter and write fptf. in front of it ^^