Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteSingleton(ctx context.Context, name string) error
- func DeleteSingletonFromMemcache(c context.Context, name string) error
- func LoadAnySingleton(ctx context.Context, name string, obj interface{}) error
- func LoadFromMemcacheShards(ctx context.Context, name string, ptr interface{}) error
- func LoadFromMemcacheShardsTTL(ctx context.Context, name string, ptr interface{}) error
- func LoadShardedSingletonFromMemcache(c context.Context, name string) ([]byte, error)
- func LoadSingleton(c context.Context, name string) ([]byte, error)
- func LoadSingletonFromDatastore(c context.Context, name string) ([]byte, error)
- func LoadSingletonFromMemcache(c context.Context, name string) ([]byte, error)
- func SaveAnySingleton(ctx context.Context, name string, obj interface{}) error
- func SaveShardedSingletonToMemcache(c context.Context, name string, data []byte) error
- func SaveSingleton(c context.Context, name string, data []byte) error
- func SaveSingletonToDatastore(c context.Context, name string, data []byte) error
- func SaveSingletonToMemcache(c context.Context, name string, data []byte) error
- func SaveSingletonToMemcacheHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
- func SaveSingletonToMemcacheURL(name string, body []byte, url string) error
- func SaveToMemcacheShards(ctx context.Context, name string, ptr interface{}) error
- func SaveToMemcacheShardsTTL(ctx context.Context, name string, ptr interface{}, d time.Duration) error
- type Singleton
Constants ¶
View Source
const Chunksize = 950000 // A single memcache item can't be bigger than 1000000 bytes
View Source
const MaxChunks = 32 // We only shard this much.
Variables ¶
View Source
var ErrNoSuchEntityDS = errors.New("ae/datastore: no such entity")
Functions ¶
func LoadAnySingleton ¶
func LoadFromMemcacheShards ¶
func SaveAnySingleton ¶
func SaveSingletonToMemcache ¶
func SaveSingletonToMemcacheHandler ¶
SaveSingletonToMemcacheHandler is a HTTP handler that expects an application/json request body that encodes a memcacheSingletonEntry struct. (The golang json libs take care of all the base64 encoding/decoding transparently). The entry will be written into memcache.
func SaveSingletonToMemcacheURL ¶
SaveSingletonToMemcacheURL sends a HTTP request to the given URL, which should route to the SaveSingletonToMemcacheHandler routine above.
func SaveToMemcacheShards ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.