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

Unified Diff: service/rawdatastore/properties.go

Issue 1259463002: Add BoolFlag for rawdatastore. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: improve error Created 5 years, 5 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/rawdatastore/datastore_test.go ('k') | service/rawdatastore/reflect.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/rawdatastore/properties.go
diff --git a/service/rawdatastore/properties.go b/service/rawdatastore/properties.go
index f1e0341b59ce539577bd59ae536eeec678bb991b..388afba8506d41c874c6e249bfd6c6c301a7f63f 100644
--- a/service/rawdatastore/properties.go
+++ b/service/rawdatastore/properties.go
@@ -347,6 +347,18 @@ type PropertyLoadSaver interface {
// val, err := helper.GetPLS(&MyStruct{10}).GetMeta("id")
// // val == 10
// // err == nil
+ //
+ // Struct fields of type Toggle (which is an Auto/On/Off) allow you to
+ // specify a value of 'true' or 'false' for the default value of the struct
+ // tag, and GetMeta will return the combined value as a regular boolean true
+ // or false value. If a field is Toggle, a <value> MUST be specified.
+ //
+ // Example:
+ // type MyStruct struct {
+ // TFlag Toggle `gae:"$flag1,true"` // defaults to true
+ // FFlag Toggle `gae:"$flag2,false"` // defaults to false
+ // // BadFlag Toggle `gae:"$flag3"` // ILLEGAL
+ // }
GetMeta(key string) (interface{}, error)
// SetMeta allows you to set the current value of the meta-keyed field.
« no previous file with comments | « service/rawdatastore/datastore_test.go ('k') | service/rawdatastore/reflect.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698