OLD | NEW |
1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package datastore | 5 package datastore |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "reflect" | 9 "reflect" |
10 | 10 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // | 282 // |
283 // GetMeta will be implemented, returning the *Key for the "key" meta. | 283 // GetMeta will be implemented, returning the *Key for the "key" meta. |
284 // | 284 // |
285 // If slot is addressable, SetMeta will allow it to be set to the supplied | 285 // If slot is addressable, SetMeta will allow it to be set to the supplied |
286 // Value. | 286 // Value. |
287 type keyMGS struct { | 287 type keyMGS struct { |
288 slot reflect.Value | 288 slot reflect.Value |
289 } | 289 } |
290 | 290 |
291 func (mgs *keyMGS) GetAllMeta() PropertyMap { | 291 func (mgs *keyMGS) GetAllMeta() PropertyMap { |
292 » return PropertyMap{"$key": []Property{MkPropertyNI(mgs.slot.Interface())
}} | 292 » return PropertyMap{"$key": MkPropertyNI(mgs.slot.Interface())} |
293 } | 293 } |
294 | 294 |
295 func (mgs *keyMGS) GetMeta(key string) (interface{}, bool) { | 295 func (mgs *keyMGS) GetMeta(key string) (interface{}, bool) { |
296 if key != "key" { | 296 if key != "key" { |
297 return nil, false | 297 return nil, false |
298 } | 298 } |
299 return mgs.slot.Interface(), true | 299 return mgs.slot.Interface(), true |
300 } | 300 } |
301 | 301 |
302 func (mgs *keyMGS) SetMeta(key string, value interface{}) bool { | 302 func (mgs *keyMGS) SetMeta(key string, value interface{}) bool { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 default: | 565 default: |
566 // Pass through to track as MultiError. | 566 // Pass through to track as MultiError. |
567 bt.errorTracker.trackError(it, err) | 567 bt.errorTracker.trackError(it, err) |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
571 func (bt *boolTracker) result() *ExistsResult { | 571 func (bt *boolTracker) result() *ExistsResult { |
572 bt.res.updateSlices() | 572 bt.res.updateSlices() |
573 return &bt.res | 573 return &bt.res |
574 } | 574 } |
OLD | NEW |