forked from subosito/iglo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiglo.go
91 lines (78 loc) · 2.59 KB
/
iglo.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package iglo
type API struct {
Version string `json:"_version"`
Name string `json:"name"`
Description string `json:"description"`
Metadata Metadata `json:"metadata"`
ResourceGroups []ResourceGroup `json:"resourceGroups"`
}
type Host struct {
Value string `json:"value"`
}
type Format struct {
Value string `json:"value"`
}
type Metadata struct {
Format Format `json:"FORMAT"`
Host Host `json:"HOST"`
}
type ResourceGroup struct {
Name string `json:"name"`
Description string `json:"description"`
Resources []Resource `json:"resources"`
}
type Header struct {
Value string `json:"value"`
}
type Model struct {
Name string `json:"name"`
Description string `json:"description"`
Headers map[string]Header `json:"headers"`
Body string `json:"body"`
Schema string `json:"schema"`
}
type Parameter struct {
Description string `json:"description"`
Type string `json:"type"`
Required bool `json:"required"`
Default string `json:"default"`
Example string `json:"example"`
Values []string `json:"values"`
}
type Example struct {
Name string `json:"name"`
Description string `json:"description"`
Requests []Request `json:"requests"`
Responses []Response `json:"responses"`
}
type Request struct {
Name string `json:"name"`
Description string `json:"description"`
Headers map[string]Header `json:"headers"`
Body string `json:"body"`
Schema string `json:"schema"`
}
type Response struct {
Name string `json:"name"`
Description string `json:"description"`
Headers map[string]Header `json:"headers"`
Body string `json:"body"`
Schema string `json:"schema"`
}
type Action struct {
Name string `json:"name"`
Description string `json:"description"`
Method string `json:"method"`
Parameters map[string]Parameter `json:"parameters"`
Headers map[string]Header `json:"headers"`
Examples []Example `json:"examples"`
}
type Resource struct {
Name string `json:"name"`
Description string `json:"description"`
UriTemplate string `json:"uriTemplate"`
Model Model `json:"model"`
Parameters map[string]Parameter `json:"parameters"`
Headers map[string]Header `json:"headers"`
Actions []Action `json:"actions"`
}