go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/bisection/proto/v1/botupdatesserver_dec.go (about) 1 // Code generated by svcdec; DO NOT EDIT. 2 3 package bisectionpb 4 5 import ( 6 "context" 7 8 proto "github.com/golang/protobuf/proto" 9 ) 10 11 type DecoratedBotUpdates struct { 12 // Service is the service to decorate. 13 Service BotUpdatesServer 14 // Prelude is called for each method before forwarding the call to Service. 15 // If Prelude returns an error, then the call is skipped and the error is 16 // processed via the Postlude (if one is defined), or it is returned directly. 17 Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error) 18 // Postlude is called for each method after Service has processed the call, or 19 // after the Prelude has returned an error. This takes the Service's 20 // response proto (which may be nil) and/or any error. The decorated 21 // service will return the response (possibly mutated) and error that Postlude 22 // returns. 23 Postlude func(ctx context.Context, methodName string, rsp proto.Message, err error) error 24 } 25 26 func (s *DecoratedBotUpdates) UpdateAnalysisProgress(ctx context.Context, req *UpdateAnalysisProgressRequest) (rsp *UpdateAnalysisProgressResponse, err error) { 27 if s.Prelude != nil { 28 var newCtx context.Context 29 newCtx, err = s.Prelude(ctx, "UpdateAnalysisProgress", req) 30 if err == nil { 31 ctx = newCtx 32 } 33 } 34 if err == nil { 35 rsp, err = s.Service.UpdateAnalysisProgress(ctx, req) 36 } 37 if s.Postlude != nil { 38 err = s.Postlude(ctx, "UpdateAnalysisProgress", rsp, err) 39 } 40 return 41 } 42 43 func (s *DecoratedBotUpdates) UpdateTestAnalysisProgress(ctx context.Context, req *UpdateTestAnalysisProgressRequest) (rsp *UpdateTestAnalysisProgressResponse, err error) { 44 if s.Prelude != nil { 45 var newCtx context.Context 46 newCtx, err = s.Prelude(ctx, "UpdateTestAnalysisProgress", req) 47 if err == nil { 48 ctx = newCtx 49 } 50 } 51 if err == nil { 52 rsp, err = s.Service.UpdateTestAnalysisProgress(ctx, req) 53 } 54 if s.Postlude != nil { 55 err = s.Postlude(ctx, "UpdateTestAnalysisProgress", rsp, err) 56 } 57 return 58 }