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

Side by Side Diff: service/datastore/properties.go

Issue 1427933002: Decouple PLS from MGS. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Derp Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « service/datastore/pls_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package datastore 5 package datastore
6 6
7 import ( 7 import (
8 "encoding/base64" 8 "encoding/base64"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 // error occurs, it's returned via error. If non-fatal conversion errors 673 // error occurs, it's returned via error. If non-fatal conversion errors
674 // occur, error will be a MultiError containing one or more ErrFieldMism atch 674 // occur, error will be a MultiError containing one or more ErrFieldMism atch
675 // objects. 675 // objects.
676 Load(PropertyMap) error 676 Load(PropertyMap) error
677 677
678 // Save returns the current property as a PropertyMap. if withMeta is tr ue, 678 // Save returns the current property as a PropertyMap. if withMeta is tr ue,
679 // then the PropertyMap contains all the metadata (e.g. '$meta' fields) 679 // then the PropertyMap contains all the metadata (e.g. '$meta' fields)
680 // which was held by this PropertyLoadSaver. 680 // which was held by this PropertyLoadSaver.
681 Save(withMeta bool) (PropertyMap, error) 681 Save(withMeta bool) (PropertyMap, error)
682 682
683 MetaGetterSetter
684
685 // Problem indicates that this PLS has a fatal problem. Usually this is 683 // Problem indicates that this PLS has a fatal problem. Usually this is
686 // set when the underlying struct has recursion, invalid field types, ne sted 684 // set when the underlying struct has recursion, invalid field types, ne sted
687 // slices, etc. 685 // slices, etc.
688 Problem() error 686 Problem() error
689 } 687 }
690 688
691 // MetaGetterSetter is the subset of PropertyLoadSaver which pertains to 689 // MetaGetterSetter is the subset of PropertyLoadSaver which pertains to
692 // getting and saving metadata. 690 // getting and saving metadata.
693 // 691 //
694 // A *struct may implement this interface to provide metadata which is 692 // A *struct may implement this interface to provide metadata which is
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 dflt = UpconvertUnderlyingType(dflt) 841 dflt = UpconvertUnderlyingType(dflt)
844 cur, err := gm(key) 842 cur, err := gm(key)
845 if err != nil { 843 if err != nil {
846 return dflt 844 return dflt
847 } 845 }
848 if dflt != nil && reflect.TypeOf(cur) != reflect.TypeOf(dflt) { 846 if dflt != nil && reflect.TypeOf(cur) != reflect.TypeOf(dflt) {
849 return dflt 847 return dflt
850 } 848 }
851 return cur 849 return cur
852 } 850 }
OLDNEW
« no previous file with comments | « service/datastore/pls_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698