forked from a8m/documentdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
53 lines (46 loc) · 1.13 KB
/
models.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
47
48
49
50
51
52
53
package documentdb
// Resource
type Resource struct {
Id string `json:"id,omitempty"`
Self string `json:"_self,omitempty"`
Etag string `json:"_etag,omitempty"`
Rid string `json:"_rid,omitempty"`
Ts int `json:"_ts,omitempty"`
}
// Indexing policy
// TODO: Ex/IncludePaths
type IndexingPolicy struct {
IndexingMode string `json: "indexingMode,omitempty"`
Automatic bool `json: "automatic,omitempty"`
}
// Database
type Database struct {
Resource
Colls string `json:"_colls,omitempty"`
Users string `json:"_users,omitempty"`
}
// Collection
type Collection struct {
Resource
IndexingPolicy IndexingPolicy `json:"indexingPolicy,omitempty"`
Docs string `json:"_docs,omitempty"`
Udf string `json:"_udfs,omitempty"`
Sporcs string `json:"_sporcs,omitempty"`
Triggers string `json:"_triggers,omitempty"`
Conflicts string `json:"_conflicts,omitempty"`
}
// Document
type Document struct {
Resource
attachments string `json: "attachments,omitempty"`
}
// Stored Procedure
type Sproc struct {
Resource
Body string `json:"body,omitempty"`
}
// User Defined Function
type UDF struct {
Resource
Body string `json:"body,omitempty"`
}