示例#1
0
func (store *AppengineBlobStore) Fetch(handle *latvis.Handle) (*latvis.Blob, error) {
	store.context.Infof("Looking up blob with handle: '%s'", handle.String())

	blob := new(latvis.Blob)
	if err := datastore.Get(store.context, keyFromHandle(store.context, handle), blob); err != nil {
		return nil, err
	}
	return blob, nil
}
示例#2
0
func (store *AppengineBlobStore) Store(handle *latvis.Handle, blob *latvis.Blob) error {
	store.context.Infof("Storing blob with handle: '%s'", handle.String())

	datastore.Put(store.context, keyFromHandle(store.context, handle), blob)
	return nil
}
示例#3
0
func keyFromHandle(c appengine.Context, h *latvis.Handle) *datastore.Key {
	return datastore.NewKey(c, LATVIS_OUTPUT_DATATYPE, h.String(), 0, nil)
}