Ejemplo n.º 1
0
func (self *store) StoreNode(perma_blobref string, blobref string, data map[string]interface{}, perma_data map[string]interface{}) (err os.Error) {
	log.Printf("Storing node ...")
	// Copy the mime type for better searching
	if data["k"].(int64) == int64(grapher.OTNode_Keep) {
		data["mt"] = perma_data["mt"]
	}
	parent := datastore.NewKey("perma", perma_blobref, 0, nil)
	// Since we cannot do anchestor queries :-(
	//  data["perma"] = perma_blobref
	// Store it
	_, err = datastore.Put(self.c, datastore.NewKey("node", blobref, 0, parent), datastore.Map(data))
	return
}
Ejemplo n.º 2
0
func (self *store) StorePermaNode(perma_blobref string, data map[string]interface{}) (err os.Error) {
	key := datastore.NewKey("perma", perma_blobref, 0, nil)
	// Store it
	_, err = datastore.Put(self.c, key, datastore.Map(data))
	return
}