An improved way of handling calls to App Engine's Datastore and Memcache
License
ThePiachu/GAE-Go-Datastore
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a library for easily handling App Engine's Datastore, Memcache and Blobstore calls. The main advantage it offers is being able to load data from or save data to Memcache and Datastore in one quick call. Example use: import ( "Datastore" "appengine" ) type Address struct { Address string ... } var AddressStr string = "Address" func LoadAddress(c appengine.Context, add string) (*Address, error) { address:=new(Address) err:=Datastore.GetFromDatastoreSimpleOrMemcache(c, AddressStr, add, AddressStr+add, address) if err!=nil { c.Errorf("Address - LoadAddress error 1 - "+err.Error()) return nil, err } return address, nil } func SaveAddress(c appengine.Context, address *Address) error { _, err:=Datastore.PutInDatastoreSimpleAndMemcache(c, AddressStr, address.Address, AddressStr+address.Address, address) if err!=nil { c.Errorf("Address - SaveAddress error 1 - "+err.Error()) } return err }
About
An improved way of handling calls to App Engine's Datastore and Memcache
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published