-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathtest.ridl
86 lines (70 loc) · 2.12 KB
/
test.ridl
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
webrpc = v1
name = Test
version = v0.10.0
service TestApi
- GetEmpty()
- GetError()
- GetOne() => (one: Simple)
- SendOne(one: Simple)
- GetMulti() => (one: Simple, two: Simple, three: Simple)
- SendMulti(one: Simple, two: Simple, three: Simple)
- GetComplex() => (complex: Complex)
- SendComplex(complex: Complex)
- GetEnumList() => (list: []Status)
- GetEnumMap() => (map: map<Access, uint64>)
# added in v0.11.0
- GetSchemaError(code: int)
struct Simple
- id: int
- name: string
struct User
- id: uint64
+ json = id
+ go.field.name = ID
+ go.tag.db = id
- username: string
+ json = USERNAME
+ go.tag.db = username
- role: string
+ go.tag.db = -
enum Status: uint32
- AVAILABLE
- NOT_AVAILABLE
enum Access: uint32
- NONE
- READ
- WRITE
- ADMIN
- OWNER
struct Complex
- meta: map<string,any>
- metaNestedExample: map<string,map<string,uint32>>
- namesList: []string
- numsList: []int64
- doubleArray: [][]string
- listOfMaps: []map<string,uint32>
- listOfUsers: []User
- mapOfUsers: map<string,User>
- user: User
- status: Status
struct EnumData
- dict: map<Access,uint64>
- list: []Status
error 1 Unauthorized "unauthorized" HTTP 401
error 2 ExpiredToken "expired token" HTTP 401
error 3 InvalidToken "invalid token" HTTP 401
error 4 Deactivated "account deactivated" HTTP 403
error 5 ConfirmAccount "confirm your email" HTTP 403
error 6 AccessDenied "access denied" HTTP 403
error 7 MissingArgument "missing argument" HTTP 400
error 8 UnexpectedValue "unexpected value" HTTP 400
error 100 RateLimited "too many requests" HTTP 429
error 101 DatabaseDown "service outage" HTTP 503
error 102 ElasticDown "search is degraded" HTTP 503
error 103 NotImplemented "not implemented" HTTP 501
error 200 UserNotFound "user not found"
error 201 UserBusy "user busy"
error 202 InvalidUsername "invalid username"
error 300 FileTooBig "file is too big (max 1GB)"
error 301 FileInfected "file is infected"
error 302 FileType "unsupported file type"