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

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

Issue 2667353002: milo: Add barebones BuildInfo pRPC service. (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
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())
hinoka 2017/02/02 22:46:23 Available hints include: <add all hints>
dnj 2017/02/03 01:53:26 ! Can't list all projects here yet. Maybe can late
dnj 2017/02/03 01:54:25 Oh also, this implies a malformed project name, no
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

Powered by Google App Engine
This is Rietveld 408576698