Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |