Documentation ¶
Index ¶
- Variables
- func IsDatastoreError(e error) bool
- func IsDone(e error) bool
- type DatastoreOperation
- type Driver
- func (d *Driver) AllocateIDs(parent *datastore.Key, n int) (low, high int64, err error)
- func (d *Driver) Context() appengine.Context
- func (*Driver) DecodeKey(encoded string) (*datastore.Key, error)
- func (d *Driver) Delete(key *datastore.Key) error
- func (d *Driver) DeleteMulti(key []*datastore.Key) error
- func (d *Driver) Get(key *datastore.Key, dst interface{}) error
- func (d *Driver) GetMulti(key []*datastore.Key, dst interface{}) error
- func (d *Driver) GetNamespace() string
- func (d *Driver) Kind() string
- func (d *Driver) LoadStruct(dst interface{}, c <-chan datastore.Property) error
- func (d *Driver) Namespace(namespace string) *Driver
- func (d *Driver) NewIncompleteKey(parent *datastore.Key) *datastore.Key
- func (d *Driver) NewKey(stringID string, intID int64, parent *datastore.Key) *datastore.Key
- func (d *Driver) NewQuery() *Query
- func (d *Driver) Put(key *datastore.Key, src interface{}) (*datastore.Key, error)
- func (d *Driver) PutMulti(key []*datastore.Key, src interface{}) ([]*datastore.Key, error)
- func (d *Driver) RunInTransaction(f func(tc *Driver) error, opts *datastore.TransactionOptions) error
- func (d *Driver) SaveStruct(src interface{}, c chan<- datastore.Property) error
- func (d *Driver) SetTimeout(to time.Duration) *Driver
- func (d *Driver) SyncDelete(key *datastore.Key) error
- func (d *Driver) SyncPut(key *datastore.Key, src Syncable) (*datastore.Key, error)
- type Iterator
- type Query
- func (q *Query) Ancestor(ancestor *datastore.Key) *Query
- func (q *Query) Count() (int, error)
- func (q *Query) Distinct() *Query
- func (q *Query) End(c datastore.Cursor) *Query
- func (q *Query) Filter(filterStr string, value interface{}) *Query
- func (q *Query) GetAll(dst interface{}) ([]*datastore.Key, error)
- func (q *Query) KeysOnly() *Query
- func (q *Query) Limit(limit int) *Query
- func (q *Query) Offset(offset int) *Query
- func (q *Query) Order(fieldName string) *Query
- func (q *Query) Project(fieldNames ...string) *Query
- func (q *Query) Run() *Iterator
- func (q *Query) Start(c datastore.Cursor) *Query
- type Syncable
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidEntityType = datastore.ErrInvalidEntityType ErrInvalidKey = datastore.ErrInvalidKey ErrNoSuchEntity = datastore.ErrNoSuchEntity )
View Source
var DataStoreConfig = &datastoreConfig{}
View Source
var DefaultPutSplitTreshold = 20
View Source
var DefaultTimeout = 30 * time.Second
Functions ¶
func IsDatastoreError ¶
Types ¶
type DatastoreOperation ¶
type Driver ¶
type Driver struct { Logger wcg.Logger Timeout time.Duration EnableOperationLogging bool PutSplitThreshold int // contains filtered or unexported fields }
A wrapper object for datastore functions, which depends on appengine.Context and kind.
datastore.AFunc(ctx appengine.Context, kind string, args ...) can be replaced with driver.AFunc(args)
func (*Driver) AllocateIDs ¶
func (*Driver) GetNamespace ¶
func (*Driver) LoadStruct ¶
func (*Driver) NewIncompleteKey ¶
func (*Driver) RunInTransaction ¶
func (*Driver) SaveStruct ¶
type Syncable ¶
type Syncable interface { // Returns the field name to keep timestamp for sync. TimestampFieldName() string }
The struct passed to SyncPut or SyncDelete must implement Syncable interface. Sync is done by comparison by key and unix timestamp so the sync would not work well if you pass the massive same key with in a second.
Click to show internal directories.
Click to hide internal directories.