ae

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

Helpers for appengine APIs.

Notably, an appengine implementation of gcp/ds.Provider.

Documentation

Index

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 DeleteSingleton

func DeleteSingleton(ctx context.Context, name string) error

func DeleteSingletonFromMemcache

func DeleteSingletonFromMemcache(c context.Context, name string) error

func LoadAnySingleton

func LoadAnySingleton(ctx context.Context, name string, obj interface{}) error

func LoadFromMemcacheShards

func LoadFromMemcacheShards(ctx context.Context, name string, ptr interface{}) error

func LoadFromMemcacheShardsTTL

func LoadFromMemcacheShardsTTL(ctx context.Context, name string, ptr interface{}) error

func LoadShardedSingletonFromMemcache

func LoadShardedSingletonFromMemcache(c context.Context, name string) ([]byte, error)

func LoadSingleton

func LoadSingleton(c context.Context, name string) ([]byte, error)

func LoadSingletonFromDatastore

func LoadSingletonFromDatastore(c context.Context, name string) ([]byte, error)

func LoadSingletonFromMemcache

func LoadSingletonFromMemcache(c context.Context, name string) ([]byte, error)

func SaveAnySingleton

func SaveAnySingleton(ctx context.Context, name string, obj interface{}) error

func SaveShardedSingletonToMemcache

func SaveShardedSingletonToMemcache(c context.Context, name string, data []byte) error

func SaveSingleton

func SaveSingleton(c context.Context, name string, data []byte) error

func SaveSingletonToDatastore

func SaveSingletonToDatastore(c context.Context, name string, data []byte) error

func SaveSingletonToMemcache

func SaveSingletonToMemcache(c context.Context, name string, data []byte) error

func SaveSingletonToMemcacheHandler

func SaveSingletonToMemcacheHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)

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

func SaveSingletonToMemcacheURL(name string, body []byte, url string) error

SaveSingletonToMemcacheURL sends a HTTP request to the given URL, which should route to the SaveSingletonToMemcacheHandler routine above.

func SaveToMemcacheShards

func SaveToMemcacheShards(ctx context.Context, name string, ptr interface{}) error

func SaveToMemcacheShardsTTL

func SaveToMemcacheShardsTTL(ctx context.Context, name string, ptr interface{}, d time.Duration) error

Types

type Singleton

type Singleton struct {
	Value []byte `datastore:",noindex"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL