google.golang.org/grpc@v1.72.2/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.5.1 21 // - protoc v5.27.1 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.64.0 or later. 36 const _ = grpc.SupportPackageIsVersion9 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) (grpc.BidiStreamingClient[HandshakerReq, HandshakerResp], 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) (grpc.BidiStreamingClient[HandshakerReq, HandshakerResp], error) { 64 cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) 65 stream, err := c.cc.NewStream(ctx, &HandshakerService_ServiceDesc.Streams[0], HandshakerService_DoHandshake_FullMethodName, cOpts...) 66 if err != nil { 67 return nil, err 68 } 69 x := &grpc.GenericClientStream[HandshakerReq, HandshakerResp]{ClientStream: stream} 70 return x, nil 71 } 72 73 // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 74 type HandshakerService_DoHandshakeClient = grpc.BidiStreamingClient[HandshakerReq, HandshakerResp] 75 76 // HandshakerServiceServer is the server API for HandshakerService service. 77 // All implementations must embed UnimplementedHandshakerServiceServer 78 // for forward compatibility. 79 type HandshakerServiceServer interface { 80 // Handshaker service accepts a stream of handshaker request, returning a 81 // stream of handshaker response. Client is expected to send exactly one 82 // message with either client_start or server_start followed by one or more 83 // messages with next. Each time client sends a request, the handshaker 84 // service expects to respond. Client does not have to wait for service's 85 // response before sending next request. 86 DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error 87 mustEmbedUnimplementedHandshakerServiceServer() 88 } 89 90 // UnimplementedHandshakerServiceServer must be embedded to have 91 // forward compatible implementations. 92 // 93 // NOTE: this should be embedded by value instead of pointer to avoid a nil 94 // pointer dereference when methods are called. 95 type UnimplementedHandshakerServiceServer struct{} 96 97 func (UnimplementedHandshakerServiceServer) DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error { 98 return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented") 99 } 100 func (UnimplementedHandshakerServiceServer) mustEmbedUnimplementedHandshakerServiceServer() {} 101 func (UnimplementedHandshakerServiceServer) testEmbeddedByValue() {} 102 103 // UnsafeHandshakerServiceServer may be embedded to opt out of forward compatibility for this service. 104 // Use of this interface is not recommended, as added methods to HandshakerServiceServer will 105 // result in compilation errors. 106 type UnsafeHandshakerServiceServer interface { 107 mustEmbedUnimplementedHandshakerServiceServer() 108 } 109 110 func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) { 111 // If the following call panics, it indicates UnimplementedHandshakerServiceServer was 112 // embedded by pointer and is nil. This will cause panics if an 113 // unimplemented method is ever invoked, so we test this at initialization 114 // time to prevent it from happening at runtime later due to I/O. 115 if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { 116 t.testEmbeddedByValue() 117 } 118 s.RegisterService(&HandshakerService_ServiceDesc, srv) 119 } 120 121 func _HandshakerService_DoHandshake_Handler(srv interface{}, stream grpc.ServerStream) error { 122 return srv.(HandshakerServiceServer).DoHandshake(&grpc.GenericServerStream[HandshakerReq, HandshakerResp]{ServerStream: stream}) 123 } 124 125 // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. 126 type HandshakerService_DoHandshakeServer = grpc.BidiStreamingServer[HandshakerReq, HandshakerResp] 127 128 // HandshakerService_ServiceDesc is the grpc.ServiceDesc for HandshakerService service. 129 // It's only intended for direct use with grpc.RegisterService, 130 // and not to be introspected or modified (even as a copy) 131 var HandshakerService_ServiceDesc = grpc.ServiceDesc{ 132 ServiceName: "grpc.gcp.HandshakerService", 133 HandlerType: (*HandshakerServiceServer)(nil), 134 Methods: []grpc.MethodDesc{}, 135 Streams: []grpc.StreamDesc{ 136 { 137 StreamName: "DoHandshake", 138 Handler: _HandshakerService_DoHandshake_Handler, 139 ServerStreams: true, 140 ClientStreams: true, 141 }, 142 }, 143 Metadata: "grpc/gcp/handshaker.proto", 144 }