Documentation ¶
Overview ¶
Package gds provides the basic APIs to communicate with Google datastore
Index ¶
- func BuildGdsContext(serviceEmail string, key []byte, projectID string) (context.Context, *datastore.Client, error)
- type Cloneable
- type Manager
- func (m *Manager) BatchIterate(query *datastore.Query, batchSize int, dst Cloneable, ...) error
- func (m *Manager) BuildKey(kind, keyName string) *datastore.Key
- func (m *Manager) Delete(key *datastore.Key) error
- func (m *Manager) DeleteAll(kindName string) error
- func (m *Manager) Get(key *datastore.Key, entity interface{}) error
- func (m *Manager) GetAll(query *datastore.Query, result interface{}) ([]*datastore.Key, error)
- func (m *Manager) GetCount(query *datastore.Query) (int, error)
- func (m *Manager) GetKeysOnly(query *datastore.Query) ([]*datastore.Key, error)
- func (m *Manager) GetMulti(keys []*datastore.Key, dst interface{}) error
- func (m *Manager) GetTx() *datastore.Transaction
- func (m *Manager) Iterate(query *datastore.Query, cursorStr string, dst Cloneable, ...) (string, error)
- func (m *Manager) Put(key *datastore.Key, entity interface{}) (*datastore.Key, error)
- func (m *Manager) PutUnique(key *datastore.Key, entity interface{}) error
- func (m *Manager) Setup(suffixOfKind string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Manager ¶
Manager is for low level communication with Google datastore
func (*Manager) BatchIterate ¶
func (m *Manager) BatchIterate( query *datastore.Query, batchSize int, dst Cloneable, op func(key *datastore.Key, dst interface{})) error
Batch iterates the query result with customized step
func (*Manager) Delete ¶
Delete deletes the entity by key (if the entity is not existed, there is no error)
func (*Manager) GetAll ¶
GetAll fetchs all entities by the query. The parameter `result` should be type of `*[]*<Entity>`
func (*Manager) GetKeysOnly ¶
GetKeysOnly gets only keys bu query
func (*Manager) GetTx ¶
func (m *Manager) GetTx() *datastore.Transaction
GetTx gets the datastore transaction
func (*Manager) Iterate ¶
func (m *Manager) Iterate( query *datastore.Query, cursorStr string, dst Cloneable, op func(key *datastore.Key, dst interface{})) (string, error)
Iterate iterates one by one to the query result
Click to show internal directories.
Click to hide internal directories.