-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ridl
55 lines (43 loc) · 1.25 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
webrpc = v1 # version of webrpc schema format (ridl or json)
name = example # name of your backend app
version = v0.0.1 # version of your schema
enum Kind: uint32
- USER
- ADMIN
struct Empty
struct User
- id: uint64
+ json = id
+ go.field.name = ID
+ go.tag.db = id
- username: string
+ json = USERNAME
+ go.tag.db = "username hi"
- role: string
+ go.tag.db = -
struct SearchFilter
- q: string
struct Version
- webrpcVersion: string
- schemaVersion: string
- schemaHash: string
struct ComplexType
- 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
error 1000 UserNotFound "User not found" HTTP 404
error 2000 Unauthorized "Unauthorized access" HTTP 401
error 3000 PermissionDenied "Permission denied" HTTP 403
service ExampleService
- Ping()
- Status() => (status: bool)
- Version() => (version: Version)
- GetUser(header: map<string,string>, userID: uint64) => (code: uint32, user: User)
- FindUser(s: SearchFilter) => (name: string, user: User)
- Subscribe() => stream (message: string)