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

Side by Side Diff: grpc/discovery/discovery.go

Issue 2219023003: Update APIs to use new Google cloud paths. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 4 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 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 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 discovery implements RPC service introspection. 5 // Package discovery implements RPC service introspection.
6 package discovery 6 package discovery
7 7
8 import ( 8 import (
9 "crypto/sha1" 9 "crypto/sha1"
10 "fmt" 10 "fmt"
11 11
12 "github.com/golang/protobuf/proto" 12 "github.com/golang/protobuf/proto"
13 "golang.org/x/net/context" 13 "golang.org/x/net/context"
14 14
15 "github.com/luci/luci-go/common/proto/google/descriptor"
16 "github.com/luci/luci-go/grpc/prpc" 15 "github.com/luci/luci-go/grpc/prpc"
16 "google.golang.org/genproto/protobuf"
17 ) 17 )
18 18
19 // New creates a discovery server for all the given services. 19 // New creates a discovery server for all the given services.
20 // The service descriptions must be registered using 20 // The service descriptions must be registered using
21 // RegisterDescriptorSetCompressed which is called by init() function 21 // RegisterDescriptorSetCompressed which is called by init() function
22 // generated by github.com/luci/luci-go/grpc/cmd/cproto. 22 // generated by github.com/luci/luci-go/grpc/cmd/cproto.
23 func New(serviceNames ...string) (DiscoveryServer, error) { 23 func New(serviceNames ...string) (DiscoveryServer, error) {
24 desc, err := combineDescriptors(serviceNames) 24 desc, err := combineDescriptors(serviceNames)
25 if err != nil { 25 if err != nil {
26 return nil, err 26 return nil, err
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 hash := sha1.Sum(binary) 82 hash := sha1.Sum(binary)
83 if !seenFiles[hash] { 83 if !seenFiles[hash] {
84 result.File = append(result.File, f) 84 result.File = append(result.File, f)
85 seenFiles[hash] = true 85 seenFiles[hash] = true
86 } 86 }
87 87
88 } 88 }
89 } 89 }
90 return result, nil 90 return result, nil
91 } 91 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698