/
types.go
50 lines (44 loc) · 1.55 KB
/
types.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
package factual
// PlaceWrap allows unmarshalling of API response metadata
type PlaceWrap struct {
Version int `json:"version"`
Status string `json:"status"`
Response PlaceResponse `json:"response"`
}
// PlaceResponse is schema returned by the Factual API
type PlaceResponse struct {
Data []Place `json:"data"`
IncludedRows int `json:"included_rows"`
}
// Hours describes the open hours for a place
type Hours struct {
Monday [][]string `json:"monday"`
Tuesday [][]string `json:"tuesday"`
Wednesday [][]string `json:"wednesday"`
Thursday [][]string `json:"thursday"`
Friday [][]string `json:"friday"`
Saturday [][]string `json:"saturday"`
Sunday [][]string `json:"sunday"`
}
// Place contains the properties of a Place
type Place struct {
FactualID string `json:"factual_id"`
CategoryIDs []int `json:"category_ids"`
CategoryLabels [][]string `json:"category_labels"`
ChainID string `json:"chain_id,omitempty"`
ChainName string `json:"chain_name,omitempty"`
Address string `json:"address"`
Country string `json:"country"`
Postcode string `json:"postcode"`
Fax string `json:"fac"`
Region string `json:"region"`
Tel string `json:"tel"`
Hours Hours `json:"hours"`
HoursDisplay string `json:"hours_display"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"latitude"`
Locality string `json:"locality"`
Name string `json:"name"`
Neighborhood []string `json:"neighborhood"`
Website string `json:"website"`
}