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

Side by Side Diff: appengine/logdog/coordinator/endpoints/logs/list.go

Issue 1970823005: LogDog: Add prefix registration endpoint. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-archivist-useconfig
Patch Set: Updated patchset dependency Created 4 years, 7 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 unified diff | Download patch
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 logs 5 package logs
6 6
7 import ( 7 import (
8 ds "github.com/luci/gae/service/datastore" 8 ds "github.com/luci/gae/service/datastore"
9 "github.com/luci/luci-go/appengine/logdog/coordinator" 9 "github.com/luci/luci-go/appengine/logdog/coordinator"
10 "github.com/luci/luci-go/appengine/logdog/coordinator/hierarchy" 10 "github.com/luci/luci-go/appengine/logdog/coordinator/hierarchy"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 resp.Components[i] = &comp 86 resp.Components[i] = &comp
87 } 87 }
88 } 88 }
89 89
90 // Perform additional stream metadata fetch if state is requested. Colle ct 90 // Perform additional stream metadata fetch if state is requested. Colle ct
91 // a list of streams to load. 91 // a list of streams to load.
92 if req.State && l.Project != "" { 92 if req.State && l.Project != "" {
93 c := c 93 c := c
94 » » if err := coordinator.WithProjectNamespace(&c, l.Project); err ! = nil { 94 » » if err := coordinator.WithProjectNamespace(&c, l.Project, coordi nator.NamespaceAccessREAD); err != nil {
95 » » » // This should work, since the list would have rejected the namespace if 95 » » » // This should work, since the decorated service would h ave rejected the
96 » » » // the user was not a member, so a failure here is an in ternal error. 96 » » » // namespace if the user was not a member, so a failure here is an
97 » » » // internal error.
97 log.Fields{ 98 log.Fields{
98 log.ErrorKey: err, 99 log.ErrorKey: err,
99 "project": l.Project, 100 "project": l.Project,
100 }.Errorf(c, "Failed to enter namespace for metadata look up.") 101 }.Errorf(c, "Failed to enter namespace for metadata look up.")
101 return nil, grpcutil.Internal 102 return nil, grpcutil.Internal
102 } 103 }
103 104
104 idxMap := make(map[int]*logdog.ListResponse_Component) 105 idxMap := make(map[int]*logdog.ListResponse_Component)
105 var streams []coordinator.HashID 106 var streams []coordinator.HashID
106 107
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 151 }
151 } 152 }
152 } 153 }
153 } 154 }
154 155
155 log.Fields{ 156 log.Fields{
156 "count": len(resp.Components), 157 "count": len(resp.Components),
157 }.Infof(c, "List completed successfully.") 158 }.Infof(c, "List completed successfully.")
158 return &resp, nil 159 return &resp, nil
159 } 160 }
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/coordinatorTest/context.go ('k') | appengine/logdog/coordinator/endpoints/logs/list_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698