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

Side by Side 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, 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/buildinfo.pb.go ('k') | milo/api/proto/generate.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 // Code generated by svcdec; DO NOT EDIT
2
3 package milo
4
5 import (
6 proto "github.com/golang/protobuf/proto"
7 context "golang.org/x/net/context"
8 )
9
10 type DecoratedBuildInfo struct {
11 // Service is the service to decorate.
12 Service BuildInfoServer
13 // Prelude is called for each method before forwarding the call to Servi ce.
14 // If Prelude returns an error, it the call is skipped and the error is
15 // processed via the Postlude (if one is defined), or it is returned dir ectly.
16 Prelude func(c context.Context, methodName string, req proto.Message) (c ontext.Context, error)
17 // Postlude is called for each method after Service has processed the ca ll, or
18 // after the Prelude has returned an error. This takes the the Service's
19 // response proto (which may be nil) and/or any error. The decorated
20 // service will return the response (possibly mutated) and error that Po stlude
21 // returns.
22 Postlude func(c context.Context, methodName string, rsp proto.Message, e rr error) error
23 }
24
25 func (s *DecoratedBuildInfo) Get(c context.Context, req *BuildInfoRequest) (rsp *BuildInfoResponse, err error) {
26 var newCtx context.Context
27 if s.Prelude != nil {
28 newCtx, err = s.Prelude(c, "Get", req)
29 }
30 if err == nil {
31 c = newCtx
32 rsp, err = s.Service.Get(c, req)
33 }
34 if s.Postlude != nil {
35 err = s.Postlude(c, "Get", rsp, err)
36 }
37 return
38 }
OLDNEW
« 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