Clearing AppBanner BlobStore
2 answers
You can list https://cloud.google.com/appengine/docs/go/blobstore/reference#BlobInfo via a datastore request (although such a request is ultimately agreed upon).
+1
source to share
Here is a code-behind solution for iterating over blobs in golang:
c.Infof("Iterating over blobs")
q := datastore.NewQuery("__BlobInfo__")
// Iterate over the results.
total := 0
t := q.Run(c)
for {
var bi blobstore.BlobInfo
_, err := t.Next(&bi)
if err == datastore.Done {
break
}
if err != nil && isErrFieldMismatch(err) == false {
c.Errorf("Error fetching next Blob: %v", err)
break
}
// Do something with the Blob bi
c.Infof("Got blob [%v] of size [%v]", bi.ContentType, bi.Size)
total++
if total > 100 { break }
}
c.Infof("Iterating Done")
You will also need to use this function to ignore field mismatch errors:
func isErrFieldMismatch(err error) bool {
_, ok := err.(*datastore.ErrFieldMismatch)
return ok
}
0
source to share