forked from jirenius/go-res
-
Notifications
You must be signed in to change notification settings - Fork 1
/
codec.go
46 lines (37 loc) · 1.07 KB
/
codec.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
package res
import "encoding/json"
type resRequest struct {
CID string `json:"cid"`
Params json.RawMessage `json:"params"`
Token json.RawMessage `json:"token"`
Header map[string][]string `json:"header"`
Host string `json:"host"`
RemoteAddr string `json:"remoteAddr"`
URI string `json:"uri"`
Query string `json:"query"`
}
type successResponse struct {
Result interface{} `json:"result"`
}
type errorResponse struct {
Error *Error `json:"error"`
}
type accessResponse struct {
Get bool `json:"get,omitempty"`
Call string `json:"call,omitempty"`
}
type modelResponse struct {
Model interface{} `json:"model"`
Query string `json:"query,omitempty"`
}
type collectionResponse struct {
Collection interface{} `json:"collection"`
Query string `json:"query,omitempty"`
}
type resetEvent struct {
Resources []string `json:"resources,omitempty"`
Access []string `json:"access,omitempty"`
}
type tokenEvent struct {
Token interface{} `json:"token"`
}