| // Code generated by svcdec; DO NOT EDIT. |
| |
| package buildbucketpb |
| |
| import ( |
| "context" |
| |
| proto "github.com/golang/protobuf/proto" |
| ) |
| |
| type DecoratedBuilds struct { |
| // Service is the service to decorate. |
| Service BuildsServer |
| // Prelude is called for each method before forwarding the call to Service. |
| // If Prelude returns an error, then the call is skipped and the error is |
| // processed via the Postlude (if one is defined), or it is returned directly. |
| Prelude func(ctx 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 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(ctx context.Context, methodName string, rsp proto.Message, err error) error |
| } |
| |
| func (s *DecoratedBuilds) GetBuild(ctx context.Context, req *GetBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "GetBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.GetBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "GetBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) SearchBuilds(ctx context.Context, req *SearchBuildsRequest) (rsp *SearchBuildsResponse, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "SearchBuilds", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.SearchBuilds(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "SearchBuilds", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) UpdateBuild(ctx context.Context, req *UpdateBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "UpdateBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.UpdateBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "UpdateBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) ScheduleBuild(ctx context.Context, req *ScheduleBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "ScheduleBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.ScheduleBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "ScheduleBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) CancelBuild(ctx context.Context, req *CancelBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "CancelBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.CancelBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "CancelBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) Batch(ctx context.Context, req *BatchRequest) (rsp *BatchResponse, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "Batch", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.Batch(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "Batch", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) CreateBuild(ctx context.Context, req *CreateBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "CreateBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.CreateBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "CreateBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) SynthesizeBuild(ctx context.Context, req *SynthesizeBuildRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "SynthesizeBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.SynthesizeBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "SynthesizeBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) GetBuildStatus(ctx context.Context, req *GetBuildStatusRequest) (rsp *Build, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "GetBuildStatus", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.GetBuildStatus(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "GetBuildStatus", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) StartBuild(ctx context.Context, req *StartBuildRequest) (rsp *StartBuildResponse, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "StartBuild", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.StartBuild(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "StartBuild", rsp, err) |
| } |
| return |
| } |
| |
| func (s *DecoratedBuilds) CustomMetricPreview(ctx context.Context, req *CustomMetricPreviewRequest) (rsp *CustomMetricPreviewResponse, err error) { |
| if s.Prelude != nil { |
| var newCtx context.Context |
| newCtx, err = s.Prelude(ctx, "CustomMetricPreview", req) |
| if err == nil { |
| ctx = newCtx |
| } |
| } |
| if err == nil { |
| rsp, err = s.Service.CustomMetricPreview(ctx, req) |
| } |
| if s.Postlude != nil { |
| err = s.Postlude(ctx, "CustomMetricPreview", rsp, err) |
| } |
| return |
| } |