Documentation ¶
Overview ¶
Package todo provides a type and several functions for interacting with todos backed by the Appengine Datastore. Todo entities are stored as descendants of the same parent, such that the lookups can be made strongly consistent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete removes the todo with the given key from the datastore. It returns an error if one occurred.
func DeleteCompleted ¶
DeleteCompleted removes all finished todos from the datastore.
Types ¶
type Todo ¶
type Todo struct { Key *datastore.Key `datastore:"-" json:"id"` // Unique identifier Title string `json:"title"` // Description Done bool `json:"completed"` // Is this todo done? }
func All ¶
All returns a slice containing all todos in the datastore and an error, if one occurred. If there was no error, all todos will have their Key field initialized.
The underlying query is strongly consistent.
func Get ¶
Get returns the todo with the given id and an error, if one occurred. If there was an error, the returned Todo should be considered unusable.
The underlying query is strongly consistent.