Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Unified Diff: service/datastore/properties.go

Issue 2037433002: Add datastore dumper tool. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@allow_unsigned
Patch Set: fix copyright Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « service/datastore/dumper/dumper_example_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/properties.go
diff --git a/service/datastore/properties.go b/service/datastore/properties.go
index 3a9e7e510cb8d1b641b6789f144dc46c81266ffa..2808c3804702d400198792664ac025441fe2a3da 100644
--- a/service/datastore/properties.go
+++ b/service/datastore/properties.go
@@ -336,6 +336,17 @@ func UpconvertUnderlyingType(o interface{}) interface{} {
return o
}
+func (p Property) String() string {
+ switch p.propType {
+ case PTString, PTBlobKey:
+ return fmt.Sprintf("%s(%q)", p.propType, p.Value())
+ case PTBytes:
+ return fmt.Sprintf("%s(%#x)", p.propType, p.Value())
+ default:
+ return fmt.Sprintf("%s(%v)", p.propType, p.Value())
+ }
+}
+
// Value returns the current value held by this property. It's guaranteed to
// be a valid value type (i.e. `p.SetValue(p.Value(), true)` will never return
// an error).
« no previous file with comments | « service/datastore/dumper/dumper_example_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698