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

Side by Side Diff: logdog/client/coordinator/client.go

Issue 2671633002: Update LogDog client to export its host. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | logdog/client/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 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 coordinator 5 package coordinator
6 6
7 import ( 7 import (
8 "github.com/luci/luci-go/common/auth" 8 "github.com/luci/luci-go/common/auth"
9 "github.com/luci/luci-go/grpc/prpc" 9 "github.com/luci/luci-go/grpc/prpc"
10 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1" 10 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1"
11 "github.com/luci/luci-go/logdog/common/types" 11 "github.com/luci/luci-go/logdog/common/types"
12 "github.com/luci/luci-go/luci_config/common/cfgtypes" 12 "github.com/luci/luci-go/luci_config/common/cfgtypes"
13 ) 13 )
14 14
15 var ( 15 var (
16 // Scopes is the set of scopes needed for the Coordinator user endpoints . 16 // Scopes is the set of scopes needed for the Coordinator user endpoints .
17 Scopes = []string{ 17 Scopes = []string{
18 auth.OAuthScopeEmail, 18 auth.OAuthScopeEmail,
19 } 19 }
20 ) 20 )
21 21
22 // Client wraps a Logs client with user-friendly methods. 22 // Client wraps a Logs client with user-friendly methods.
23 // 23 //
24 // Each method should operate independently, so calling methods from different 24 // Each method should operate independently, so calling methods from different
25 // goroutines must not cause any problems. 25 // goroutines must not cause any problems.
26 type Client struct { 26 type Client struct {
27 // C is the underlying LogsClient interface. 27 // C is the underlying LogsClient interface.
28 C logdog.LogsClient 28 C logdog.LogsClient
29 // Host is the LogDog host. This is loaded from the pRPC client in NewCl ient.
30 Host string
29 } 31 }
30 32
31 // NewClient returns a new Client instance bound to a pRPC Client. 33 // NewClient returns a new Client instance bound to a pRPC Client.
32 func NewClient(c *prpc.Client) *Client { 34 func NewClient(c *prpc.Client) *Client {
33 return &Client{ 35 return &Client{
34 » » C: logdog.NewLogsPRPCClient(c), 36 » » C: logdog.NewLogsPRPCClient(c),
37 » » Host: c.Host,
35 } 38 }
36 } 39 }
37 40
38 // Stream returns a Stream instance for the named stream. 41 // Stream returns a Stream instance for the named stream.
39 func (c *Client) Stream(project cfgtypes.ProjectName, path types.StreamPath) *St ream { 42 func (c *Client) Stream(project cfgtypes.ProjectName, path types.StreamPath) *St ream {
40 return &Stream{ 43 return &Stream{
41 c: c, 44 c: c,
42 project: project, 45 project: project,
43 path: path, 46 path: path,
44 } 47 }
45 } 48 }
OLDNEW
« no previous file with comments | « no previous file | logdog/client/coordinator/stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698