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

package proto

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 (
	FunctionService_FunctionInvoke_FullMethodName    = "/function.FunctionService/FunctionInvoke"
	FunctionService_FunctionGetArgs_FullMethodName   = "/function.FunctionService/FunctionGetArgs"
	FunctionService_FunctionSetResult_FullMethodName = "/function.FunctionService/FunctionSetResult"
	FunctionService_FunctionMonitor_FullMethodName   = "/function.FunctionService/FunctionMonitor"
	FunctionService_FunctionSchedule_FullMethodName  = "/function.FunctionService/FunctionSchedule"
)

// FunctionServiceClient is the client API for FunctionService 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 FunctionServiceClient interface {
	FunctionInvoke(ctx context.Context, in *FunctionInvokeRequest, opts ...grpc.CallOption) (FunctionService_FunctionInvokeClient, error)
	FunctionGetArgs(ctx context.Context, in *FunctionGetArgsRequest, opts ...grpc.CallOption) (*FunctionGetArgsResponse, error)
	FunctionSetResult(ctx context.Context, in *FunctionSetResultRequest, opts ...grpc.CallOption) (*FunctionSetResultResponse, error)
	FunctionMonitor(ctx context.Context, in *FunctionMonitorRequest, opts ...grpc.CallOption) (FunctionService_FunctionMonitorClient, error)
	FunctionSchedule(ctx context.Context, in *FunctionScheduleRequest, opts ...grpc.CallOption) (*FunctionScheduleResponse, error)
}

type functionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFunctionServiceClient(cc grpc.ClientConnInterface) FunctionServiceClient {
	return &functionServiceClient{cc}
}

func (c *functionServiceClient) FunctionInvoke(ctx context.Context, in *FunctionInvokeRequest, opts ...grpc.CallOption) (FunctionService_FunctionInvokeClient, error) {
	stream, err := c.cc.NewStream(ctx, &FunctionService_ServiceDesc.Streams[0], FunctionService_FunctionInvoke_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &functionServiceFunctionInvokeClient{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 FunctionService_FunctionInvokeClient interface {
	Recv() (*FunctionInvokeResponse, error)
	grpc.ClientStream
}

type functionServiceFunctionInvokeClient struct {
	grpc.ClientStream
}

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

func (c *functionServiceClient) FunctionGetArgs(ctx context.Context, in *FunctionGetArgsRequest, opts ...grpc.CallOption) (*FunctionGetArgsResponse, error) {
	out := new(FunctionGetArgsResponse)
	err := c.cc.Invoke(ctx, FunctionService_FunctionGetArgs_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *functionServiceClient) FunctionSetResult(ctx context.Context, in *FunctionSetResultRequest, opts ...grpc.CallOption) (*FunctionSetResultResponse, error) {
	out := new(FunctionSetResultResponse)
	err := c.cc.Invoke(ctx, FunctionService_FunctionSetResult_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *functionServiceClient) FunctionMonitor(ctx context.Context, in *FunctionMonitorRequest, opts ...grpc.CallOption) (FunctionService_FunctionMonitorClient, error) {
	stream, err := c.cc.NewStream(ctx, &FunctionService_ServiceDesc.Streams[1], FunctionService_FunctionMonitor_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &functionServiceFunctionMonitorClient{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 FunctionService_FunctionMonitorClient interface {
	Recv() (*FunctionMonitorResponse, error)
	grpc.ClientStream
}

type functionServiceFunctionMonitorClient struct {
	grpc.ClientStream
}

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

func (c *functionServiceClient) FunctionSchedule(ctx context.Context, in *FunctionScheduleRequest, opts ...grpc.CallOption) (*FunctionScheduleResponse, error) {
	out := new(FunctionScheduleResponse)
	err := c.cc.Invoke(ctx, FunctionService_FunctionSchedule_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// FunctionServiceServer is the server API for FunctionService service.
// All implementations must embed UnimplementedFunctionServiceServer
// for forward compatibility
type FunctionServiceServer interface {
	FunctionInvoke(*FunctionInvokeRequest, FunctionService_FunctionInvokeServer) error
	FunctionGetArgs(context.Context, *FunctionGetArgsRequest) (*FunctionGetArgsResponse, error)
	FunctionSetResult(context.Context, *FunctionSetResultRequest) (*FunctionSetResultResponse, error)
	FunctionMonitor(*FunctionMonitorRequest, FunctionService_FunctionMonitorServer) error
	FunctionSchedule(context.Context, *FunctionScheduleRequest) (*FunctionScheduleResponse, error)
	mustEmbedUnimplementedFunctionServiceServer()
}

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

func (UnimplementedFunctionServiceServer) FunctionInvoke(*FunctionInvokeRequest, FunctionService_FunctionInvokeServer) error {
	return status.Errorf(codes.Unimplemented, "method FunctionInvoke not implemented")
}
func (UnimplementedFunctionServiceServer) FunctionGetArgs(context.Context, *FunctionGetArgsRequest) (*FunctionGetArgsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FunctionGetArgs not implemented")
}
func (UnimplementedFunctionServiceServer) FunctionSetResult(context.Context, *FunctionSetResultRequest) (*FunctionSetResultResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FunctionSetResult not implemented")
}
func (UnimplementedFunctionServiceServer) FunctionMonitor(*FunctionMonitorRequest, FunctionService_FunctionMonitorServer) error {
	return status.Errorf(codes.Unimplemented, "method FunctionMonitor not implemented")
}
func (UnimplementedFunctionServiceServer) FunctionSchedule(context.Context, *FunctionScheduleRequest) (*FunctionScheduleResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FunctionSchedule not implemented")
}
func (UnimplementedFunctionServiceServer) mustEmbedUnimplementedFunctionServiceServer() {}

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

func RegisterFunctionServiceServer(s grpc.ServiceRegistrar, srv FunctionServiceServer) {
	s.RegisterService(&FunctionService_ServiceDesc, srv)
}

func _FunctionService_FunctionInvoke_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(FunctionInvokeRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(FunctionServiceServer).FunctionInvoke(m, &functionServiceFunctionInvokeServer{stream})
}

type FunctionService_FunctionInvokeServer interface {
	Send(*FunctionInvokeResponse) error
	grpc.ServerStream
}

type functionServiceFunctionInvokeServer struct {
	grpc.ServerStream
}

func (x *functionServiceFunctionInvokeServer) Send(m *FunctionInvokeResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _FunctionService_FunctionGetArgs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FunctionGetArgsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FunctionServiceServer).FunctionGetArgs(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FunctionService_FunctionGetArgs_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FunctionServiceServer).FunctionGetArgs(ctx, req.(*FunctionGetArgsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FunctionService_FunctionSetResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FunctionSetResultRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FunctionServiceServer).FunctionSetResult(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FunctionService_FunctionSetResult_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FunctionServiceServer).FunctionSetResult(ctx, req.(*FunctionSetResultRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FunctionService_FunctionMonitor_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(FunctionMonitorRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(FunctionServiceServer).FunctionMonitor(m, &functionServiceFunctionMonitorServer{stream})
}

type FunctionService_FunctionMonitorServer interface {
	Send(*FunctionMonitorResponse) error
	grpc.ServerStream
}

type functionServiceFunctionMonitorServer struct {
	grpc.ServerStream
}

func (x *functionServiceFunctionMonitorServer) Send(m *FunctionMonitorResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _FunctionService_FunctionSchedule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FunctionScheduleRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FunctionServiceServer).FunctionSchedule(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FunctionService_FunctionSchedule_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FunctionServiceServer).FunctionSchedule(ctx, req.(*FunctionScheduleRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// FunctionService_ServiceDesc is the grpc.ServiceDesc for FunctionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FunctionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "function.FunctionService",
	HandlerType: (*FunctionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FunctionGetArgs",
			Handler:    _FunctionService_FunctionGetArgs_Handler,
		},
		{
			MethodName: "FunctionSetResult",
			Handler:    _FunctionService_FunctionSetResult_Handler,
		},
		{
			MethodName: "FunctionSchedule",
			Handler:    _FunctionService_FunctionSchedule_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "FunctionInvoke",
			Handler:       _FunctionService_FunctionInvoke_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "FunctionMonitor",
			Handler:       _FunctionService_FunctionMonitor_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "function.proto",
}
