-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
93 lines (76 loc) · 1.47 KB
/
api.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
92
93
package integra
import "tractor.dev/integra/internal/jsonaccess"
type Service interface {
Name() string
Title() string
Provider() string
Version() string
Categories() []string
BaseURL() string
DocsURL() string
Orientation() string
Security() []string
Resources() []Resource
Resource(name string) (Resource, error)
Schema() *jsonaccess.Value
Meta() *jsonaccess.Value
}
type Resource interface {
Service() Service
Parent() Resource
Superset() Resource
Name() string
Title() string
Description() string
Orientation() string
CollectionURLs() []string
ItemURLs() []string
Tags() []string
Schema() Schema
Subresources() []Resource
Operations() []Operation
Operation(name string) (Operation, error)
Debug() string
}
type Operation interface {
Resource() Resource
Name() string
AbsName() string
ID() string
Description() string
URL() string
Method() string
Tags() []string
Orientation() string
DocsURL() string
Security() []string
Scopes() []string
Parameters() []Schema
Response() Schema
Input() Schema
Output() Schema
}
type Schema interface {
Name() string
In() string
Title() string
Description() string
Type() string
ReadOnly() bool
Required() bool
Nullable() bool
Enum() []string
EnumDesc() []string
Format() string
Default() string
Example() string
Minimum() *int
MinLength() *int
MaxLength() *int
//todo: MaxItems
AnyOf() []Schema
OneOf() []Schema
Items() Schema
Properties() []Schema
Property(name string) (Schema, error)
}