// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             (unknown)
// source: api/v1/markdown_service.proto

package apiv1

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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	MarkdownService_ParseMarkdown_FullMethodName   = "/memos.api.v1.MarkdownService/ParseMarkdown"
	MarkdownService_RestoreMarkdown_FullMethodName = "/memos.api.v1.MarkdownService/RestoreMarkdown"
	MarkdownService_GetLinkMetadata_FullMethodName = "/memos.api.v1.MarkdownService/GetLinkMetadata"
)

// MarkdownServiceClient is the client API for MarkdownService 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 MarkdownServiceClient interface {
	// Parses the given markdown content and returns a list of nodes.
	ParseMarkdown(ctx context.Context, in *ParseMarkdownRequest, opts ...grpc.CallOption) (*ParseMarkdownResponse, error)
	// Restores the given nodes to markdown content.
	RestoreMarkdown(ctx context.Context, in *RestoreMarkdownRequest, opts ...grpc.CallOption) (*RestoreMarkdownResponse, error)
	// GetLinkMetadata returns metadata for a given link.
	GetLinkMetadata(ctx context.Context, in *GetLinkMetadataRequest, opts ...grpc.CallOption) (*LinkMetadata, error)
}

type markdownServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewMarkdownServiceClient(cc grpc.ClientConnInterface) MarkdownServiceClient {
	return &markdownServiceClient{cc}
}

func (c *markdownServiceClient) ParseMarkdown(ctx context.Context, in *ParseMarkdownRequest, opts ...grpc.CallOption) (*ParseMarkdownResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ParseMarkdownResponse)
	err := c.cc.Invoke(ctx, MarkdownService_ParseMarkdown_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *markdownServiceClient) RestoreMarkdown(ctx context.Context, in *RestoreMarkdownRequest, opts ...grpc.CallOption) (*RestoreMarkdownResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RestoreMarkdownResponse)
	err := c.cc.Invoke(ctx, MarkdownService_RestoreMarkdown_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *markdownServiceClient) GetLinkMetadata(ctx context.Context, in *GetLinkMetadataRequest, opts ...grpc.CallOption) (*LinkMetadata, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(LinkMetadata)
	err := c.cc.Invoke(ctx, MarkdownService_GetLinkMetadata_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// MarkdownServiceServer is the server API for MarkdownService service.
// All implementations must embed UnimplementedMarkdownServiceServer
// for forward compatibility
type MarkdownServiceServer interface {
	// Parses the given markdown content and returns a list of nodes.
	ParseMarkdown(context.Context, *ParseMarkdownRequest) (*ParseMarkdownResponse, error)
	// Restores the given nodes to markdown content.
	RestoreMarkdown(context.Context, *RestoreMarkdownRequest) (*RestoreMarkdownResponse, error)
	// GetLinkMetadata returns metadata for a given link.
	GetLinkMetadata(context.Context, *GetLinkMetadataRequest) (*LinkMetadata, error)
	mustEmbedUnimplementedMarkdownServiceServer()
}

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

func (UnimplementedMarkdownServiceServer) ParseMarkdown(context.Context, *ParseMarkdownRequest) (*ParseMarkdownResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ParseMarkdown not implemented")
}
func (UnimplementedMarkdownServiceServer) RestoreMarkdown(context.Context, *RestoreMarkdownRequest) (*RestoreMarkdownResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RestoreMarkdown not implemented")
}
func (UnimplementedMarkdownServiceServer) GetLinkMetadata(context.Context, *GetLinkMetadataRequest) (*LinkMetadata, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetLinkMetadata not implemented")
}
func (UnimplementedMarkdownServiceServer) mustEmbedUnimplementedMarkdownServiceServer() {}

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

func RegisterMarkdownServiceServer(s grpc.ServiceRegistrar, srv MarkdownServiceServer) {
	s.RegisterService(&MarkdownService_ServiceDesc, srv)
}

func _MarkdownService_ParseMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ParseMarkdownRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MarkdownServiceServer).ParseMarkdown(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: MarkdownService_ParseMarkdown_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MarkdownServiceServer).ParseMarkdown(ctx, req.(*ParseMarkdownRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _MarkdownService_RestoreMarkdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RestoreMarkdownRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MarkdownServiceServer).RestoreMarkdown(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: MarkdownService_RestoreMarkdown_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MarkdownServiceServer).RestoreMarkdown(ctx, req.(*RestoreMarkdownRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _MarkdownService_GetLinkMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetLinkMetadataRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MarkdownServiceServer).GetLinkMetadata(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: MarkdownService_GetLinkMetadata_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MarkdownServiceServer).GetLinkMetadata(ctx, req.(*GetLinkMetadataRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// MarkdownService_ServiceDesc is the grpc.ServiceDesc for MarkdownService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var MarkdownService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "memos.api.v1.MarkdownService",
	HandlerType: (*MarkdownServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ParseMarkdown",
			Handler:    _MarkdownService_ParseMarkdown_Handler,
		},
		{
			MethodName: "RestoreMarkdown",
			Handler:    _MarkdownService_RestoreMarkdown_Handler,
		},
		{
			MethodName: "GetLinkMetadata",
			Handler:    _MarkdownService_GetLinkMetadata_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/markdown_service.proto",
}
