Chromium Code Reviews

Side by Side Diff: go/src/infra/gae/libs/meta/eg.go

Issue 1153883002: go: infra/libs/* now live in luci-go. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: move the rest too Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « go/src/infra/gae/libs/context/context.go ('k') | go/src/infra/libs/auth/auth.go » ('j') | 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 // +build appengine 5 // +build appengine
6 6
7 package meta 7 package meta
8 8
9 import ( 9 import (
10 "appengine/datastore" 10 "appengine/datastore"
11 11
12 "github.com/luci/luci-go/common/errors"
13
12 "infra/gae/libs/context" 14 "infra/gae/libs/context"
13 "infra/libs/errors"
14 ) 15 )
15 16
16 var mark = errors.MakeMarkFn("eg") 17 var mark = errors.MakeMarkFn("eg")
17 18
18 // EntityGroupMeta is the model corresponding to the __entity_group__ model in 19 // EntityGroupMeta is the model corresponding to the __entity_group__ model in
19 // appengine. You shouldn't need to use this struct directly, but instead should 20 // appengine. You shouldn't need to use this struct directly, but instead should
20 // use GetEntityGroupVersion. 21 // use GetEntityGroupVersion.
21 type EntityGroupMeta struct { 22 type EntityGroupMeta struct {
22 _kind string `datastore:"-" goon:"kind,__entity_group__"` 23 _kind string `datastore:"-" goon:"kind,__entity_group__"`
23 24
(...skipping 14 matching lines...)
38 err := c.Get(egm) 39 err := c.Get(egm)
39 if err != datastore.ErrNoSuchEntity { 40 if err != datastore.ErrNoSuchEntity {
40 err = mark(err) 41 err = mark(err)
41 } else { 42 } else {
42 // this is OK for callers. The version of the entity group is ef fectively 0 43 // this is OK for callers. The version of the entity group is ef fectively 0
43 // in this case. 44 // in this case.
44 err = nil 45 err = nil
45 } 46 }
46 return egm.Version, err 47 return egm.Version, err
47 } 48 }
OLDNEW
« no previous file with comments | « go/src/infra/gae/libs/context/context.go ('k') | go/src/infra/libs/auth/auth.go » ('j') | no next file with comments »

Powered by Google App Engine