...

Source file src/google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp/handshaker_grpc.pb.go

Documentation: google.golang.org/grpc/credentials/alts/internal/proto/grpc_gcp

     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.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 forward compatible implementations.
    91  type UnimplementedHandshakerServiceServer struct {
    92  }
    93  
    94  func (UnimplementedHandshakerServiceServer) DoHandshake(grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]) error {
    95  	return status.Errorf(codes.Unimplemented, "method DoHandshake not implemented")
    96  }
    97  func (UnimplementedHandshakerServiceServer) mustEmbedUnimplementedHandshakerServiceServer() {}
    98  
    99  // UnsafeHandshakerServiceServer may be embedded to opt out of forward compatibility for this service.
   100  // Use of this interface is not recommended, as added methods to HandshakerServiceServer will
   101  // result in compilation errors.
   102  type UnsafeHandshakerServiceServer interface {
   103  	mustEmbedUnimplementedHandshakerServiceServer()
   104  }
   105  
   106  func RegisterHandshakerServiceServer(s grpc.ServiceRegistrar, srv HandshakerServiceServer) {
   107  	s.RegisterService(&HandshakerService_ServiceDesc, srv)
   108  }
   109  
   110  func _HandshakerService_DoHandshake_Handler(srv interface{}, stream grpc.ServerStream) error {
   111  	return srv.(HandshakerServiceServer).DoHandshake(&grpc.GenericServerStream[HandshakerReq, HandshakerResp]{ServerStream: stream})
   112  }
   113  
   114  // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
   115  type HandshakerService_DoHandshakeServer = grpc.BidiStreamingServer[HandshakerReq, HandshakerResp]
   116  
   117  // HandshakerService_ServiceDesc is the grpc.ServiceDesc for HandshakerService service.
   118  // It's only intended for direct use with grpc.RegisterService,
   119  // and not to be introspected or modified (even as a copy)
   120  var HandshakerService_ServiceDesc = grpc.ServiceDesc{
   121  	ServiceName: "grpc.gcp.HandshakerService",
   122  	HandlerType: (*HandshakerServiceServer)(nil),
   123  	Methods:     []grpc.MethodDesc{},
   124  	Streams: []grpc.StreamDesc{
   125  		{
   126  			StreamName:    "DoHandshake",
   127  			Handler:       _HandshakerService_DoHandshake_Handler,
   128  			ServerStreams: true,
   129  			ClientStreams: true,
   130  		},
   131  	},
   132  	Metadata: "grpc/gcp/handshaker.proto",
   133  }
   134  

View as plain text