Documentation
¶
Index ¶
- Variables
- func AddDatastore(ctx context.Context, ds Datastore) context.Context
- func AddMemcache(ctx context.Context, mc Memcache) context.Context
- func Delete(ctx context.Context, key *datastore.Key) error
- func DeleteMulti(ctx context.Context, keys []*datastore.Key) error
- func Get(ctx context.Context, key *datastore.Key, dst interface{}) error
- func GetMulti(ctx context.Context, keys []*datastore.Key, dst interface{}) error
- func IsDatastoreAllowed(ctx context.Context) bool
- func IsMemcacheAllowed(ctx context.Context) bool
- func LoadStruct(dst interface{}, input []datastore.Property) error
- func OnlyDatastore(ctx context.Context, flag bool) context.Context
- func OnlyMemcache(ctx context.Context, flag bool) context.Context
- func Prefetch(ctx context.Context, keys []*datastore.Key, dst interface{}) context.Context
- func Put(ctx context.Context, key *datastore.Key, src interface{}) (*datastore.Key, error)
- func PutMulti(ctx context.Context, keys []*datastore.Key, src interface{}) ([]*datastore.Key, error)
- func SaveStruct(src interface{}) ([]datastore.Property, error)
- type Datastore
- type ErrMulti
- type Memcache
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEntityToLarge = errors.New("entity to large to save")
View Source
var ErrIncompleteKey = errors.New("Key imcomplete but used a complete key.")
View Source
var ErrInvalidEntityType = errors.New("invalid entity type")
ErrInvalidEntityType is returned when functions like Get or Next are passed a dst or src argument of invalid type.
View Source
var ErrInvalidKey = errors.New("invalid key")
ErrInvalidKey is returned when an invalid key is presented.
View Source
var ErrNoContext = errors.New("context does not exist")
View Source
var ErrNoSuchEntity = errors.New("no such entity")
ErrNoSuchEntity is returned when no entity was found for a given key.
Functions ¶
func IsDatastoreAllowed ¶ added in v1.2.0
func IsMemcacheAllowed ¶ added in v1.2.0
func LoadStruct ¶
LoadStruct helps load a struct from a datastore.Property channel
func OnlyDatastore ¶ added in v1.2.0
func OnlyMemcache ¶ added in v1.2.0
func SaveStruct ¶
SaveStruct outputs a struct to an datastore.Property channel
Types ¶
type Datastore ¶
type Datastore interface { Delete(context.Context, *datastore.Key) error DeleteMulti(context.Context, []*datastore.Key) error Get(context.Context, *datastore.Key, interface{}) error GetMulti(context.Context, []*datastore.Key, interface{}) error Put(context.Context, *datastore.Key, interface{}) (*datastore.Key, error) PutMulti(context.Context, []*datastore.Key, interface{}) ([]*datastore.Key, error) }
type Memcache ¶
type Memcache interface { Delete(context.Context, *datastore.Key) error DeleteMulti(context.Context, []*datastore.Key) error Get(context.Context, *datastore.Key, interface{}) error Set(context.Context, *datastore.Key, interface{}) error SetMulti(context.Context, []*datastore.Key, interface{}) error }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.