1 Star 0 Fork 0

谈子文/keyauth-tz

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
book_grpc.pb.go 9.08 KB
一键复制 编辑 原始数据 按行查看 历史
谈子文 提交于 2023-10-20 20:01 . keyauth init
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.24.3
// source: apps/book/pb/book.proto
package book
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 (
Service_CreateBook_FullMethodName = "/keyauth.apps.book.Service/CreateBook"
Service_QueryBook_FullMethodName = "/keyauth.apps.book.Service/QueryBook"
Service_DescribeBook_FullMethodName = "/keyauth.apps.book.Service/DescribeBook"
Service_UpdateBook_FullMethodName = "/keyauth.apps.book.Service/UpdateBook"
Service_DeleteBook_FullMethodName = "/keyauth.apps.book.Service/DeleteBook"
)
// ServiceClient is the client API for Service 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 ServiceClient interface {
CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error)
QueryBook(ctx context.Context, in *QueryBookRequest, opts ...grpc.CallOption) (*BookSet, error)
DescribeBook(ctx context.Context, in *DescribeBookRequest, opts ...grpc.CallOption) (*Book, error)
UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error)
DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*Book, error)
}
type serviceClient struct {
cc grpc.ClientConnInterface
}
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
return &serviceClient{cc}
}
func (c *serviceClient) CreateBook(ctx context.Context, in *CreateBookRequest, opts ...grpc.CallOption) (*Book, error) {
out := new(Book)
err := c.cc.Invoke(ctx, Service_CreateBook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceClient) QueryBook(ctx context.Context, in *QueryBookRequest, opts ...grpc.CallOption) (*BookSet, error) {
out := new(BookSet)
err := c.cc.Invoke(ctx, Service_QueryBook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceClient) DescribeBook(ctx context.Context, in *DescribeBookRequest, opts ...grpc.CallOption) (*Book, error) {
out := new(Book)
err := c.cc.Invoke(ctx, Service_DescribeBook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceClient) UpdateBook(ctx context.Context, in *UpdateBookRequest, opts ...grpc.CallOption) (*Book, error) {
out := new(Book)
err := c.cc.Invoke(ctx, Service_UpdateBook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *serviceClient) DeleteBook(ctx context.Context, in *DeleteBookRequest, opts ...grpc.CallOption) (*Book, error) {
out := new(Book)
err := c.cc.Invoke(ctx, Service_DeleteBook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ServiceServer is the server API for Service service.
// All implementations must embed UnimplementedServiceServer
// for forward compatibility
type ServiceServer interface {
CreateBook(context.Context, *CreateBookRequest) (*Book, error)
QueryBook(context.Context, *QueryBookRequest) (*BookSet, error)
DescribeBook(context.Context, *DescribeBookRequest) (*Book, error)
UpdateBook(context.Context, *UpdateBookRequest) (*Book, error)
DeleteBook(context.Context, *DeleteBookRequest) (*Book, error)
mustEmbedUnimplementedServiceServer()
}
// UnimplementedServiceServer must be embedded to have forward compatible implementations.
type UnimplementedServiceServer struct {
}
func (UnimplementedServiceServer) CreateBook(context.Context, *CreateBookRequest) (*Book, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBook not implemented")
}
func (UnimplementedServiceServer) QueryBook(context.Context, *QueryBookRequest) (*BookSet, error) {
return nil, status.Errorf(codes.Unimplemented, "method QueryBook not implemented")
}
func (UnimplementedServiceServer) DescribeBook(context.Context, *DescribeBookRequest) (*Book, error) {
return nil, status.Errorf(codes.Unimplemented, "method DescribeBook not implemented")
}
func (UnimplementedServiceServer) UpdateBook(context.Context, *UpdateBookRequest) (*Book, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateBook not implemented")
}
func (UnimplementedServiceServer) DeleteBook(context.Context, *DeleteBookRequest) (*Book, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBook not implemented")
}
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}
// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ServiceServer will
// result in compilation errors.
type UnsafeServiceServer interface {
mustEmbedUnimplementedServiceServer()
}
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) {
s.RegisterService(&Service_ServiceDesc, srv)
}
func _Service_CreateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServer).CreateBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Service_CreateBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).CreateBook(ctx, req.(*CreateBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Service_QueryBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServer).QueryBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Service_QueryBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).QueryBook(ctx, req.(*QueryBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Service_DescribeBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DescribeBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServer).DescribeBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Service_DescribeBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).DescribeBook(ctx, req.(*DescribeBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Service_UpdateBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServer).UpdateBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Service_UpdateBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).UpdateBook(ctx, req.(*UpdateBookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Service_DeleteBook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteBookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ServiceServer).DeleteBook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Service_DeleteBook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ServiceServer).DeleteBook(ctx, req.(*DeleteBookRequest))
}
return interceptor(ctx, in, info, handler)
}
// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Service_ServiceDesc = grpc.ServiceDesc{
ServiceName: "keyauth.apps.book.Service",
HandlerType: (*ServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateBook",
Handler: _Service_CreateBook_Handler,
},
{
MethodName: "QueryBook",
Handler: _Service_QueryBook_Handler,
},
{
MethodName: "DescribeBook",
Handler: _Service_DescribeBook_Handler,
},
{
MethodName: "UpdateBook",
Handler: _Service_UpdateBook_Handler,
},
{
MethodName: "DeleteBook",
Handler: _Service_DeleteBook_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "apps/book/pb/book.proto",
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/talk-about-articles/keyauth-tz.git
git@gitee.com:talk-about-articles/keyauth-tz.git
talk-about-articles
keyauth-tz
keyauth-tz
v1.0.14

搜索帮助

0d507c66 1850385 C8b1a773 1850385