You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/examples/blog/api/blog/v1/blog_grpc.pb.go

245 lines
9.2 KiB

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package v1
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
// BlogServiceClient is the client API for BlogService 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 BlogServiceClient interface {
CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...grpc.CallOption) (*CreateArticleReply, error)
UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...grpc.CallOption) (*UpdateArticleReply, error)
DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*DeleteArticleReply, error)
GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*GetArticleReply, error)
ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error)
}
type blogServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBlogServiceClient(cc grpc.ClientConnInterface) BlogServiceClient {
return &blogServiceClient{cc}
}
func (c *blogServiceClient) CreateArticle(ctx context.Context, in *CreateArticleRequest, opts ...grpc.CallOption) (*CreateArticleReply, error) {
out := new(CreateArticleReply)
err := c.cc.Invoke(ctx, "/api.v1.BlogService/CreateArticle", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) UpdateArticle(ctx context.Context, in *UpdateArticleRequest, opts ...grpc.CallOption) (*UpdateArticleReply, error) {
out := new(UpdateArticleReply)
err := c.cc.Invoke(ctx, "/api.v1.BlogService/UpdateArticle", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) DeleteArticle(ctx context.Context, in *DeleteArticleRequest, opts ...grpc.CallOption) (*DeleteArticleReply, error) {
out := new(DeleteArticleReply)
err := c.cc.Invoke(ctx, "/api.v1.BlogService/DeleteArticle", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) GetArticle(ctx context.Context, in *GetArticleRequest, opts ...grpc.CallOption) (*GetArticleReply, error) {
out := new(GetArticleReply)
err := c.cc.Invoke(ctx, "/api.v1.BlogService/GetArticle", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blogServiceClient) ListArticle(ctx context.Context, in *ListArticleRequest, opts ...grpc.CallOption) (*ListArticleReply, error) {
out := new(ListArticleReply)
err := c.cc.Invoke(ctx, "/api.v1.BlogService/ListArticle", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BlogServiceServer is the server API for BlogService service.
// All implementations must embed UnimplementedBlogServiceServer
// for forward compatibility
type BlogServiceServer interface {
CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error)
UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error)
DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error)
GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error)
ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error)
mustEmbedUnimplementedBlogServiceServer()
}
// UnimplementedBlogServiceServer must be embedded to have forward compatible implementations.
type UnimplementedBlogServiceServer struct {
}
func (UnimplementedBlogServiceServer) CreateArticle(context.Context, *CreateArticleRequest) (*CreateArticleReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateArticle not implemented")
}
func (UnimplementedBlogServiceServer) UpdateArticle(context.Context, *UpdateArticleRequest) (*UpdateArticleReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateArticle not implemented")
}
func (UnimplementedBlogServiceServer) DeleteArticle(context.Context, *DeleteArticleRequest) (*DeleteArticleReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteArticle not implemented")
}
func (UnimplementedBlogServiceServer) GetArticle(context.Context, *GetArticleRequest) (*GetArticleReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetArticle not implemented")
}
func (UnimplementedBlogServiceServer) ListArticle(context.Context, *ListArticleRequest) (*ListArticleReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListArticle not implemented")
}
func (UnimplementedBlogServiceServer) mustEmbedUnimplementedBlogServiceServer() {}
// UnsafeBlogServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BlogServiceServer will
// result in compilation errors.
type UnsafeBlogServiceServer interface {
mustEmbedUnimplementedBlogServiceServer()
}
func RegisterBlogServiceServer(s grpc.ServiceRegistrar, srv BlogServiceServer) {
s.RegisterService(&BlogService_ServiceDesc, srv)
}
func _BlogService_CreateArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateArticleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).CreateArticle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.BlogService/CreateArticle",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).CreateArticle(ctx, req.(*CreateArticleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_UpdateArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateArticleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).UpdateArticle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.BlogService/UpdateArticle",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).UpdateArticle(ctx, req.(*UpdateArticleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_DeleteArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteArticleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).DeleteArticle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.BlogService/DeleteArticle",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).DeleteArticle(ctx, req.(*DeleteArticleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_GetArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetArticleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).GetArticle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.BlogService/GetArticle",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).GetArticle(ctx, req.(*GetArticleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlogService_ListArticle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListArticleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlogServiceServer).ListArticle(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.v1.BlogService/ListArticle",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlogServiceServer).ListArticle(ctx, req.(*ListArticleRequest))
}
return interceptor(ctx, in, info, handler)
}
// BlogService_ServiceDesc is the grpc.ServiceDesc for BlogService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BlogService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.v1.BlogService",
HandlerType: (*BlogServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateArticle",
Handler: _BlogService_CreateArticle_Handler,
},
{
MethodName: "UpdateArticle",
Handler: _BlogService_UpdateArticle_Handler,
},
{
MethodName: "DeleteArticle",
Handler: _BlogService_DeleteArticle_Handler,
},
{
MethodName: "GetArticle",
Handler: _BlogService_GetArticle_Handler,
},
{
MethodName: "ListArticle",
Handler: _BlogService_ListArticle_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "blog.proto",
}