You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
4.1 KiB
131 lines
4.1 KiB
4 years ago
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
|
||
4 years ago
|
package echo
|
||
4 years ago
|
|
||
|
import (
|
||
|
context "context"
|
||
|
httpbody "google.golang.org/genproto/googleapis/api/httpbody"
|
||
|
grpc "google.golang.org/grpc"
|
||
|
codes "google.golang.org/grpc/codes"
|
||
|
status "google.golang.org/grpc/status"
|
||
4 years ago
|
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||
4 years ago
|
)
|
||
|
|
||
|
// This is a compile-time assertion to ensure that this generated file
|
||
|
// is compatible with the grpc package it is being compiled against.
|
||
|
// Requires gRPC-Go v1.32.0 or later.
|
||
|
const _ = grpc.SupportPackageIsVersion7
|
||
|
|
||
|
// StreamServiceClient is the client API for StreamService service.
|
||
|
//
|
||
|
// 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.
|
||
|
type StreamServiceClient interface {
|
||
4 years ago
|
Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error)
|
||
4 years ago
|
}
|
||
|
|
||
|
type streamServiceClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient {
|
||
|
return &streamServiceClient{cc}
|
||
|
}
|
||
|
|
||
4 years ago
|
func (c *streamServiceClient) Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error) {
|
||
4 years ago
|
stream, err := c.cc.NewStream(ctx, &StreamService_ServiceDesc.Streams[0], "/echo.StreamService/Download", opts...)
|
||
4 years ago
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
x := &streamServiceDownloadClient{stream}
|
||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return x, nil
|
||
|
}
|
||
|
|
||
|
type StreamService_DownloadClient interface {
|
||
|
Recv() (*httpbody.HttpBody, error)
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
type streamServiceDownloadClient struct {
|
||
|
grpc.ClientStream
|
||
|
}
|
||
|
|
||
|
func (x *streamServiceDownloadClient) Recv() (*httpbody.HttpBody, error) {
|
||
|
m := new(httpbody.HttpBody)
|
||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return m, nil
|
||
|
}
|
||
|
|
||
|
// StreamServiceServer is the server API for StreamService service.
|
||
|
// All implementations must embed UnimplementedStreamServiceServer
|
||
|
// for forward compatibility
|
||
|
type StreamServiceServer interface {
|
||
4 years ago
|
Download(*emptypb.Empty, StreamService_DownloadServer) error
|
||
4 years ago
|
mustEmbedUnimplementedStreamServiceServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedStreamServiceServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedStreamServiceServer struct {
|
||
|
}
|
||
|
|
||
4 years ago
|
func (UnimplementedStreamServiceServer) Download(*emptypb.Empty, StreamService_DownloadServer) error {
|
||
4 years ago
|
return status.Errorf(codes.Unimplemented, "method Download not implemented")
|
||
|
}
|
||
|
func (UnimplementedStreamServiceServer) mustEmbedUnimplementedStreamServiceServer() {}
|
||
|
|
||
|
// UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to StreamServiceServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeStreamServiceServer interface {
|
||
|
mustEmbedUnimplementedStreamServiceServer()
|
||
|
}
|
||
|
|
||
|
func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer) {
|
||
|
s.RegisterService(&StreamService_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _StreamService_Download_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
4 years ago
|
m := new(emptypb.Empty)
|
||
4 years ago
|
if err := stream.RecvMsg(m); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return srv.(StreamServiceServer).Download(m, &streamServiceDownloadServer{stream})
|
||
|
}
|
||
|
|
||
|
type StreamService_DownloadServer interface {
|
||
|
Send(*httpbody.HttpBody) error
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
type streamServiceDownloadServer struct {
|
||
|
grpc.ServerStream
|
||
|
}
|
||
|
|
||
|
func (x *streamServiceDownloadServer) Send(m *httpbody.HttpBody) error {
|
||
|
return x.ServerStream.SendMsg(m)
|
||
|
}
|
||
|
|
||
|
// StreamService_ServiceDesc is the grpc.ServiceDesc for StreamService service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var StreamService_ServiceDesc = grpc.ServiceDesc{
|
||
4 years ago
|
ServiceName: "echo.StreamService",
|
||
4 years ago
|
HandlerType: (*StreamServiceServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{},
|
||
|
Streams: []grpc.StreamDesc{
|
||
|
{
|
||
|
StreamName: "Download",
|
||
|
Handler: _StreamService_Download_Handler,
|
||
|
ServerStreams: true,
|
||
|
},
|
||
|
},
|
||
4 years ago
|
Metadata: "stream.proto",
|
||
4 years ago
|
}
|