Debian Codegraph @

apigeeconnect/apiv1/apigeeconnectpb/tether_grpc.pb.go

raw
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
16 // versions:
17 // - protoc-gen-go-grpc v1.3.0
18 // - protoc v4.25.7
19 // source: google/cloud/apigeeconnect/v1/tether.proto
20
21 package apigeeconnectpb
22
23 import (
24 context "context"
25 grpc "google.golang.org/grpc"
26 codes "google.golang.org/grpc/codes"
27 status "google.golang.org/grpc/status"
28 )
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the grpc package it is being compiled against.
32 // Requires gRPC-Go v1.32.0 or later.
33 const _ = grpc.SupportPackageIsVersion7
34
35 const (
36 Tether_Egress_FullMethodName = "/google.cloud.apigeeconnect.v1.Tether/Egress"
37 )
38
39 // TetherClient is the client API for Tether service.
40 //
41 // 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.
42 type TetherClient interface {
43 // Egress streams egress requests and responses. Logically, this is not
44 // actually a streaming request, but uses streaming as a mechanism to flip
45 // the client-server relationship of gRPC so that the server can act as a
46 // client.
47 // The listener, the RPC server, accepts connections from the dialer,
48 // the RPC client.
49 // The listener streams http requests and the dialer streams http responses.
50 Egress(ctx context.Context, opts ...grpc.CallOption) (Tether_EgressClient, error)
51 }
52
53 type tetherClient struct {
54 cc grpc.ClientConnInterface
55 }
56
57 func NewTetherClient(cc grpc.ClientConnInterface) TetherClient {
58 return &tetherClient{cc}
59 }
60
61 func (c *tetherClient) Egress(ctx context.Context, opts ...grpc.CallOption) (Tether_EgressClient, error) {
62 stream, err := c.cc.NewStream(ctx, &Tether_ServiceDesc.Streams[0], Tether_Egress_FullMethodName, opts...)
63 if err != nil {
64 return nil, err
65 }
66 x := &tetherEgressClient{stream}
67 return x, nil
68 }
69
70 type Tether_EgressClient interface {
71 Send(*EgressResponse) error
72 Recv() (*EgressRequest, error)
73 grpc.ClientStream
74 }
75
76 type tetherEgressClient struct {
77 grpc.ClientStream
78 }
79
80 func (x *tetherEgressClient) Send(m *EgressResponse) error {
81 return x.ClientStream.SendMsg(m)
82 }
83
84 func (x *tetherEgressClient) Recv() (*EgressRequest, error) {
85 m := new(EgressRequest)
86 if err := x.ClientStream.RecvMsg(m); err != nil {
87 return nil, err
88 }
89 return m, nil
90 }
91
92 // TetherServer is the server API for Tether service.
93 // All implementations should embed UnimplementedTetherServer
94 // for forward compatibility
95 type TetherServer interface {
96 // Egress streams egress requests and responses. Logically, this is not
97 // actually a streaming request, but uses streaming as a mechanism to flip
98 // the client-server relationship of gRPC so that the server can act as a
99 // client.
100 // The listener, the RPC server, accepts connections from the dialer,
101 // the RPC client.
102 // The listener streams http requests and the dialer streams http responses.
103 Egress(Tether_EgressServer) error
104 }
105
106 // UnimplementedTetherServer should be embedded to have forward compatible implementations.
107 type UnimplementedTetherServer struct {
108 }
109
110 func (UnimplementedTetherServer) Egress(Tether_EgressServer) error {
111 return status.Errorf(codes.Unimplemented, "method Egress not implemented")
112 }
113
114 // UnsafeTetherServer may be embedded to opt out of forward compatibility for this service.
115 // Use of this interface is not recommended, as added methods to TetherServer will
116 // result in compilation errors.
117 type UnsafeTetherServer interface {
118 mustEmbedUnimplementedTetherServer()
119 }
120
121 func RegisterTetherServer(s grpc.ServiceRegistrar, srv TetherServer) {
122 s.RegisterService(&Tether_ServiceDesc, srv)
123 }
124
125 func _Tether_Egress_Handler(srv interface{}, stream grpc.ServerStream) error {
126 return srv.(TetherServer).Egress(&tetherEgressServer{stream})
127 }
128
129 type Tether_EgressServer interface {
130 Send(*EgressRequest) error
131 Recv() (*EgressResponse, error)
132 grpc.ServerStream
133 }
134
135 type tetherEgressServer struct {
136 grpc.ServerStream
137 }
138
139 func (x *tetherEgressServer) Send(m *EgressRequest) error {
140 return x.ServerStream.SendMsg(m)
141 }
142
143 func (x *tetherEgressServer) Recv() (*EgressResponse, error) {
144 m := new(EgressResponse)
145 if err := x.ServerStream.RecvMsg(m); err != nil {
146 return nil, err
147 }
148 return m, nil
149 }
150
151 // Tether_ServiceDesc is the grpc.ServiceDesc for Tether service.
152 // It's only intended for direct use with grpc.RegisterService,
153 // and not to be introspected or modified (even as a copy)
154 var Tether_ServiceDesc = grpc.ServiceDesc{
155 ServiceName: "google.cloud.apigeeconnect.v1.Tether",
156 HandlerType: (*TetherServer)(nil),
157 Methods: []grpc.MethodDesc{},
158 Streams: []grpc.StreamDesc{
159 {
160 StreamName: "Egress",
161 Handler: _Tether_Egress_Handler,
162 ServerStreams: true,
163 ClientStreams: true,
164 },
165 },
166 Metadata: "google/cloud/apigeeconnect/v1/tether.proto",
167 }