// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc             v7.35.0
// source: module/social/feed/proto/tag.proto

package feed

import (
	protobuf "bsm/full/protobuf"
	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 (
	Tag_List_FullMethodName     = "/feed.Tag/List"
	Tag_Create_FullMethodName   = "/feed.Tag/Create"
	Tag_PostList_FullMethodName = "/feed.Tag/PostList"
)

// TagClient is the client API for Tag 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 TagClient interface {
	// 标签列表
	List(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*TagListReply, error)
	// 新建标签
	Create(ctx context.Context, in *AddTagRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error)
	// 话题相关的文章
	PostList(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error)
}

type tagClient struct {
	cc grpc.ClientConnInterface
}

func NewTagClient(cc grpc.ClientConnInterface) TagClient {
	return &tagClient{cc}
}

func (c *tagClient) List(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*TagListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(TagListReply)
	err := c.cc.Invoke(ctx, Tag_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tagClient) Create(ctx context.Context, in *AddTagRequest, opts ...grpc.CallOption) (*protobuf.DataStatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.DataStatusReply)
	err := c.cc.Invoke(ctx, Tag_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tagClient) PostList(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*protobuf.FeedPostListReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(protobuf.FeedPostListReply)
	err := c.cc.Invoke(ctx, Tag_PostList_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TagServer is the server API for Tag service.
// All implementations should embed UnimplementedTagServer
// for forward compatibility.
type TagServer interface {
	// 标签列表
	List(context.Context, *protobuf.FetchRequest) (*TagListReply, error)
	// 新建标签
	Create(context.Context, *AddTagRequest) (*protobuf.DataStatusReply, error)
	// 话题相关的文章
	PostList(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error)
}

// UnimplementedTagServer 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 UnimplementedTagServer struct{}

func (UnimplementedTagServer) List(context.Context, *protobuf.FetchRequest) (*TagListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedTagServer) Create(context.Context, *AddTagRequest) (*protobuf.DataStatusReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedTagServer) PostList(context.Context, *protobuf.FetchRequest) (*protobuf.FeedPostListReply, error) {
	return nil, status.Error(codes.Unimplemented, "method PostList not implemented")
}
func (UnimplementedTagServer) testEmbeddedByValue() {}

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

func RegisterTagServer(s grpc.ServiceRegistrar, srv TagServer) {
	// If the following call panics, it indicates UnimplementedTagServer 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(&Tag_ServiceDesc, srv)
}

func _Tag_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(protobuf.FetchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tag_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagServer).List(ctx, req.(*protobuf.FetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

func _Tag_PostList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(protobuf.FetchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TagServer).PostList(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Tag_PostList_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TagServer).PostList(ctx, req.(*protobuf.FetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Tag_ServiceDesc is the grpc.ServiceDesc for Tag service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Tag_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "feed.Tag",
	HandlerType: (*TagServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Tag_List_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _Tag_Create_Handler,
		},
		{
			MethodName: "PostList",
			Handler:    _Tag_PostList_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "module/social/feed/proto/tag.proto",
}
