mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			344 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			344 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
 | 
						|
// versions:
 | 
						|
// - protoc-gen-go-grpc v1.3.0
 | 
						|
// - protoc             v3.19.4
 | 
						|
// source: service_post.proto
 | 
						|
 | 
						|
package pb
 | 
						|
 | 
						|
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.32.0 or later.
 | 
						|
const _ = grpc.SupportPackageIsVersion7
 | 
						|
 | 
						|
const (
 | 
						|
	PostService_CreatePost_FullMethodName  = "/pb.PostService/createPost"
 | 
						|
	PostService_UpdatePost_FullMethodName  = "/pb.PostService/updatePost"
 | 
						|
	PostService_DeletePost_FullMethodName  = "/pb.PostService/deletePost"
 | 
						|
	PostService_PublishPost_FullMethodName = "/pb.PostService/publishPost"
 | 
						|
	PostService_CountPosts_FullMethodName  = "/pb.PostService/countPosts"
 | 
						|
	PostService_ListPosts_FullMethodName   = "/pb.PostService/listPosts"
 | 
						|
	PostService_FindPost_FullMethodName    = "/pb.PostService/findPost"
 | 
						|
)
 | 
						|
 | 
						|
// PostServiceClient is the client API for PostService 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 PostServiceClient interface {
 | 
						|
	// 创建文章
 | 
						|
	CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error)
 | 
						|
	// 修改文章
 | 
						|
	UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
						|
	// 删除文章
 | 
						|
	DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
						|
	// 发布文章
 | 
						|
	PublishPost(ctx context.Context, in *PublishPostRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
 | 
						|
	// 计算文章数量
 | 
						|
	CountPosts(ctx context.Context, in *CountPostsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
 | 
						|
	// 列出单页文章
 | 
						|
	ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error)
 | 
						|
	// 查询单篇文章
 | 
						|
	FindPost(ctx context.Context, in *FindPostRequest, opts ...grpc.CallOption) (*FindPostResponse, error)
 | 
						|
}
 | 
						|
 | 
						|
type postServiceClient struct {
 | 
						|
	cc grpc.ClientConnInterface
 | 
						|
}
 | 
						|
 | 
						|
func NewPostServiceClient(cc grpc.ClientConnInterface) PostServiceClient {
 | 
						|
	return &postServiceClient{cc}
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) CreatePost(ctx context.Context, in *CreatePostRequest, opts ...grpc.CallOption) (*CreatePostResponse, error) {
 | 
						|
	out := new(CreatePostResponse)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_CreatePost_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) UpdatePost(ctx context.Context, in *UpdatePostRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
 | 
						|
	out := new(RPCSuccess)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_UpdatePost_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) DeletePost(ctx context.Context, in *DeletePostRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
 | 
						|
	out := new(RPCSuccess)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_DeletePost_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) PublishPost(ctx context.Context, in *PublishPostRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
 | 
						|
	out := new(RPCSuccess)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_PublishPost_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) CountPosts(ctx context.Context, in *CountPostsRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
 | 
						|
	out := new(RPCCountResponse)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_CountPosts_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) ListPosts(ctx context.Context, in *ListPostsRequest, opts ...grpc.CallOption) (*ListPostsResponse, error) {
 | 
						|
	out := new(ListPostsResponse)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_ListPosts_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
func (c *postServiceClient) FindPost(ctx context.Context, in *FindPostRequest, opts ...grpc.CallOption) (*FindPostResponse, error) {
 | 
						|
	out := new(FindPostResponse)
 | 
						|
	err := c.cc.Invoke(ctx, PostService_FindPost_FullMethodName, in, out, opts...)
 | 
						|
	if err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	return out, nil
 | 
						|
}
 | 
						|
 | 
						|
// PostServiceServer is the server API for PostService service.
 | 
						|
// All implementations should embed UnimplementedPostServiceServer
 | 
						|
// for forward compatibility
 | 
						|
type PostServiceServer interface {
 | 
						|
	// 创建文章
 | 
						|
	CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error)
 | 
						|
	// 修改文章
 | 
						|
	UpdatePost(context.Context, *UpdatePostRequest) (*RPCSuccess, error)
 | 
						|
	// 删除文章
 | 
						|
	DeletePost(context.Context, *DeletePostRequest) (*RPCSuccess, error)
 | 
						|
	// 发布文章
 | 
						|
	PublishPost(context.Context, *PublishPostRequest) (*RPCSuccess, error)
 | 
						|
	// 计算文章数量
 | 
						|
	CountPosts(context.Context, *CountPostsRequest) (*RPCCountResponse, error)
 | 
						|
	// 列出单页文章
 | 
						|
	ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error)
 | 
						|
	// 查询单篇文章
 | 
						|
	FindPost(context.Context, *FindPostRequest) (*FindPostResponse, error)
 | 
						|
}
 | 
						|
 | 
						|
// UnimplementedPostServiceServer should be embedded to have forward compatible implementations.
 | 
						|
type UnimplementedPostServiceServer struct {
 | 
						|
}
 | 
						|
 | 
						|
func (UnimplementedPostServiceServer) CreatePost(context.Context, *CreatePostRequest) (*CreatePostResponse, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method CreatePost not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) UpdatePost(context.Context, *UpdatePostRequest) (*RPCSuccess, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method UpdatePost not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) DeletePost(context.Context, *DeletePostRequest) (*RPCSuccess, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method DeletePost not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) PublishPost(context.Context, *PublishPostRequest) (*RPCSuccess, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method PublishPost not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) CountPosts(context.Context, *CountPostsRequest) (*RPCCountResponse, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method CountPosts not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) ListPosts(context.Context, *ListPostsRequest) (*ListPostsResponse, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method ListPosts not implemented")
 | 
						|
}
 | 
						|
func (UnimplementedPostServiceServer) FindPost(context.Context, *FindPostRequest) (*FindPostResponse, error) {
 | 
						|
	return nil, status.Errorf(codes.Unimplemented, "method FindPost not implemented")
 | 
						|
}
 | 
						|
 | 
						|
// UnsafePostServiceServer may be embedded to opt out of forward compatibility for this service.
 | 
						|
// Use of this interface is not recommended, as added methods to PostServiceServer will
 | 
						|
// result in compilation errors.
 | 
						|
type UnsafePostServiceServer interface {
 | 
						|
	mustEmbedUnimplementedPostServiceServer()
 | 
						|
}
 | 
						|
 | 
						|
func RegisterPostServiceServer(s grpc.ServiceRegistrar, srv PostServiceServer) {
 | 
						|
	s.RegisterService(&PostService_ServiceDesc, srv)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_CreatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(CreatePostRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).CreatePost(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_CreatePost_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).CreatePost(ctx, req.(*CreatePostRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_UpdatePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(UpdatePostRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).UpdatePost(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_UpdatePost_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).UpdatePost(ctx, req.(*UpdatePostRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(DeletePostRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).DeletePost(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_DeletePost_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).DeletePost(ctx, req.(*DeletePostRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_PublishPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(PublishPostRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).PublishPost(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_PublishPost_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).PublishPost(ctx, req.(*PublishPostRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_CountPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(CountPostsRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).CountPosts(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_CountPosts_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).CountPosts(ctx, req.(*CountPostsRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_ListPosts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(ListPostsRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).ListPosts(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_ListPosts_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).ListPosts(ctx, req.(*ListPostsRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
func _PostService_FindPost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 | 
						|
	in := new(FindPostRequest)
 | 
						|
	if err := dec(in); err != nil {
 | 
						|
		return nil, err
 | 
						|
	}
 | 
						|
	if interceptor == nil {
 | 
						|
		return srv.(PostServiceServer).FindPost(ctx, in)
 | 
						|
	}
 | 
						|
	info := &grpc.UnaryServerInfo{
 | 
						|
		Server:     srv,
 | 
						|
		FullMethod: PostService_FindPost_FullMethodName,
 | 
						|
	}
 | 
						|
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
 | 
						|
		return srv.(PostServiceServer).FindPost(ctx, req.(*FindPostRequest))
 | 
						|
	}
 | 
						|
	return interceptor(ctx, in, info, handler)
 | 
						|
}
 | 
						|
 | 
						|
// PostService_ServiceDesc is the grpc.ServiceDesc for PostService service.
 | 
						|
// It's only intended for direct use with grpc.RegisterService,
 | 
						|
// and not to be introspected or modified (even as a copy)
 | 
						|
var PostService_ServiceDesc = grpc.ServiceDesc{
 | 
						|
	ServiceName: "pb.PostService",
 | 
						|
	HandlerType: (*PostServiceServer)(nil),
 | 
						|
	Methods: []grpc.MethodDesc{
 | 
						|
		{
 | 
						|
			MethodName: "createPost",
 | 
						|
			Handler:    _PostService_CreatePost_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "updatePost",
 | 
						|
			Handler:    _PostService_UpdatePost_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "deletePost",
 | 
						|
			Handler:    _PostService_DeletePost_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "publishPost",
 | 
						|
			Handler:    _PostService_PublishPost_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "countPosts",
 | 
						|
			Handler:    _PostService_CountPosts_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "listPosts",
 | 
						|
			Handler:    _PostService_ListPosts_Handler,
 | 
						|
		},
 | 
						|
		{
 | 
						|
			MethodName: "findPost",
 | 
						|
			Handler:    _PostService_FindPost_Handler,
 | 
						|
		},
 | 
						|
	},
 | 
						|
	Streams:  []grpc.StreamDesc{},
 | 
						|
	Metadata: "service_post.proto",
 | 
						|
}
 |