blob: dd1fa05410503990ddd1f6739bcab17feee6ed06 [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(c 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(c context.Context, methodName string, rsp proto.Message, err error) error
}
func (s *DecoratedCertificateAuthorities) FetchCRL(c context.Context, req *FetchCRLRequest) (rsp *FetchCRLResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "FetchCRL", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.FetchCRL(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "FetchCRL", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) ListCAs(c context.Context, req *empty.Empty) (rsp *ListCAsResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "ListCAs", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.ListCAs(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "ListCAs", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) GetCAStatus(c context.Context, req *GetCAStatusRequest) (rsp *GetCAStatusResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "GetCAStatus", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.GetCAStatus(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "GetCAStatus", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) IsRevokedCert(c context.Context, req *IsRevokedCertRequest) (rsp *IsRevokedCertResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "IsRevokedCert", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.IsRevokedCert(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "IsRevokedCert", rsp, err)
}
return
}
func (s *DecoratedCertificateAuthorities) CheckCertificate(c context.Context, req *CheckCertificateRequest) (rsp *CheckCertificateResponse, err error) {
if s.Prelude != nil {
var newCtx context.Context
newCtx, err = s.Prelude(c, "CheckCertificate", req)
if err == nil {
c = newCtx
}
}
if err == nil {
rsp, err = s.Service.CheckCertificate(c, req)
}
if s.Postlude != nil {
err = s.Postlude(c, "CheckCertificate", rsp, err)
}
return
}