// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.15.8
// source: core_shared.proto

package core

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
)

// 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

// CoreSharedServiceClient is the client API for CoreSharedService 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 CoreSharedServiceClient interface {
	GetPostsForCurrentUser(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPostsForUserResponse, error)
	GetPostsForUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*GetPostsForUserResponse, error)
}

type coreSharedServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCoreSharedServiceClient(cc grpc.ClientConnInterface) CoreSharedServiceClient {
	return &coreSharedServiceClient{cc}
}

func (c *coreSharedServiceClient) GetPostsForCurrentUser(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPostsForUserResponse, error) {
	out := new(GetPostsForUserResponse)
	err := c.cc.Invoke(ctx, "/core.CoreSharedService/get_posts_for_current_user", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *coreSharedServiceClient) GetPostsForUser(ctx context.Context, in *wrapperspb.StringValue, opts ...grpc.CallOption) (*GetPostsForUserResponse, error) {
	out := new(GetPostsForUserResponse)
	err := c.cc.Invoke(ctx, "/core.CoreSharedService/get_posts_for_user", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CoreSharedServiceServer is the server API for CoreSharedService service.
// All implementations must embed UnimplementedCoreSharedServiceServer
// for forward compatibility
type CoreSharedServiceServer interface {
	GetPostsForCurrentUser(context.Context, *emptypb.Empty) (*GetPostsForUserResponse, error)
	GetPostsForUser(context.Context, *wrapperspb.StringValue) (*GetPostsForUserResponse, error)
	mustEmbedUnimplementedCoreSharedServiceServer()
}

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

func (UnimplementedCoreSharedServiceServer) GetPostsForCurrentUser(context.Context, *emptypb.Empty) (*GetPostsForUserResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPostsForCurrentUser not implemented")
}
func (UnimplementedCoreSharedServiceServer) GetPostsForUser(context.Context, *wrapperspb.StringValue) (*GetPostsForUserResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPostsForUser not implemented")
}
func (UnimplementedCoreSharedServiceServer) mustEmbedUnimplementedCoreSharedServiceServer() {}

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

func RegisterCoreSharedServiceServer(s grpc.ServiceRegistrar, srv CoreSharedServiceServer) {
	s.RegisterService(&CoreSharedService_ServiceDesc, srv)
}

func _CoreSharedService_GetPostsForCurrentUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CoreSharedServiceServer).GetPostsForCurrentUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/core.CoreSharedService/get_posts_for_current_user",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CoreSharedServiceServer).GetPostsForCurrentUser(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _CoreSharedService_GetPostsForUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrapperspb.StringValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CoreSharedServiceServer).GetPostsForUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/core.CoreSharedService/get_posts_for_user",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CoreSharedServiceServer).GetPostsForUser(ctx, req.(*wrapperspb.StringValue))
	}
	return interceptor(ctx, in, info, handler)
}

// CoreSharedService_ServiceDesc is the grpc.ServiceDesc for CoreSharedService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CoreSharedService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "core.CoreSharedService",
	HandlerType: (*CoreSharedServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "get_posts_for_current_user",
			Handler:    _CoreSharedService_GetPostsForCurrentUser_Handler,
		},
		{
			MethodName: "get_posts_for_user",
			Handler:    _CoreSharedService_GetPostsForUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "core_shared.proto",
}
