-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
63 lines (53 loc) · 879 Bytes
/
structs.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
package common
import (
"fmt"
)
type Method struct {
Package string
Name string
Comments []string
}
type Struct struct {
Package string
Name string
Fields []Field
}
func (s Struct) FullName() string {
return fmt.Sprintf("%s.%s", s.Package, s.Name)
}
type Field struct {
Name string
Type string
Optional bool
Array bool
}
type Api struct {
Status Status
Endpoints []Endpoint
Structs map[string]Struct
}
type Status struct {
Title string
Version string
URL string
Output string
}
type Endpoint struct {
Name string
Method string
Path string
PathParams map[string]Param
QueryParams map[string]Param
Headers map[string]Param
Body *string
Responses []Response
}
type Param struct {
Type string
Desc string
Required bool
}
type Response struct {
Code int
Type *string
}