blob: 11fc42cc47ed363c101ad48b5f9c6662c3dcc736 [file] [log] [blame]
// Code generated by svcdec; DO NOT EDIT.
package admin
import (
"context"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
)
type DecoratedCertificateAuthorities struct {
// Service is the service to decorate.
Service CertificateAuthoritiesServer
// 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 *DecoratedCertificateAuthorities) FetchCRL(ctx context.Context, req *FetchCRLRequest) (rsp *FetchCRLResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "FetchCRL", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.FetchCRL(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "FetchCRL", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) ListCAs(ctx context.Context, req *empty.Empty) (rsp *ListCAsResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "ListCAs", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.ListCAs(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "ListCAs", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) GetCAStatus(ctx context.Context, req *GetCAStatusRequest) (rsp *GetCAStatusResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "GetCAStatus", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.GetCAStatus(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "GetCAStatus", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) IsRevokedCert(ctx context.Context, req *IsRevokedCertRequest) (rsp *IsRevokedCertResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "IsRevokedCert", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.IsRevokedCert(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "IsRevokedCert", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) CheckCertificate(ctx context.Context, req *CheckCertificateRequest) (rsp *CheckCertificateResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(ctx, "CheckCertificate", req)
if err == nil {
ctx = newCtx
}
}
if err == nil {
rsp, err = s.Service.CheckCertificate(ctx, req)
}
if s.Postlude != nil {
err = s.Postlude(ctx, "CheckCertificate", rsp, err)
}
return
}