-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc.go
69 lines (45 loc) · 1.33 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Package sptrans is a Go client library for the SPTrans Olho Vivo API.
Usage:
import "github.com/sergioaugrod/go-sptrans/sptrans"
Authentication:
token = "123456"
client = sptrans.NewClient(token)
client.Authenticate()
Endpoints:
Lines
// Search by line description or number
client.Line.Search("Lapa")
client.Line.Search("8000")
// Search by line direction
client.Line.SearchByDirection("Lapa", 1)
Stops
// Search by stop name or address
client.Stop.Search("Afonso")
client.Stop.Search("Rua Baltharzar da Veiga")
// Search by line id
client.Stop.SearchByLine(1273)
// Search by corridor id
client.Stop.SearchByCorridor(8)
Corridors
// All smart corridors
client.Corridor.All()
Companies
// All companies
client.Company.All()
Vehicles Position
// All Vehicles Position
client.VehiclePosition.All()
// Search by line id
client.VehiclePosition.SearchByLine(1273)
// Search by company id
client.VehiclePosition.SearchByCompany(99)
Forecast
// Search by stop id and line id
client.Forecast.Search(2003, 2004)
// Search by line id
client.Forecast.SearchByLine(1273)
// Search by stop id
client.Forecast.SearchByStop(8)
*/
package sptrans