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

Unified Diff: milo/api/proto/buildinfoserver_dec.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/buildinfo.pb.go ('k') | milo/api/proto/generate.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/api/proto/buildinfoserver_dec.go
diff --git a/milo/api/proto/buildinfoserver_dec.go b/milo/api/proto/buildinfoserver_dec.go
new file mode 100644
index 0000000000000000000000000000000000000000..dc8277a2e93952fe0119441fe5e0429195e441dc
--- /dev/null
+++ b/milo/api/proto/buildinfoserver_dec.go
@@ -0,0 +1,38 @@
+// Code generated by svcdec; DO NOT EDIT
+
+package milo
+
+import (
+ proto "github.com/golang/protobuf/proto"
+ context "golang.org/x/net/context"
+)
+
+type DecoratedBuildInfo struct {
+ // Service is the service to decorate.
+ Service BuildInfoServer
+ // Prelude is called for each method before forwarding the call to Service.
+ // If Prelude returns an error, it the call is skipped and the error is
+ // processed via the Postlude (if one is defined), or it is returned directly.
+ Prelude func(c context.Context, methodName string, req proto.Message) (context.Context, error)
+ // Postlude is called for each method after Service has processed the call, or
+ // after the Prelude has returned an error. This takes the the Service's
+ // response proto (which may be nil) and/or any error. The decorated
+ // service will return the response (possibly mutated) and error that Postlude
+ // returns.
+ Postlude func(c context.Context, methodName string, rsp proto.Message, err error) error
+}
+
+func (s *DecoratedBuildInfo) Get(c context.Context, req *BuildInfoRequest) (rsp *BuildInfoResponse, err error) {
+ var newCtx context.Context
+ if s.Prelude != nil {
+ newCtx, err = s.Prelude(c, "Get", req)
+ }
+ if err == nil {
+ c = newCtx
+ rsp, err = s.Service.Get(c, req)
+ }
+ if s.Postlude != nil {
+ err = s.Postlude(c, "Get", rsp, err)
+ }
+ return
+}
« no previous file with comments | « milo/api/proto/buildinfo.pb.go ('k') | milo/api/proto/generate.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698