Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteAll(ctx context.Context, kind string) error
- func DeleteMulti(ctx context.Context, keys []*datastore.Key) error
- func GetMulti(ctx context.Context, keys []*datastore.Key, ent interface{}) error
- func IsDatastoreError(err error) bool
- func NewKey(ctx context.Context, kind string, k interface{}) *datastore.Key
- func PutMulti(ctx context.Context, keys []*datastore.Key, ent interface{}) ([]*datastore.Key, error)
- type Query
- func (q *Query) Ancestor(a lazy.Value) *Query
- func (q *Query) Asc(name string) *Query
- func (q *Query) Count(ctx context.Context) (int, error)
- func (q *Query) Desc(name string) *Query
- func (q *Query) End(value lazy.Value) *Query
- func (q *Query) Eq(name string, value lazy.Value) *Query
- func (q *Query) Ge(name string, value lazy.Value) *Query
- func (q *Query) GetAll(ctx context.Context, dst interface{}) ([]*datastore.Key, error)
- func (q *Query) Gt(name string, value lazy.Value) *Query
- func (q *Query) KeysOnly(t bool) *Query
- func (q *Query) Le(name string, value lazy.Value) *Query
- func (q *Query) Limit(value lazy.Value) *Query
- func (q *Query) Lt(name string, value lazy.Value) *Query
- func (q *Query) Ne(name string, value lazy.Value) *Query
- func (q *Query) Run(ctx context.Context) (*datastore.Iterator, error)
- func (q *Query) Start(value lazy.Value) *Query
Constants ¶
View Source
const LoggerKey = "gae.datastore"
LoggerKey is a key for logger in this package
Variables ¶
View Source
var FilterValueOmit = lazy.Value(nil)
FilterValueOmit is a value to omit the filter.
q.Eq("FieladName", lazy.LazyFunc(func(ctx) lazy.Value { v, ok := ctx.Value("filterValue").(string) if ok { return v; } return query.FilterValueOmit }))
This means if 'filterValue' does not present in the context nor a int value, FieldName filter is not be applied in the query q.
Functions ¶
func DeleteMulti ¶
DeleteMulti is wrapper for google.golang.org/appengine/datastore.DeleteMulti to support +1000 keys
func GetMulti ¶
GetMulti is wrapper for google.golang.org/appengine/datastore.GetMulti to support +1000 keys
func IsDatastoreError ¶
IsDatastoreError returns true if err is not ErrNoSuchEntity
Types ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a struct to build a query to datastore.
func (*Query) GetAll ¶
GetAll fills the query result into dst and returns corresponding *datastore.Key
Click to show internal directories.
Click to hide internal directories.