// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: gosdn/csbi/csbi.proto

package csbi

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

const (
	CsbiService_Get_FullMethodName            = "/gosdn.csbi.CsbiService/Get"
	CsbiService_GetFile_FullMethodName        = "/gosdn.csbi.CsbiService/GetFile"
	CsbiService_Create_FullMethodName         = "/gosdn.csbi.CsbiService/Create"
	CsbiService_CreateGoStruct_FullMethodName = "/gosdn.csbi.CsbiService/CreateGoStruct"
	CsbiService_Delete_FullMethodName         = "/gosdn.csbi.CsbiService/Delete"
	CsbiService_Hello_FullMethodName          = "/gosdn.csbi.CsbiService/Hello"
)

// CsbiServiceClient is the client API for CsbiService 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 CsbiServiceClient interface {
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	GetFile(ctx context.Context, in *GetPayloadRequest, opts ...grpc.CallOption) (CsbiService_GetFileClient, error)
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	CreateGoStruct(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	Hello(ctx context.Context, in *Syn, opts ...grpc.CallOption) (*Ack, error)
}

type csbiServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCsbiServiceClient(cc grpc.ClientConnInterface) CsbiServiceClient {
	return &csbiServiceClient{cc}
}

func (c *csbiServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
	out := new(GetResponse)
	err := c.cc.Invoke(ctx, CsbiService_Get_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *csbiServiceClient) GetFile(ctx context.Context, in *GetPayloadRequest, opts ...grpc.CallOption) (CsbiService_GetFileClient, error) {
	stream, err := c.cc.NewStream(ctx, &CsbiService_ServiceDesc.Streams[0], CsbiService_GetFile_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &csbiServiceGetFileClient{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 CsbiService_GetFileClient interface {
	Recv() (*Payload, error)
	grpc.ClientStream
}

type csbiServiceGetFileClient struct {
	grpc.ClientStream
}

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

func (c *csbiServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
	out := new(CreateResponse)
	err := c.cc.Invoke(ctx, CsbiService_Create_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *csbiServiceClient) CreateGoStruct(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
	out := new(CreateResponse)
	err := c.cc.Invoke(ctx, CsbiService_CreateGoStruct_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *csbiServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
	out := new(DeleteResponse)
	err := c.cc.Invoke(ctx, CsbiService_Delete_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *csbiServiceClient) Hello(ctx context.Context, in *Syn, opts ...grpc.CallOption) (*Ack, error) {
	out := new(Ack)
	err := c.cc.Invoke(ctx, CsbiService_Hello_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CsbiServiceServer is the server API for CsbiService service.
// All implementations must embed UnimplementedCsbiServiceServer
// for forward compatibility
type CsbiServiceServer interface {
	Get(context.Context, *GetRequest) (*GetResponse, error)
	GetFile(*GetPayloadRequest, CsbiService_GetFileServer) error
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	CreateGoStruct(context.Context, *CreateRequest) (*CreateResponse, error)
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	Hello(context.Context, *Syn) (*Ack, error)
	mustEmbedUnimplementedCsbiServiceServer()
}

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

func (UnimplementedCsbiServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedCsbiServiceServer) GetFile(*GetPayloadRequest, CsbiService_GetFileServer) error {
	return status.Errorf(codes.Unimplemented, "method GetFile not implemented")
}
func (UnimplementedCsbiServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedCsbiServiceServer) CreateGoStruct(context.Context, *CreateRequest) (*CreateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateGoStruct not implemented")
}
func (UnimplementedCsbiServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedCsbiServiceServer) Hello(context.Context, *Syn) (*Ack, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Hello not implemented")
}
func (UnimplementedCsbiServiceServer) mustEmbedUnimplementedCsbiServiceServer() {}

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

func RegisterCsbiServiceServer(s grpc.ServiceRegistrar, srv CsbiServiceServer) {
	s.RegisterService(&CsbiService_ServiceDesc, srv)
}

func _CsbiService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CsbiServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CsbiService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CsbiServiceServer).Get(ctx, req.(*GetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CsbiService_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetPayloadRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(CsbiServiceServer).GetFile(m, &csbiServiceGetFileServer{stream})
}

type CsbiService_GetFileServer interface {
	Send(*Payload) error
	grpc.ServerStream
}

type csbiServiceGetFileServer struct {
	grpc.ServerStream
}

func (x *csbiServiceGetFileServer) Send(m *Payload) error {
	return x.ServerStream.SendMsg(m)
}

func _CsbiService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CsbiServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CsbiService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CsbiServiceServer).Create(ctx, req.(*CreateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CsbiService_CreateGoStruct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CsbiServiceServer).CreateGoStruct(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CsbiService_CreateGoStruct_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CsbiServiceServer).CreateGoStruct(ctx, req.(*CreateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CsbiService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CsbiServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CsbiService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CsbiServiceServer).Delete(ctx, req.(*DeleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CsbiService_Hello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Syn)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CsbiServiceServer).Hello(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CsbiService_Hello_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CsbiServiceServer).Hello(ctx, req.(*Syn))
	}
	return interceptor(ctx, in, info, handler)
}

// CsbiService_ServiceDesc is the grpc.ServiceDesc for CsbiService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CsbiService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gosdn.csbi.CsbiService",
	HandlerType: (*CsbiServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CsbiService_Get_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _CsbiService_Create_Handler,
		},
		{
			MethodName: "CreateGoStruct",
			Handler:    _CsbiService_CreateGoStruct_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _CsbiService_Delete_Handler,
		},
		{
			MethodName: "Hello",
			Handler:    _CsbiService_Hello_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetFile",
			Handler:       _CsbiService_GetFile_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gosdn/csbi/csbi.proto",
}
