Skip to content

yageek/tpggo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tpggo

An http client for the TPG Open Data.

For more explanation: TPG Open Data

Installation

go get github.com/gophersch/tpggo

Usage

package main

import (
	"fmt"

	"github.com/gophersch/tpggo"
)

const (
	apiKey = "MY_KEY"
)

func main() {

	client := tpggo.NewClient(apiKey)

	// Get all the stops
	if resp, err := client.GetStops(); err != nil {
		panic(err)
	} else {
		for _, stop := range resp.Stops {
			fmt.Printf("Stop Name: %s | Code: %s \n", stop.Code, stop.Name)
		}
	}
}