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

Side by Side Diff: common/logdog/coordinator/query.go

Issue 1916013002: LogDog: Add project namespacing to `logdog_cat` (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-collector-butler
Patch Set: Rebase, project UI. 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
« no previous file with comments | « common/logdog/coordinator/list.go ('k') | common/logdog/coordinator/stream.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 package coordinator 5 package coordinator
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 "github.com/luci/luci-go/common/api/logdog_coordinator/logs/v1" 10 "github.com/luci/luci-go/common/api/logdog_coordinator/logs/v1"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // QueryCallback is a callback method type that is used in query requests. 126 // QueryCallback is a callback method type that is used in query requests.
127 // 127 //
128 // If it returns false, additional callbacks and queries will be aborted. 128 // If it returns false, additional callbacks and queries will be aborted.
129 type QueryCallback func(r *LogStream) bool 129 type QueryCallback func(r *LogStream) bool
130 130
131 // Query executes a query, invoking the supplied callback once for each query 131 // Query executes a query, invoking the supplied callback once for each query
132 // result. 132 // result.
133 func (c *Client) Query(ctx context.Context, q *Query, cb QueryCallback) error { 133 func (c *Client) Query(ctx context.Context, q *Query, cb QueryCallback) error {
134 req := logdog.QueryRequest{ 134 req := logdog.QueryRequest{
135 Project: string(c.project),
135 Path: q.Path, 136 Path: q.Path,
136 ContentType: q.ContentType, 137 ContentType: q.ContentType,
137 Older: google.NewTimestamp(q.Before), 138 Older: google.NewTimestamp(q.Before),
138 Newer: google.NewTimestamp(q.After), 139 Newer: google.NewTimestamp(q.After),
139 Terminated: q.Terminated.queryValue(), 140 Terminated: q.Terminated.queryValue(),
140 Archived: q.Archived.queryValue(), 141 Archived: q.Archived.queryValue(),
141 Purged: q.Purged.queryValue(), 142 Purged: q.Purged.queryValue(),
142 State: q.State, 143 State: q.State,
143 } 144 }
144 if st := q.StreamType.queryValue(); st >= 0 { 145 if st := q.StreamType.queryValue(); st >= 0 {
(...skipping 22 matching lines...) Expand all
167 } 168 }
168 } 169 }
169 170
170 // Advance our query cursor. 171 // Advance our query cursor.
171 if resp.Next == "" { 172 if resp.Next == "" {
172 return nil 173 return nil
173 } 174 }
174 req.Next = resp.Next 175 req.Next = resp.Next
175 } 176 }
176 } 177 }
OLDNEW
« no previous file with comments | « common/logdog/coordinator/list.go ('k') | common/logdog/coordinator/stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698