| OLD | NEW |
| 1 // Code generated by svcdec; DO NOT EDIT | 1 // Code generated by svcdec; DO NOT EDIT |
| 2 | 2 |
| 3 package logdog | 3 package milo |
| 4 | 4 |
| 5 import ( | 5 import ( |
| 6 proto "github.com/golang/protobuf/proto" | 6 proto "github.com/golang/protobuf/proto" |
| 7 context "golang.org/x/net/context" | 7 context "golang.org/x/net/context" |
| 8 ) | 8 ) |
| 9 | 9 |
| 10 type DecoratedRegistration struct { | 10 type DecoratedBuildbot struct { |
| 11 // Service is the service to decorate. | 11 // Service is the service to decorate. |
| 12 » Service RegistrationServer | 12 » Service BuildbotServer |
| 13 // Prelude is called for each method before forwarding the call to Servi
ce. | 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 | 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. | 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) | 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 | 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 | 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 | 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 | 20 // service will return the response (possibly mutated) and error that Po
stlude |
| 21 // returns. | 21 // returns. |
| 22 Postlude func(c context.Context, methodName string, rsp proto.Message, e
rr error) error | 22 Postlude func(c context.Context, methodName string, rsp proto.Message, e
rr error) error |
| 23 } | 23 } |
| 24 | 24 |
| 25 func (s *DecoratedRegistration) RegisterPrefix(c context.Context, req *RegisterP
refixRequest) (rsp *RegisterPrefixResponse, err error) { | 25 func (s *DecoratedBuildbot) GetCompressedMasterJSON(c context.Context, req *Mast
erRequest) (rsp *CompressedMasterJSON, err error) { |
| 26 var newCtx context.Context | 26 var newCtx context.Context |
| 27 if s.Prelude != nil { | 27 if s.Prelude != nil { |
| 28 » » newCtx, err = s.Prelude(c, "RegisterPrefix", req) | 28 » » newCtx, err = s.Prelude(c, "GetCompressedMasterJSON", req) |
| 29 } | 29 } |
| 30 if err == nil { | 30 if err == nil { |
| 31 c = newCtx | 31 c = newCtx |
| 32 » » rsp, err = s.Service.RegisterPrefix(c, req) | 32 » » rsp, err = s.Service.GetCompressedMasterJSON(c, req) |
| 33 } | 33 } |
| 34 if s.Postlude != nil { | 34 if s.Postlude != nil { |
| 35 » » err = s.Postlude(c, "RegisterPrefix", rsp, err) | 35 » » err = s.Postlude(c, "GetCompressedMasterJSON", rsp, err) |
| 36 } | 36 } |
| 37 return | 37 return |
| 38 } | 38 } |
| OLD | NEW |