Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frozzare/go-sl
Go package for dealing with sl.se's apis
https://github.com/frozzare/go-sl
sl trafiklab
Last synced: 7 days ago
JSON representation
Go package for dealing with sl.se's apis
- Host: GitHub
- URL: https://github.com/frozzare/go-sl
- Owner: frozzare
- License: mit
- Created: 2017-12-18T20:30:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-19T09:57:29.000Z (about 7 years ago)
- Last Synced: 2024-11-11T14:58:04.451Z (2 months ago)
- Topics: sl, trafiklab
- Language: Go
- Size: 31.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-sweden - Go
README
# sl [![Build Status](https://travis-ci.org/frozzare/go-sl.svg?branch=master)](https://travis-ci.org/frozzare/go-sl) [![GoDoc](https://godoc.org/github.com/frozzare/go-sl?status.svg)](https://godoc.org/github.com/frozzare/go-sl) [![Go Report Card](https://goreportcard.com/badge/github.com/frozzare/go-sl)](https://goreportcard.com/report/github.com/frozzare/go-sl)
Go package for dealing with [sl.se](http://sl.se)'s apis.
## Installation
```
go get -u github.com/frozzare/go-sl
```## APIs that are implemented
* [Location Lookup](https://www.trafiklab.se/api/sl-platsuppslag)
* [Realtime V4](https://www.trafiklab.se/api/sl-realtidsinformation-4)
* [Travelplanner V3](https://www.trafiklab.se/api/sl-reseplanerare-3) (Only Trip, Journey and Reconstruction not XSD)## Example
```go
package mainimport (
"fmt"
"log""github.com/frozzare/go-sl"
)func main() {
api := sl.NewClient(nil)
res, err := api.Realtime.Search(context.Background(), &sl.RealtimeSearchOptions{
Key: "YOUR_API_KEY",
SiteID: "1002", // 1002 = Stockholm Central/City
})
if err != nil {
log.Fatal(err)
}fmt.Println(res)
}
```## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)