-
Notifications
You must be signed in to change notification settings - Fork 46
/
example.ridl
70 lines (53 loc) · 1.43 KB
/
example.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
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
enum Intent: string
- openSession
- closeSession
- validateSession
struct Empty
# User struct
#
# More information about user struct
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 = -
- kind: Kind
+ json = kind
- intent: Intent
+ json = intent
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)