Debian Codegraph @

apis/v2/api_grpc.pb.go

raw
1 /*
2 Copyright The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 //
18 //Copyright 2022 The Kubernetes Authors.
19 //
20 //Licensed under the Apache License, Version 2.0 (the "License");
21 //you may not use this file except in compliance with the License.
22 //You may obtain a copy of the License at
23 //
24 //http://www.apache.org/licenses/LICENSE-2.0
25 //
26 //Unless required by applicable law or agreed to in writing, software
27 //distributed under the License is distributed on an "AS IS" BASIS,
28 //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29 //See the License for the specific language governing permissions and
30 //limitations under the License.
31
32 // To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
33
34 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
35 // versions:
36 // - protoc-gen-go-grpc v1.5.1
37 // - protoc v4.23.4
38 // source: staging/src/k8s.io/kms/apis/v2/api.proto
39
40 package v2
41
42 import (
43 context "context"
44 grpc "google.golang.org/grpc"
45 codes "google.golang.org/grpc/codes"
46 status "google.golang.org/grpc/status"
47 )
48
49 // This is a compile-time assertion to ensure that this generated file
50 // is compatible with the grpc package it is being compiled against.
51 // Requires gRPC-Go v1.64.0 or later.
52 const _ = grpc.SupportPackageIsVersion9
53
54 const (
55 KeyManagementService_Status_FullMethodName = "/v2.KeyManagementService/Status"
56 KeyManagementService_Decrypt_FullMethodName = "/v2.KeyManagementService/Decrypt"
57 KeyManagementService_Encrypt_FullMethodName = "/v2.KeyManagementService/Encrypt"
58 )
59
60 // KeyManagementServiceClient is the client API for KeyManagementService service.
61 //
62 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
63 //
64 // This service defines the public APIs for remote KMS provider.
65 type KeyManagementServiceClient interface {
66 // this API is meant to be polled
67 Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
68 // Execute decryption operation in KMS provider.
69 Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error)
70 // Execute encryption operation in KMS provider.
71 Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error)
72 }
73
74 type keyManagementServiceClient struct {
75 cc grpc.ClientConnInterface
76 }
77
78 func NewKeyManagementServiceClient(cc grpc.ClientConnInterface) KeyManagementServiceClient {
79 return &keyManagementServiceClient{cc}
80 }
81
82 func (c *keyManagementServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
83 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
84 out := new(StatusResponse)
85 err := c.cc.Invoke(ctx, KeyManagementService_Status_FullMethodName, in, out, cOpts...)
86 if err != nil {
87 return nil, err
88 }
89 return out, nil
90 }
91
92 func (c *keyManagementServiceClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) {
93 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
94 out := new(DecryptResponse)
95 err := c.cc.Invoke(ctx, KeyManagementService_Decrypt_FullMethodName, in, out, cOpts...)
96 if err != nil {
97 return nil, err
98 }
99 return out, nil
100 }
101
102 func (c *keyManagementServiceClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) {
103 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
104 out := new(EncryptResponse)
105 err := c.cc.Invoke(ctx, KeyManagementService_Encrypt_FullMethodName, in, out, cOpts...)
106 if err != nil {
107 return nil, err
108 }
109 return out, nil
110 }
111
112 // KeyManagementServiceServer is the server API for KeyManagementService service.
113 // All implementations must embed UnimplementedKeyManagementServiceServer
114 // for forward compatibility.
115 //
116 // This service defines the public APIs for remote KMS provider.
117 type KeyManagementServiceServer interface {
118 // this API is meant to be polled
119 Status(context.Context, *StatusRequest) (*StatusResponse, error)
120 // Execute decryption operation in KMS provider.
121 Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error)
122 // Execute encryption operation in KMS provider.
123 Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error)
124 mustEmbedUnimplementedKeyManagementServiceServer()
125 }
126
127 // UnimplementedKeyManagementServiceServer must be embedded to have
128 // forward compatible implementations.
129 //
130 // NOTE: this should be embedded by value instead of pointer to avoid a nil
131 // pointer dereference when methods are called.
132 type UnimplementedKeyManagementServiceServer struct{}
133
134 func (UnimplementedKeyManagementServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) {
135 return nil, status.Errorf(codes.Unimplemented, "method Status not implemented")
136 }
137 func (UnimplementedKeyManagementServiceServer) Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) {
138 return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented")
139 }
140 func (UnimplementedKeyManagementServiceServer) Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) {
141 return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented")
142 }
143 func (UnimplementedKeyManagementServiceServer) mustEmbedUnimplementedKeyManagementServiceServer() {}
144 func (UnimplementedKeyManagementServiceServer) testEmbeddedByValue() {}
145
146 // UnsafeKeyManagementServiceServer may be embedded to opt out of forward compatibility for this service.
147 // Use of this interface is not recommended, as added methods to KeyManagementServiceServer will
148 // result in compilation errors.
149 type UnsafeKeyManagementServiceServer interface {
150 mustEmbedUnimplementedKeyManagementServiceServer()
151 }
152
153 func RegisterKeyManagementServiceServer(s grpc.ServiceRegistrar, srv KeyManagementServiceServer) {
154 // If the following call pancis, it indicates UnimplementedKeyManagementServiceServer was
155 // embedded by pointer and is nil. This will cause panics if an
156 // unimplemented method is ever invoked, so we test this at initialization
157 // time to prevent it from happening at runtime later due to I/O.
158 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
159 t.testEmbeddedByValue()
160 }
161 s.RegisterService(&KeyManagementService_ServiceDesc, srv)
162 }
163
164 func _KeyManagementService_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
165 in := new(StatusRequest)
166 if err := dec(in); err != nil {
167 return nil, err
168 }
169 if interceptor == nil {
170 return srv.(KeyManagementServiceServer).Status(ctx, in)
171 }
172 info := &grpc.UnaryServerInfo{
173 Server: srv,
174 FullMethod: KeyManagementService_Status_FullMethodName,
175 }
176 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
177 return srv.(KeyManagementServiceServer).Status(ctx, req.(*StatusRequest))
178 }
179 return interceptor(ctx, in, info, handler)
180 }
181
182 func _KeyManagementService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
183 in := new(DecryptRequest)
184 if err := dec(in); err != nil {
185 return nil, err
186 }
187 if interceptor == nil {
188 return srv.(KeyManagementServiceServer).Decrypt(ctx, in)
189 }
190 info := &grpc.UnaryServerInfo{
191 Server: srv,
192 FullMethod: KeyManagementService_Decrypt_FullMethodName,
193 }
194 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
195 return srv.(KeyManagementServiceServer).Decrypt(ctx, req.(*DecryptRequest))
196 }
197 return interceptor(ctx, in, info, handler)
198 }
199
200 func _KeyManagementService_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
201 in := new(EncryptRequest)
202 if err := dec(in); err != nil {
203 return nil, err
204 }
205 if interceptor == nil {
206 return srv.(KeyManagementServiceServer).Encrypt(ctx, in)
207 }
208 info := &grpc.UnaryServerInfo{
209 Server: srv,
210 FullMethod: KeyManagementService_Encrypt_FullMethodName,
211 }
212 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
213 return srv.(KeyManagementServiceServer).Encrypt(ctx, req.(*EncryptRequest))
214 }
215 return interceptor(ctx, in, info, handler)
216 }
217
218 // KeyManagementService_ServiceDesc is the grpc.ServiceDesc for KeyManagementService service.
219 // It's only intended for direct use with grpc.RegisterService,
220 // and not to be introspected or modified (even as a copy)
221 var KeyManagementService_ServiceDesc = grpc.ServiceDesc{
222 ServiceName: "v2.KeyManagementService",
223 HandlerType: (*KeyManagementServiceServer)(nil),
224 Methods: []grpc.MethodDesc{
225 {
226 MethodName: "Status",
227 Handler: _KeyManagementService_Status_Handler,
228 },
229 {
230 MethodName: "Decrypt",
231 Handler: _KeyManagementService_Decrypt_Handler,
232 },
233 {
234 MethodName: "Encrypt",
235 Handler: _KeyManagementService_Encrypt_Handler,
236 },
237 },
238 Streams: []grpc.StreamDesc{},
239 Metadata: "staging/src/k8s.io/kms/apis/v2/api.proto",
240 }