Debian Codegraph @

proto/agent/agent_grpc.pb.go

raw symbols SCIP
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: proto/agent/agent.proto
21
22 package agent
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 client "sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client"
30 )
31
32 // This is a compile-time assertion to ensure that this generated file
33 // is compatible with the grpc package it is being compiled against.
34 // Requires gRPC-Go v1.32.0 or later.
35 const _ = grpc.SupportPackageIsVersion7
36
37 // AgentServiceClient is the client API for AgentService service.
38 //
39 // 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.
40 type AgentServiceClient interface {
41 // Agent Identifier?
42 Connect(ctx context.Context, opts ...grpc.CallOption) (AgentService_ConnectClient, error)
43 }
44
45 type agentServiceClient struct {
46 cc grpc.ClientConnInterface
47 }
48
49 func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient {
50 return &agentServiceClient{cc}
51 }
52
53 func (c *agentServiceClient) Connect(ctx context.Context, opts ...grpc.CallOption) (AgentService_ConnectClient, error) {
54 stream, err := c.cc.NewStream(ctx, &AgentService_ServiceDesc.Streams[0], "/AgentService/Connect", opts...)
55 if err != nil {
56 return nil, err
57 }
58 x := &agentServiceConnectClient{stream}
59 return x, nil
60 }
61
62 type AgentService_ConnectClient interface {
63 Send(*client.Packet) error
64 Recv() (*client.Packet, error)
65 grpc.ClientStream
66 }
67
68 type agentServiceConnectClient struct {
69 grpc.ClientStream
70 }
71
72 func (x *agentServiceConnectClient) Send(m *client.Packet) error {
73 return x.ClientStream.SendMsg(m)
74 }
75
76 func (x *agentServiceConnectClient) Recv() (*client.Packet, error) {
77 m := new(client.Packet)
78 if err := x.ClientStream.RecvMsg(m); err != nil {
79 return nil, err
80 }
81 return m, nil
82 }
83
84 // AgentServiceServer is the server API for AgentService service.
85 // All implementations should embed UnimplementedAgentServiceServer
86 // for forward compatibility
87 type AgentServiceServer interface {
88 // Agent Identifier?
89 Connect(AgentService_ConnectServer) error
90 }
91
92 // UnimplementedAgentServiceServer should be embedded to have forward compatible implementations.
93 type UnimplementedAgentServiceServer struct {
94 }
95
96 func (UnimplementedAgentServiceServer) Connect(AgentService_ConnectServer) error {
97 return status.Errorf(codes.Unimplemented, "method Connect not implemented")
98 }
99
100 // UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service.
101 // Use of this interface is not recommended, as added methods to AgentServiceServer will
102 // result in compilation errors.
103 type UnsafeAgentServiceServer interface {
104 mustEmbedUnimplementedAgentServiceServer()
105 }
106
107 func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer) {
108 s.RegisterService(&AgentService_ServiceDesc, srv)
109 }
110
111 func _AgentService_Connect_Handler(srv interface{}, stream grpc.ServerStream) error {
112 return srv.(AgentServiceServer).Connect(&agentServiceConnectServer{stream})
113 }
114
115 type AgentService_ConnectServer interface {
116 Send(*client.Packet) error
117 Recv() (*client.Packet, error)
118 grpc.ServerStream
119 }
120
121 type agentServiceConnectServer struct {
122 grpc.ServerStream
123 }
124
125 func (x *agentServiceConnectServer) Send(m *client.Packet) error {
126 return x.ServerStream.SendMsg(m)
127 }
128
129 func (x *agentServiceConnectServer) Recv() (*client.Packet, error) {
130 m := new(client.Packet)
131 if err := x.ServerStream.RecvMsg(m); err != nil {
132 return nil, err
133 }
134 return m, nil
135 }
136
137 // AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service.
138 // It's only intended for direct use with grpc.RegisterService,
139 // and not to be introspected or modified (even as a copy)
140 var AgentService_ServiceDesc = grpc.ServiceDesc{
141 ServiceName: "AgentService",
142 HandlerType: (*AgentServiceServer)(nil),
143 Methods: []grpc.MethodDesc{},
144 Streams: []grpc.StreamDesc{
145 {
146 StreamName: "Connect",
147 Handler: _AgentService_Connect_Handler,
148 ServerStreams: true,
149 ClientStreams: true,
150 },
151 },
152 Metadata: "proto/agent/agent.proto",
153 }