mirrored from https://chromium.googlesource.com/infra/luci/luci-go
-
Notifications
You must be signed in to change notification settings - Fork 43
/
certificateauthoritiesserver_dec.go
111 lines (101 loc) · 3.14 KB
/
certificateauthoritiesserver_dec.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// 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
}