blob: 62c45ff45638b9d1e5ad752b91268f9b1f7b5ff0 [file] [log] [blame]
// Code generated by svcdec; DO NOT EDIT.
package rotationproxy
import (
"context"
proto "github.com/golang/protobuf/proto"
)
type DecoratedRotationProxyService struct {
// Service is the service to decorate.
Service RotationProxyServiceServer
// 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 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 *DecoratedRotationProxyService) BatchUpdateRotations(ctx context.Context, req *BatchUpdateRotationsRequest) (rsp *BatchUpdateRotationsResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "BatchUpdateRotations", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.BatchUpdateRotations(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "BatchUpdateRotations", rsp, err)
}
return
}
func (s *DecoratedRotationProxyService) GetRotation(ctx context.Context, req *GetRotationRequest) (rsp *Rotation, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "GetRotation", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.GetRotation(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "GetRotation", rsp, err)
}
return
}
func (s *DecoratedRotationProxyService) BatchGetRotations(ctx context.Context, req *BatchGetRotationsRequest) (rsp *BatchGetRotationsResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "BatchGetRotations", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.BatchGetRotations(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "BatchGetRotations", rsp, err)
}
return
}