google.golang.org/grpc@v1.62.1/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go (about) 1 // Copyright 2018 The gRPC Authors 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 // The canonical version of this proto can be found at 16 // https://github.com/grpc/grpc-proto/blob/master/grpc/gcp/handshaker.proto 17 18 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 19 // versions: 20 // - protoc-gen-go-grpc v1.3.0 21 // - protoc v4.25.2 22 // source: grpc/gcp/handshaker.proto 23 24 package grpc_gcp 25 26 import ( 27 context "context" 28 grpc "google.golang.org/grpc" 29 codes "google.golang.org/grpc/codes" 30 status "google.golang.org/grpc/status" 31 ) 32 33 // This is a compile-time assertion to ensure that this generated file 34 // is compatible with the grpc package it is being compiled against. 35 // Requires gRPC-Go v1.32.0 or later. 36 const _ = grpc.SupportPackageIsVersion7 37 38 const ( 39 HandshakerService_DoHandshake_FullMethodName = "/grpc.gcp.HandshakerService/DoHandshake" 40 ) 41 42 // HandshakerServiceClient is the client API for HandshakerService service. 43 // 44 // 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. 45 type HandshakerServiceClient interface { 46 // Handshaker service accepts a stream of handshaker request, returning a 47 // stream of handshaker response. Client is expected to send exactly one 48 // message with either client_start or server_start followed by one or more 49 // messages with next. Each time client sends a request, the handshaker 50 // service expects to respond. Client does not have to wait for service's 51 // response before sending next request. 52 DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) 53 } 54 55 type handshakerServiceClient struct { 56 cc grpc.ClientConnInterface 57 } 58 59 func NewHandshakerServiceClient(cc grpc.ClientConnInterface) HandshakerServiceClient { 60 return &handshakerServiceClient{cc} 61 } 62 63 func (c *handshakerServiceClient) DoHandshake(ctx context.Context, opts ...grpc.CallOption) (HandshakerService_DoHandshakeClient, error) { 64 stream, err := c.cc.NewStream(ctx, &HandshakerService_ServiceDesc.Streams[0], HandshakerService_DoHandshake_FullMethodName, opts...) 65 if err != nil { 66 return nil, err 67 } 68 x := &handshakerServiceDoHandshakeClient{stream} 69 return x, nil 70 } 71 72 type HandshakerService_DoHandshakeClient interface { 73 Send(*HandshakerReq) error 74 Recv() (*HandshakerResp, error) 75 grpc.ClientStream 76 } 77 78 type handshakerServiceDoHandshakeClient struct { 79 grpc.ClientStream 80 } 81 82 func (x *handshakerServiceDoHandshakeClient) Send(m *HandshakerReq) error { 83 return x.ClientStream.SendMsg(m) 84 } 85 86 func (x *handshakerServiceDoHandshakeClient) Recv() (*HandshakerResp, error) { 87 m := new(HandshakerResp) 88 if err := x.ClientStream.RecvMsg(m); err != nil { 89 return nil, err 90 } 91 return m, nil 92 } 93 94 // HandshakerServiceServer is the server API for HandshakerService service. 95 // All implementations must embed UnimplementedHandshakerServiceServer 96 // for forward compatibility 97 type HandshakerServiceServer interface { 98 // Handshaker service accepts a stream of handshaker request, returning a 99 // stream of handshaker response. Client is expected to send exactly one 100 // message with either client_start or server_start followed by one or more 101 // messages with next. Each time client sends a request, the handshaker 102 // service expects to respond. Client does not have to wait for service's 103 // response before sending next request. 104 DoHandshake(HandshakerService_DoHandshakeServer) error 105 mustEmbedUnimplementedHandshakerServiceServer() 106 } 107 108 // UnimplementedHandshakerServiceServer must be embedded to have forward compatible implementations. 109 type UnimplementedHandshakerServiceServer struct { 110 } 111 112 func (UnimplementedHandshakerServiceServer) DoHandshake(HandshakerService_DoHandshakeServer) error { 113 return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented") 114 } 115 func (UnimplementedHandshakerServiceServer) mustEmbedUnimplementedHandshakerServiceServer() {} 116 117 // UnsafeHandshakerServiceServer may be embedded to opt out of forward compatibility for this service. 118 // Use of this interface is not recommended, as added methods to HandshakerServiceServer will 119 // result in compilation errors. 120 type UnsafeHandshakerServiceServer interface { 121 mustEmbedUnimplementedHandshakerServiceServer() 122 } 123 124 func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) { 125 s.RegisterService(&HandshakerService_ServiceDesc, srv) 126 } 127 128 func _HandshakerService_DoHandshake_Handler(srv interface{}, stream grpc.ServerStream) error { 129 return srv.(HandshakerServiceServer).DoHandshake(&handshakerServiceDoHandshakeServer{stream}) 130 } 131 132 type HandshakerService_DoHandshakeServer interface { 133 Send(*HandshakerResp) error 134 Recv() (*HandshakerReq, error) 135 grpc.ServerStream 136 } 137 138 type handshakerServiceDoHandshakeServer struct { 139 grpc.ServerStream 140 } 141 142 func (x *handshakerServiceDoHandshakeServer) Send(m *HandshakerResp) error { 143 return x.ServerStream.SendMsg(m) 144 } 145 146 func (x *handshakerServiceDoHandshakeServer) Recv() (*HandshakerReq, error) { 147 m := new(HandshakerReq) 148 if err := x.ServerStream.RecvMsg(m); err != nil { 149 return nil, err 150 } 151 return m, nil 152 } 153 154 // HandshakerService_ServiceDesc is the grpc.ServiceDesc for HandshakerService service. 155 // It's only intended for direct use with grpc.RegisterService, 156 // and not to be introspected or modified (even as a copy) 157 var HandshakerService_ServiceDesc = grpc.ServiceDesc{ 158 ServiceName: "grpc.gcp.HandshakerService", 159 HandlerType: (*HandshakerServiceServer)(nil), 160 Methods: []grpc.MethodDesc{}, 161 Streams: []grpc.StreamDesc{ 162 { 163 StreamName: "DoHandshake", 164 Handler: _HandshakerService_DoHandshake_Handler, 165 ServerStreams: true, 166 ClientStreams: true, 167 }, 168 }, 169 Metadata: "grpc/gcp/handshaker.proto", 170 }