protoc-gen-slc/pb/category_grpc.pb.go

242 lines
8.8 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v6.30.1
// source: category.proto
package content
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 (
Category_CategoryList_FullMethodName = "/content.Category/CategoryList"
Category_AddCategory_FullMethodName = "/content.Category/AddCategory"
Category_ModifyCategory_FullMethodName = "/content.Category/ModifyCategory"
Category_DeleteCategory_FullMethodName = "/content.Category/DeleteCategory"
)
// CategoryClient is the client API for Category 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 CategoryClient interface {
// 分类列表
CategoryList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CategoryListReply, error)
AddCategory(ctx context.Context, in *AddCategoryRequest, opts ...grpc.CallOption) (*AddCategoryResponse, error)
ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*Empty, error)
DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*Empty, error)
}
type categoryClient struct {
cc grpc.ClientConnInterface
}
func NewCategoryClient(cc grpc.ClientConnInterface) CategoryClient {
return &categoryClient{cc}
}
func (c *categoryClient) CategoryList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CategoryListReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CategoryListReply)
err := c.cc.Invoke(ctx, Category_CategoryList_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryClient) AddCategory(ctx context.Context, in *AddCategoryRequest, opts ...grpc.CallOption) (*AddCategoryResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AddCategoryResponse)
err := c.cc.Invoke(ctx, Category_AddCategory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryClient) ModifyCategory(ctx context.Context, in *ModifyCategoryRequest, opts ...grpc.CallOption) (*Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Empty)
err := c.cc.Invoke(ctx, Category_ModifyCategory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *categoryClient) DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Empty)
err := c.cc.Invoke(ctx, Category_DeleteCategory_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// CategoryServer is the server API for Category service.
// All implementations must embed UnimplementedCategoryServer
// for forward compatibility.
//
// 系统分类
type CategoryServer interface {
// 分类列表
CategoryList(context.Context, *Empty) (*CategoryListReply, error)
AddCategory(context.Context, *AddCategoryRequest) (*AddCategoryResponse, error)
ModifyCategory(context.Context, *ModifyCategoryRequest) (*Empty, error)
DeleteCategory(context.Context, *DeleteCategoryRequest) (*Empty, error)
mustEmbedUnimplementedCategoryServer()
}
// UnimplementedCategoryServer must 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 UnimplementedCategoryServer struct{}
func (UnimplementedCategoryServer) CategoryList(context.Context, *Empty) (*CategoryListReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method CategoryList not implemented")
}
func (UnimplementedCategoryServer) AddCategory(context.Context, *AddCategoryRequest) (*AddCategoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddCategory not implemented")
}
func (UnimplementedCategoryServer) ModifyCategory(context.Context, *ModifyCategoryRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ModifyCategory not implemented")
}
func (UnimplementedCategoryServer) DeleteCategory(context.Context, *DeleteCategoryRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteCategory not implemented")
}
func (UnimplementedCategoryServer) mustEmbedUnimplementedCategoryServer() {}
func (UnimplementedCategoryServer) testEmbeddedByValue() {}
// UnsafeCategoryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CategoryServer will
// result in compilation errors.
type UnsafeCategoryServer interface {
mustEmbedUnimplementedCategoryServer()
}
func RegisterCategoryServer(s grpc.ServiceRegistrar, srv CategoryServer) {
// If the following call pancis, it indicates UnimplementedCategoryServer 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(&Category_ServiceDesc, srv)
}
func _Category_CategoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryServer).CategoryList(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Category_CategoryList_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryServer).CategoryList(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Category_AddCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryServer).AddCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Category_AddCategory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryServer).AddCategory(ctx, req.(*AddCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Category_ModifyCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ModifyCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryServer).ModifyCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Category_ModifyCategory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryServer).ModifyCategory(ctx, req.(*ModifyCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Category_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteCategoryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CategoryServer).DeleteCategory(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Category_DeleteCategory_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CategoryServer).DeleteCategory(ctx, req.(*DeleteCategoryRequest))
}
return interceptor(ctx, in, info, handler)
}
// Category_ServiceDesc is the grpc.ServiceDesc for Category service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Category_ServiceDesc = grpc.ServiceDesc{
ServiceName: "content.Category",
HandlerType: (*CategoryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CategoryList",
Handler: _Category_CategoryList_Handler,
},
{
MethodName: "AddCategory",
Handler: _Category_AddCategory_Handler,
},
{
MethodName: "ModifyCategory",
Handler: _Category_ModifyCategory_Handler,
},
{
MethodName: "DeleteCategory",
Handler: _Category_DeleteCategory_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "category.proto",
}