This is totally off the top of my head... so it may not even compile, but here is something to get you started that you can try out:
import (
"net/http"
"appengine"
"appengine/datastore"
)
func handle(w http.ResponseWriter, req *http.Request) {
c := appengine.NewContext(req)
q := datastore.NewQuery(EntryKind).KeysOnly()
keys := []*datastore.Key{}
for t := q.Run(c); ; {
k, err := t.Next(nil)
if err == datastore.Done {
break
}
if err != nil {
c.Errorf("datastore t.Next error: %v", err)
return
}
keys = append(keys, k)
}
if len(keys) == 0 {
return
}
if err := datastore.DeleteMulti(c, keys); err != nil {
c.Errorf("datastore.DeleteMulti error: %v", err)
return
}
c.Infof("Deleted %d entries.", len(keys))
}
Note that you only have 60 seconds to do all this... unless you use a taskqueue...
Another alternative is to use "Query.GetAll" (with its limit of 1000) and call it multiple times until everything is all gone.
Anyway, I hope that helps.
-- Glenn