Skip to content

Commit

Permalink
Sept 23 iteration (#5)
Browse files Browse the repository at this point in the history
* cleaning up and standardizing

* more cleanup

* still fleshing it out

* as far as I can with a suingle common entry

* first bit of fully functional api!!

* now with nullguard! minor bug fix, lite cleanup

* minor updates, starting the doc!
  • Loading branch information
Setheck committed Sep 24, 2018
1 parent 547e36b commit d4cd82d
Show file tree
Hide file tree
Showing 16 changed files with 8,985 additions and 1,350 deletions.
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,55 @@
# oba - Go Api for One Bus Away
[![Build Status](https://travis-ci.org/Setheck/oba.svg?branch=master)](https://travis-ci.org/Setheck/oba)[![Go Report Card](https://goreportcard.com/badge/github.com/setheck/oba)](https://goreportcard.com/report/github.com/setheck/oba)
# oba - Golang Api for One Bus Away
[![Build Status](https://travis-ci.org/Setheck/oba.svg?branch=master)](https://travis-ci.org/Setheck/oba) [![Go Report Card](https://goreportcard.com/badge/github.com/setheck/oba)](https://goreportcard.com/report/github.com/setheck/oba)

More Info Coming soon!
# Summary
I wanted to write some apps that interface with one bus away and could not find a go api, so I wrote one!
[One Bus Away Documentation](http://developer.onebusaway.org/modules/onebusaway-application-modules/current/api/where/index.html)
It was also a good excuse to have some fun with golang

# Get
```
$ go get -u github.com/Setheck/oba
```

# Import
``` go
import (
"fmt"
"github.com/Setheck/oba"
)
```

# Use
### Agency
```go
```go
func main() {
client := oba.NewDefaultClientS(server.URL, TestApiKey)
agency, e := client.Agency("1")
if e != nil {
t.Error(e)
}
}
```
```
## AgenciesWithCoverage
```go
func main() {
client := oba.NewDefaultClientS(server.URL, TestApiKey)
awcs, e := client.AgenciesWithCoverage()
if e != nil {
t.Error(e)
}
}
```
## Route
```go
func main() {
client := oba.NewDefaultClientS("http://api.pugetsound.onebusaway.org/api/where/", "TEST")
route, err := client.Route("1_100224")
if err != nil {
log.Fatal(err)
}
fmt.Print(route.ID)
}
```
Loading

0 comments on commit d4cd82d

Please sign in to comment.