blob: 3e05af41be60d9fa87bef54a3611dcb52729786c [file] [log] [blame]
// Code generated by svcdec; DO NOT EDIT.
package logdog
import (
"context"
proto "github.com/golang/protobuf/proto"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
type DecoratedServices struct {
// Service is the service to decorate.
Service ServicesServer
// 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 *DecoratedServices) RegisterStream(ctx context.Context, req *RegisterStreamRequest) (rsp *RegisterStreamResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "RegisterStream", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.RegisterStream(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "RegisterStream", rsp, err)
}
return
}
func (s *DecoratedServices) LoadStream(ctx context.Context, req *LoadStreamRequest) (rsp *LoadStreamResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "LoadStream", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.LoadStream(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "LoadStream", rsp, err)
}
return
}
func (s *DecoratedServices) TerminateStream(ctx context.Context, req *TerminateStreamRequest) (rsp *emptypb.Empty, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "TerminateStream", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.TerminateStream(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "TerminateStream", rsp, err)
}
return
}
func (s *DecoratedServices) ArchiveStream(ctx context.Context, req *ArchiveStreamRequest) (rsp *emptypb.Empty, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ArchiveStream", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ArchiveStream(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ArchiveStream", rsp, err)
}
return
}
func (s *DecoratedServices) 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 *DecoratedServices) LeaseArchiveTasks(ctx context.Context, req *LeaseRequest) (rsp *LeaseResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "LeaseArchiveTasks", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.LeaseArchiveTasks(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "LeaseArchiveTasks", rsp, err)
}
return
}
func (s *DecoratedServices) DeleteArchiveTasks(ctx context.Context, req *DeleteRequest) (rsp *emptypb.Empty, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "DeleteArchiveTasks", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.DeleteArchiveTasks(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "DeleteArchiveTasks", rsp, err)
}
return
}