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

Unified Diff: milo/appengine/buildinfo/service.go

Issue 2667353002: milo: Add barebones BuildInfo pRPC service. (Closed)
Patch Set: Swap order, users first. Created 3 years, 11 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildinfo/service.go
diff --git a/milo/appengine/buildinfo/service.go b/milo/appengine/buildinfo/service.go
new file mode 100644
index 0000000000000000000000000000000000000000..12ddb21b6bf8c740c16e338dfaea81d906a51b7a
--- /dev/null
+++ b/milo/appengine/buildinfo/service.go
@@ -0,0 +1,41 @@
+// Copyright 2017 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package buildinfo
+
+import (
+ "github.com/luci/luci-go/grpc/grpcutil"
+ "github.com/luci/luci-go/luci_config/common/cfgtypes"
+ milo "github.com/luci/luci-go/milo/api/proto"
+
+ "google.golang.org/grpc/codes"
+
+ "golang.org/x/net/context"
+)
+
+// Service is a BuildInfoServer implementation.
+type Service struct{}
+
+var _ milo.BuildInfoServer = (*Service)(nil)
+
+// Get implements milo.BuildInfoServer.
+func (svc *Service) Get(c context.Context, req *milo.BuildInfoRequest) (*milo.BuildInfoResponse, error) {
+ projectHint := cfgtypes.ProjectName(req.ProjectHint)
+ if projectHint != "" {
+ if err := projectHint.Validate(); err != nil {
+ return nil, grpcutil.Errf(codes.InvalidArgument, "invalid project hint: %s", err.Error())
+ }
+ }
+
+ switch {
+ case req.GetBuildbot() != nil:
+ return nil, grpcutil.Unimplemented
+
+ case req.GetSwarming() != nil:
+ return nil, grpcutil.Unimplemented
+
+ default:
+ return nil, grpcutil.Unimplemented
+ }
+}
« 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