Documentation
¶
Overview ¶
Package cache sets and gets data from memcache and datastore.
Index ¶
- func DeleteDatastore(ctx context.Context, key *datastore.Key) error
- func DeleteMemcache(ctx context.Context, key string) error
- func GetDatastore(ctx context.Context, key *datastore.Key, dst any) (ok bool, err error)
- func GetMemcache(ctx context.Context, key string, dst any) (ok bool, err error)
- func LoadJSONProp(props []datastore.Property, dst any) error
- func SaveJSONProp(src any) ([]datastore.Property, error)
- func SetDatastore(ctx context.Context, key *datastore.Key, src any) error
- func SetMemcache(ctx context.Context, key string, src any) error
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteDatastore ¶
DeleteDatastore deletes key from datastore. nil is returned if the key isn't present.
func DeleteMemcache ¶
DeleteMemcache deletes key from memcache. nil is returned if the key isn't present.
func GetDatastore ¶
GetDatastore fetches an object from datastore and saves it to dst. If the object isn't present, ok is false and err is nil.
func GetMemcache ¶
GetMemcache fetches a JSON object from memcache and saves it to dst. If the object isn't present, ok is false and err is nil.
func LoadJSONProp ¶
LoadJSONProp implements datastore.PropertyLoadSaver's Load method.
func SaveJSONProp ¶
SaveJSONProp implements datastore.PropertyLoadSaver's Save method.
func SetDatastore ¶
SetDatastore saves src at key in datastore. If the update fails, the stale object (if present) is deleted.