// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.19.0
// source: proto/c_api/c-api.proto

package c_api

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

// CServiceClient is the client API for CService 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 CServiceClient interface {
	CMethod(ctx context.Context, in *CRequest, opts ...grpc.CallOption) (*CReply, error)
}

type cServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCServiceClient(cc grpc.ClientConnInterface) CServiceClient {
	return &cServiceClient{cc}
}

func (c *cServiceClient) CMethod(ctx context.Context, in *CRequest, opts ...grpc.CallOption) (*CReply, error) {
	out := new(CReply)
	err := c.cc.Invoke(ctx, "/c_api.CService/cMethod", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CServiceServer is the server API for CService service.
// All implementations must embed UnimplementedCServiceServer
// for forward compatibility
type CServiceServer interface {
	CMethod(context.Context, *CRequest) (*CReply, error)
	mustEmbedUnimplementedCServiceServer()
}

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

func (UnimplementedCServiceServer) CMethod(context.Context, *CRequest) (*CReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CMethod not implemented")
}
func (UnimplementedCServiceServer) mustEmbedUnimplementedCServiceServer() {}

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

func RegisterCServiceServer(s grpc.ServiceRegistrar, srv CServiceServer) {
	s.RegisterService(&CService_ServiceDesc, srv)
}

func _CService_CMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CServiceServer).CMethod(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/c_api.CService/cMethod",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CServiceServer).CMethod(ctx, req.(*CRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// CService_ServiceDesc is the grpc.ServiceDesc for CService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "c_api.CService",
	HandlerType: (*CServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "cMethod",
			Handler:    _CService_CMethod_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/c_api/c-api.proto",
}
