// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v4.25.1
// source: service_gateway.proto

package grpc_pb

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

// GatewayClient is the client API for Gateway 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 GatewayClient interface {
	ToClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_ToClientClient, error)
}

type gatewayClient struct {
	cc grpc.ClientConnInterface
}

func NewGatewayClient(cc grpc.ClientConnInterface) GatewayClient {
	return &gatewayClient{cc}
}

func (c *gatewayClient) ToClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_ToClientClient, error) {
	stream, err := c.cc.NewStream(ctx, &Gateway_ServiceDesc.Streams[0], "/Gateway/ToClient", opts...)
	if err != nil {
		return nil, err
	}
	x := &gatewayToClientClient{stream}
	return x, nil
}

type Gateway_ToClientClient interface {
	Send(*ToClientReq) error
	CloseAndRecv() (*ToClientResp, error)
	grpc.ClientStream
}

type gatewayToClientClient struct {
	grpc.ClientStream
}

func (x *gatewayToClientClient) Send(m *ToClientReq) error {
	return x.ClientStream.SendMsg(m)
}

func (x *gatewayToClientClient) CloseAndRecv() (*ToClientResp, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(ToClientResp)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// GatewayServer is the server API for Gateway service.
// All implementations must embed UnimplementedGatewayServer
// for forward compatibility
type GatewayServer interface {
	ToClient(Gateway_ToClientServer) error
	mustEmbedUnimplementedGatewayServer()
}

// UnimplementedGatewayServer must be embedded to have forward compatible implementations.
type UnimplementedGatewayServer struct {
}

func (UnimplementedGatewayServer) ToClient(Gateway_ToClientServer) error {
	return status.Errorf(codes.Unimplemented, "method ToClient not implemented")
}
func (UnimplementedGatewayServer) mustEmbedUnimplementedGatewayServer() {}

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

func RegisterGatewayServer(s grpc.ServiceRegistrar, srv GatewayServer) {
	s.RegisterService(&Gateway_ServiceDesc, srv)
}

func _Gateway_ToClient_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(GatewayServer).ToClient(&gatewayToClientServer{stream})
}

type Gateway_ToClientServer interface {
	SendAndClose(*ToClientResp) error
	Recv() (*ToClientReq, error)
	grpc.ServerStream
}

type gatewayToClientServer struct {
	grpc.ServerStream
}

func (x *gatewayToClientServer) SendAndClose(m *ToClientResp) error {
	return x.ServerStream.SendMsg(m)
}

func (x *gatewayToClientServer) Recv() (*ToClientReq, error) {
	m := new(ToClientReq)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Gateway_ServiceDesc is the grpc.ServiceDesc for Gateway service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Gateway_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Gateway",
	HandlerType: (*GatewayServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ToClient",
			Handler:       _Gateway_ToClient_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "service_gateway.proto",
}
