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

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

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Fix proto comment. Created 4 years, 8 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 "github.com/luci/luci-go/appengine/logdog/coordinator" 8 "github.com/luci/luci-go/appengine/logdog/coordinator"
9 "github.com/luci/luci-go/common/api/logdog_coordinator/logs/v1" 9 "github.com/luci/luci-go/common/api/logdog_coordinator/logs/v1"
10 ) 10 )
11 11
12 // Server is the user-facing log access and query endpoint service. 12 // Server is the user-facing log access and query endpoint service.
13 type Server struct { 13 type Server struct {
14 » coordinator.Service 14 » coordinator.ServiceBase
15 15
16 // resultLimit is the maximum number of query results to return in a 16 // resultLimit is the maximum number of query results to return in a
17 // single query. If zero, the default will be used. 17 // single query. If zero, the default will be used.
18 // 18 //
19 // This is provided for testing purposes. 19 // This is provided for testing purposes.
20 resultLimit int 20 resultLimit int
21 } 21 }
22 22
23 var _ logdog.LogsServer = (*Server)(nil)
24
23 func (s *Server) limit(v int, d int) int { 25 func (s *Server) limit(v int, d int) int {
24 if s.resultLimit > 0 { 26 if s.resultLimit > 0 {
25 d = s.resultLimit 27 d = s.resultLimit
26 } 28 }
27 if v <= 0 || v > d { 29 if v <= 0 || v > d {
28 return d 30 return d
29 } 31 }
30 return v 32 return v
31 } 33 }
32
33 var _ logdog.LogsServer = (*Server)(nil)
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/endpoints/logs/query_test.go ('k') | appengine/logdog/coordinator/endpoints/logs/util.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698