github.com/v2fly/v2ray-core/v4@v4.45.2/transport/internet/grpc/encoding/stream_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package encoding
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  // Requires gRPC-Go v1.32.0 or later.
    15  const _ = grpc.SupportPackageIsVersion7
    16  
    17  // GunServiceClient is the client API for GunService service.
    18  //
    19  // 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.
    20  type GunServiceClient interface {
    21  	Tun(ctx context.Context, opts ...grpc.CallOption) (GunService_TunClient, error)
    22  }
    23  
    24  type gunServiceClient struct {
    25  	cc grpc.ClientConnInterface
    26  }
    27  
    28  func NewGunServiceClient(cc grpc.ClientConnInterface) GunServiceClient {
    29  	return &gunServiceClient{cc}
    30  }
    31  
    32  func (c *gunServiceClient) Tun(ctx context.Context, opts ...grpc.CallOption) (GunService_TunClient, error) {
    33  	stream, err := c.cc.NewStream(ctx, &GunService_ServiceDesc.Streams[0], "/v2ray.core.transport.internet.grpc.encoding.GunService/Tun", opts...)
    34  	if err != nil {
    35  		return nil, err
    36  	}
    37  	x := &gunServiceTunClient{stream}
    38  	return x, nil
    39  }
    40  
    41  type GunService_TunClient interface {
    42  	Send(*Hunk) error
    43  	Recv() (*Hunk, error)
    44  	grpc.ClientStream
    45  }
    46  
    47  type gunServiceTunClient struct {
    48  	grpc.ClientStream
    49  }
    50  
    51  func (x *gunServiceTunClient) Send(m *Hunk) error {
    52  	return x.ClientStream.SendMsg(m)
    53  }
    54  
    55  func (x *gunServiceTunClient) Recv() (*Hunk, error) {
    56  	m := new(Hunk)
    57  	if err := x.ClientStream.RecvMsg(m); err != nil {
    58  		return nil, err
    59  	}
    60  	return m, nil
    61  }
    62  
    63  // GunServiceServer is the server API for GunService service.
    64  // All implementations must embed UnimplementedGunServiceServer
    65  // for forward compatibility
    66  type GunServiceServer interface {
    67  	Tun(GunService_TunServer) error
    68  	mustEmbedUnimplementedGunServiceServer()
    69  }
    70  
    71  // UnimplementedGunServiceServer must be embedded to have forward compatible implementations.
    72  type UnimplementedGunServiceServer struct {
    73  }
    74  
    75  func (UnimplementedGunServiceServer) Tun(GunService_TunServer) error {
    76  	return status.Errorf(codes.Unimplemented, "method Tun not implemented")
    77  }
    78  func (UnimplementedGunServiceServer) mustEmbedUnimplementedGunServiceServer() {}
    79  
    80  // UnsafeGunServiceServer may be embedded to opt out of forward compatibility for this service.
    81  // Use of this interface is not recommended, as added methods to GunServiceServer will
    82  // result in compilation errors.
    83  type UnsafeGunServiceServer interface {
    84  	mustEmbedUnimplementedGunServiceServer()
    85  }
    86  
    87  func RegisterGunServiceServer(s grpc.ServiceRegistrar, srv GunServiceServer) {
    88  	s.RegisterService(&GunService_ServiceDesc, srv)
    89  }
    90  
    91  func _GunService_Tun_Handler(srv interface{}, stream grpc.ServerStream) error {
    92  	return srv.(GunServiceServer).Tun(&gunServiceTunServer{stream})
    93  }
    94  
    95  type GunService_TunServer interface {
    96  	Send(*Hunk) error
    97  	Recv() (*Hunk, error)
    98  	grpc.ServerStream
    99  }
   100  
   101  type gunServiceTunServer struct {
   102  	grpc.ServerStream
   103  }
   104  
   105  func (x *gunServiceTunServer) Send(m *Hunk) error {
   106  	return x.ServerStream.SendMsg(m)
   107  }
   108  
   109  func (x *gunServiceTunServer) Recv() (*Hunk, error) {
   110  	m := new(Hunk)
   111  	if err := x.ServerStream.RecvMsg(m); err != nil {
   112  		return nil, err
   113  	}
   114  	return m, nil
   115  }
   116  
   117  // GunService_ServiceDesc is the grpc.ServiceDesc for GunService 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 GunService_ServiceDesc = grpc.ServiceDesc{
   121  	ServiceName: "v2ray.core.transport.internet.grpc.encoding.GunService",
   122  	HandlerType: (*GunServiceServer)(nil),
   123  	Methods:     []grpc.MethodDesc{},
   124  	Streams: []grpc.StreamDesc{
   125  		{
   126  			StreamName:    "Tun",
   127  			Handler:       _GunService_Tun_Handler,
   128  			ServerStreams: true,
   129  			ClientStreams: true,
   130  		},
   131  	},
   132  	Metadata: "transport/internet/grpc/encoding/stream.proto",
   133  }