// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package enginepb

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// 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

// TestServiceClient is the client API for TestService 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 TestServiceClient interface {
	FeedBinlog(ctx context.Context, in *TestBinlogRequest, opts ...grpc.CallOption) (TestService_FeedBinlogClient, error)
}

type testServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient {
	return &testServiceClient{cc}
}

func (c *testServiceClient) FeedBinlog(ctx context.Context, in *TestBinlogRequest, opts ...grpc.CallOption) (TestService_FeedBinlogClient, error) {
	stream, err := c.cc.NewStream(ctx, &TestService_ServiceDesc.Streams[0], "/enginepb.TestService/FeedBinlog", opts...)
	if err != nil {
		return nil, err
	}
	x := &testServiceFeedBinlogClient{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 TestService_FeedBinlogClient interface {
	Recv() (*Record, error)
	grpc.ClientStream
}

type testServiceFeedBinlogClient struct {
	grpc.ClientStream
}

func (x *testServiceFeedBinlogClient) Recv() (*Record, error) {
	m := new(Record)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// TestServiceServer is the server API for TestService service.
// All implementations should embed UnimplementedTestServiceServer
// for forward compatibility
type TestServiceServer interface {
	FeedBinlog(*TestBinlogRequest, TestService_FeedBinlogServer) error
}

// UnimplementedTestServiceServer should be embedded to have forward compatible implementations.
type UnimplementedTestServiceServer struct {
}

func (UnimplementedTestServiceServer) FeedBinlog(*TestBinlogRequest, TestService_FeedBinlogServer) error {
	return status.Errorf(codes.Unimplemented, "method FeedBinlog not implemented")
}

// UnsafeTestServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TestServiceServer will
// result in compilation errors.
type UnsafeTestServiceServer interface {
	mustEmbedUnimplementedTestServiceServer()
}

func RegisterTestServiceServer(s grpc.ServiceRegistrar, srv TestServiceServer) {
	s.RegisterService(&TestService_ServiceDesc, srv)
}

func _TestService_FeedBinlog_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(TestBinlogRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(TestServiceServer).FeedBinlog(m, &testServiceFeedBinlogServer{stream})
}

type TestService_FeedBinlogServer interface {
	Send(*Record) error
	grpc.ServerStream
}

type testServiceFeedBinlogServer struct {
	grpc.ServerStream
}

func (x *testServiceFeedBinlogServer) Send(m *Record) error {
	return x.ServerStream.SendMsg(m)
}

// TestService_ServiceDesc is the grpc.ServiceDesc for TestService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TestService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "enginepb.TestService",
	HandlerType: (*TestServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "FeedBinlog",
			Handler:       _TestService_FeedBinlog_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "engine/proto/test.proto",
}
