Debian Codegraph @

konnectivity-client/proto/client/client_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 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
17 // versions:
18 // - protoc-gen-go-grpc v1.2.0
19 // - protoc v3.21.12
20 // source: konnectivity-client/proto/client/client.proto
21
22 package client
23
24 import (
25 context "context"
26 grpc "google.golang.org/grpc"
27 codes "google.golang.org/grpc/codes"
28 status "google.golang.org/grpc/status"
29 )
30
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the grpc package it is being compiled against.
33 // Requires gRPC-Go v1.32.0 or later.
34 const _ = grpc.SupportPackageIsVersion7
35
36 // ProxyServiceClient is the client API for ProxyService service.
37 //
38 // 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.
39 type ProxyServiceClient interface {
40 Proxy(ctx context.Context, opts ...grpc.CallOption) (ProxyService_ProxyClient, error)
41 }
42
43 type proxyServiceClient struct {
44 cc grpc.ClientConnInterface
45 }
46
47 func NewProxyServiceClient(cc grpc.ClientConnInterface) ProxyServiceClient {
48 return &proxyServiceClient{cc}
49 }
50
51 func (c *proxyServiceClient) Proxy(ctx context.Context, opts ...grpc.CallOption) (ProxyService_ProxyClient, error) {
52 stream, err := c.cc.NewStream(ctx, &ProxyService_ServiceDesc.Streams[0], "/ProxyService/Proxy", opts...)
53 if err != nil {
54 return nil, err
55 }
56 x := &proxyServiceProxyClient{stream}
57 return x, nil
58 }
59
60 type ProxyService_ProxyClient interface {
61 Send(*Packet) error
62 Recv() (*Packet, error)
63 grpc.ClientStream
64 }
65
66 type proxyServiceProxyClient struct {
67 grpc.ClientStream
68 }
69
70 func (x *proxyServiceProxyClient) Send(m *Packet) error {
71 return x.ClientStream.SendMsg(m)
72 }
73
74 func (x *proxyServiceProxyClient) Recv() (*Packet, error) {
75 m := new(Packet)
76 if err := x.ClientStream.RecvMsg(m); err != nil {
77 return nil, err
78 }
79 return m, nil
80 }
81
82 // ProxyServiceServer is the server API for ProxyService service.
83 // All implementations should embed UnimplementedProxyServiceServer
84 // for forward compatibility
85 type ProxyServiceServer interface {
86 Proxy(ProxyService_ProxyServer) error
87 }
88
89 // UnimplementedProxyServiceServer should be embedded to have forward compatible implementations.
90 type UnimplementedProxyServiceServer struct {
91 }
92
93 func (UnimplementedProxyServiceServer) Proxy(ProxyService_ProxyServer) error {
94 return status.Errorf(codes.Unimplemented, "method Proxy not implemented")
95 }
96
97 // UnsafeProxyServiceServer may be embedded to opt out of forward compatibility for this service.
98 // Use of this interface is not recommended, as added methods to ProxyServiceServer will
99 // result in compilation errors.
100 type UnsafeProxyServiceServer interface {
101 mustEmbedUnimplementedProxyServiceServer()
102 }
103
104 func RegisterProxyServiceServer(s grpc.ServiceRegistrar, srv ProxyServiceServer) {
105 s.RegisterService(&ProxyService_ServiceDesc, srv)
106 }
107
108 func _ProxyService_Proxy_Handler(srv interface{}, stream grpc.ServerStream) error {
109 return srv.(ProxyServiceServer).Proxy(&proxyServiceProxyServer{stream})
110 }
111
112 type ProxyService_ProxyServer interface {
113 Send(*Packet) error
114 Recv() (*Packet, error)
115 grpc.ServerStream
116 }
117
118 type proxyServiceProxyServer struct {
119 grpc.ServerStream
120 }
121
122 func (x *proxyServiceProxyServer) Send(m *Packet) error {
123 return x.ServerStream.SendMsg(m)
124 }
125
126 func (x *proxyServiceProxyServer) Recv() (*Packet, error) {
127 m := new(Packet)
128 if err := x.ServerStream.RecvMsg(m); err != nil {
129 return nil, err
130 }
131 return m, nil
132 }
133
134 // ProxyService_ServiceDesc is the grpc.ServiceDesc for ProxyService service.
135 // It's only intended for direct use with grpc.RegisterService,
136 // and not to be introspected or modified (even as a copy)
137 var ProxyService_ServiceDesc = grpc.ServiceDesc{
138 ServiceName: "ProxyService",
139 HandlerType: (*ProxyServiceServer)(nil),
140 Methods: []grpc.MethodDesc{},
141 Streams: []grpc.StreamDesc{
142 {
143 StreamName: "Proxy",
144 Handler: _ProxyService_Proxy_Handler,
145 ServerStreams: true,
146 ClientStreams: true,
147 },
148 },
149 Metadata: "konnectivity-client/proto/client/client.proto",
150 }