-
Notifications
You must be signed in to change notification settings - Fork 8
/
query.go
43 lines (37 loc) · 920 Bytes
/
query.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
package restql
type Source string
var (
DatabaseSource Source = "database"
ConfigFileSource Source = "config"
EnvSource Source = "env"
)
// SavedQuery represents a query stored in database.
type SavedQuery struct {
Name string
Text string
Revision int
Source Source
}
// QueryContext represents all data related
// to a query execution like query identification,
// input values and resource mappings.
type QueryContext struct {
Mappings map[string]Mapping
Options QueryOptions
Input QueryInput
}
// QueryOptions represents the identity of the query being executed
type QueryOptions struct {
Namespace string
Id string
Revision int
Tenant string
}
// QueryInput represents all the data
// provided by the client when requesting
// the execution of the query.
type QueryInput struct {
Params map[string]interface{}
Body interface{}
Headers map[string]string
}