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

Side by Side Diff: milo/appengine/buildinfo/service.go

Issue 2667353002: milo: Add barebones BuildInfo pRPC service. (Closed)
Patch Set: Swap order, users first. 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 | « milo/api/proto/pb.discovery.go ('k') | milo/appengine/frontend/milo.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
5 package buildinfo
6
7 import (
8 "github.com/luci/luci-go/grpc/grpcutil"
9 "github.com/luci/luci-go/luci_config/common/cfgtypes"
10 milo "github.com/luci/luci-go/milo/api/proto"
11
12 "google.golang.org/grpc/codes"
13
14 "golang.org/x/net/context"
15 )
16
17 // Service is a BuildInfoServer implementation.
18 type Service struct{}
19
20 var _ milo.BuildInfoServer = (*Service)(nil)
21
22 // Get implements milo.BuildInfoServer.
23 func (svc *Service) Get(c context.Context, req *milo.BuildInfoRequest) (*milo.Bu ildInfoResponse, error) {
24 projectHint := cfgtypes.ProjectName(req.ProjectHint)
25 if projectHint != "" {
26 if err := projectHint.Validate(); err != nil {
27 return nil, grpcutil.Errf(codes.InvalidArgument, "invali d project hint: %s", err.Error())
28 }
29 }
30
31 switch {
32 case req.GetBuildbot() != nil:
33 return nil, grpcutil.Unimplemented
34
35 case req.GetSwarming() != nil:
36 return nil, grpcutil.Unimplemented
37
38 default:
39 return nil, grpcutil.Unimplemented
40 }
41 }
OLDNEW
« no previous file with comments | « milo/api/proto/pb.discovery.go ('k') | milo/appengine/frontend/milo.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698