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

package encoder

import (
	"context"

	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"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

// ServiceFooBarClient is the client API for ServiceFooBar 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 ServiceFooBarClient interface {
	Foo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

type serviceFooBarClient struct {
	cc grpc.ClientConnInterface
}

func NewServiceFooBarClient(cc grpc.ClientConnInterface) ServiceFooBarClient {
	return &serviceFooBarClient{cc}
}

func (c *serviceFooBarClient) Foo(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/encoder.ServiceFooBar/foo", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ServiceFooBarServer is the server API for ServiceFooBar service.
// All implementations must embed UnimplementedServiceFooBarServer
// for forward compatibility
type ServiceFooBarServer interface {
	Foo(context.Context, *Request) (*Response, error)
	mustEmbedUnimplementedServiceFooBarServer()
}

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

func (UnimplementedServiceFooBarServer) Foo(context.Context, *Request) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Foo not implemented")
}
func (UnimplementedServiceFooBarServer) mustEmbedUnimplementedServiceFooBarServer() {}

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

func RegisterServiceFooBarServer(s grpc.ServiceRegistrar, srv ServiceFooBarServer) {
	s.RegisterService(&ServiceFooBar_ServiceDesc, srv)
}

func _ServiceFooBar_Foo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceFooBarServer).Foo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/encoder.ServiceFooBar/foo",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceFooBarServer).Foo(ctx, req.(*Request))
	}
	return interceptor(ctx, in, info, handler)
}

// ServiceFooBar_ServiceDesc is the grpc.ServiceDesc for ServiceFooBar service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ServiceFooBar_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "encoder.ServiceFooBar",
	HandlerType: (*ServiceFooBarServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "foo",
			Handler:    _ServiceFooBar_Foo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service.proto",
}
