-
Notifications
You must be signed in to change notification settings - Fork 20
/
location.go
44 lines (42 loc) · 1009 Bytes
/
location.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
package assets
import "github.com/nyaruka/goflow/envs"
// LocationHierarchy is a searchable hierarchy of locations.
//
// {
// "name": "Rwanda",
// "aliases": ["Ruanda"],
// "children": [
// {
// "name": "Kigali City",
// "aliases": ["Kigali", "Kigari"],
// "children": [
// {
// "name": "Gasabo",
// "children": [
// {
// "id": "575743222",
// "name": "Gisozi"
// },
// {
// "id": "457378732",
// "name": "Ndera"
// }
// ]
// },
// {
// "name": "Nyarugenge",
// "children": []
// }
// ]
// },
// {
// "name": "Eastern Province"
// }
// ]
// }
//
// @asset location
type LocationHierarchy interface {
FindByPath(path envs.LocationPath) *envs.Location
FindByName(env envs.Environment, name string, level envs.LocationLevel, parent *envs.Location) []*envs.Location
}