-
Notifications
You must be signed in to change notification settings - Fork 2
/
datastore.go
68 lines (59 loc) · 2.06 KB
/
datastore.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package appwrap
import (
"time"
)
type DatastoreCursor interface{}
type DatastoreIterator interface {
Next(itemPtr interface{}) (*DatastoreKey, error)
Cursor() (DatastoreCursor, error)
}
type DatastoreQuery interface {
Ancestor(ancestor *DatastoreKey) DatastoreQuery
Distinct() DatastoreQuery
Filter(how string, what interface{}) DatastoreQuery
KeysOnly() DatastoreQuery
Limit(i int) DatastoreQuery
Offset(i int) DatastoreQuery
Order(how string) DatastoreQuery
Project(fieldName ...string) DatastoreQuery
Start(c DatastoreCursor) DatastoreQuery
Run() DatastoreIterator
GetAll(dst interface{}) ([]*DatastoreKey, error)
}
type DatastoreTransaction interface {
DeleteMulti(keys []*DatastoreKey) error
Get(keys *DatastoreKey, dst interface{}) error
GetMulti(keys []*DatastoreKey, dst interface{}) error
NewKey(string, string, int64, *DatastoreKey) *DatastoreKey
NewQuery(kind string) DatastoreQuery
Put(key *DatastoreKey, src interface{}) (*PendingKey, error)
PutMulti(keys []*DatastoreKey, src interface{}) ([]*PendingKey, error)
}
type Datastore interface {
AllocateIDSet(incompleteKeys []*DatastoreKey) ([]*DatastoreKey, error)
Deadline(t time.Time) Datastore
DeleteMulti(keys []*DatastoreKey) error
Get(keys *DatastoreKey, dst interface{}) error
GetMulti(keys []*DatastoreKey, dst interface{}) error
Kinds() ([]string, error)
Namespace(ns string) Datastore
NewKey(string, string, int64, *DatastoreKey) *DatastoreKey
NewQuery(kind string) DatastoreQuery
Put(key *DatastoreKey, src interface{}) (*DatastoreKey, error)
PutMulti(keys []*DatastoreKey, src interface{}) ([]*DatastoreKey, error)
RunInTransaction(f func(coreds DatastoreTransaction) error, opts ...DatastoreTransactionOption) (Commit, error)
}
type Commit interface {
Key(pending *PendingKey) *DatastoreKey
}
type LegacyDatastore interface {
AllocateIDs(kind string, parent *DatastoreKey, n int) (int64, int64, error)
NewKey(string, string, int64, *DatastoreKey) *DatastoreKey
Kinds() ([]string, error)
}
type AppwrapProperty struct {
Multiple bool
Name string
NoIndex bool
Value interface{}
}