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

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

Issue 2575383002: Add server/cache support to gaeconfig. (Closed)
Patch Set: Un-collapse. Created 3 years, 11 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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package logs 5 package logs
6 6
7 import ( 7 import (
8 "github.com/golang/protobuf/proto"
9 log "github.com/luci/luci-go/common/logging" 8 log "github.com/luci/luci-go/common/logging"
10 "github.com/luci/luci-go/grpc/grpcutil" 9 "github.com/luci/luci-go/grpc/grpcutil"
11 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1" 10 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1"
12 "github.com/luci/luci-go/logdog/appengine/coordinator" 11 "github.com/luci/luci-go/logdog/appengine/coordinator"
13 "github.com/luci/luci-go/logdog/appengine/coordinator/endpoints" 12 "github.com/luci/luci-go/logdog/appengine/coordinator/endpoints"
14 "github.com/luci/luci-go/luci_config/common/cfgtypes" 13 "github.com/luci/luci-go/luci_config/common/cfgtypes"
15 14
15 "github.com/golang/protobuf/proto"
16 "golang.org/x/net/context" 16 "golang.org/x/net/context"
17 "google.golang.org/grpc/codes" 17 "google.golang.org/grpc/codes"
18 ) 18 )
19 19
20 // Server is the user-facing log access and query endpoint service. 20 // Server is the user-facing log access and query endpoint service.
21 type server struct { 21 type server struct {
22 // resultLimit is the maximum number of query results to return in a 22 // resultLimit is the maximum number of query results to return in a
23 // single query. If zero, the default will be used. 23 // single query. If zero, the default will be used.
24 // 24 //
25 // This is provided for testing purposes. 25 // This is provided for testing purposes.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 func (s *server) limit(v int, d int) int { 79 func (s *server) limit(v int, d int) int {
80 if s.resultLimit > 0 { 80 if s.resultLimit > 0 {
81 d = s.resultLimit 81 d = s.resultLimit
82 } 82 }
83 if v <= 0 || v > d { 83 if v <= 0 || v > d {
84 return d 84 return d
85 } 85 }
86 return v 86 return v
87 } 87 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698