-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
16 changed files
with
8,985 additions
and
1,350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
``` |
Oops, something went wrong.