// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.1
// source: module/base/cms/proto/tags.proto

package cms

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Tags_Fetch_FullMethodName  = "/cms.Tags/Fetch"
	Tags_Create_FullMethodName = "/cms.Tags/Create"
	Tags_Modify_FullMethodName = "/cms.Tags/Modify"
	Tags_Delete_FullMethodName = "/cms.Tags/Delete"
)

// TagsClient is the client API for Tags 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 TagsClient interface {
	// 标签列表
	Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error)
	// 创建标签
	Create(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error)
	// 修改标签
	Modify(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error)
	// 删除标签
	Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
}

type tagsClient struct {
	cc grpc.ClientConnInterface
}

func NewTagsClient(cc grpc.ClientConnInterface) TagsClient {
	return &tagsClient{cc}
}

func (c *tagsClient) Fetch(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*TagsListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TagsListReply)
	err := c.cc.Invoke(ctx, Tags_Fetch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tagsClient) Create(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Tags_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tagsClient) Modify(ctx context.Context, in *CmsTagsItem, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Tags_Modify_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tagsClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Tags_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TagsServer is the server API for Tags service.
// All implementations should embed UnimplementedTagsServer
// for forward compatibility.
//
// 标签
type TagsServer interface {
	// 标签列表
	Fetch(context.Context, *IdentRequest) (*TagsListReply, error)
	// 创建标签
	Create(context.Context, *CmsTagsItem) (*StatusReply, error)
	// 修改标签
	Modify(context.Context, *CmsTagsItem) (*StatusReply, error)
	// 删除标签
	Delete(context.Context, *IdentRequest) (*StatusReply, error)
}

// UnimplementedTagsServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedTagsServer struct{}

func (UnimplementedTagsServer) Fetch(context.Context, *IdentRequest) (*TagsListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedTagsServer) Create(context.Context, *CmsTagsItem) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedTagsServer) Modify(context.Context, *CmsTagsItem) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedTagsServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedTagsServer) testEmbeddedByValue() {}

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

func RegisterTagsServer(s grpc.ServiceRegistrar, srv TagsServer) {
	// If the following call panics, it indicates UnimplementedTagsServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Tags_ServiceDesc, srv)
}

func _Tags_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagsServer).Fetch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tags_Fetch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagsServer).Fetch(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Tags_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CmsTagsItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagsServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tags_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagsServer).Create(ctx, req.(*CmsTagsItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Tags_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CmsTagsItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagsServer).Modify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tags_Modify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagsServer).Modify(ctx, req.(*CmsTagsItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Tags_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagsServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tags_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagsServer).Delete(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Tags_ServiceDesc is the grpc.ServiceDesc for Tags service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Tags_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cms.Tags",
	HandlerType: (*TagsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _Tags_Fetch_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _Tags_Create_Handler,
		},
		{
			MethodName: "Modify",
			Handler:    _Tags_Modify_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Tags_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/base/cms/proto/tags.proto",
}
