1 Star 0 Fork 0

xlizy/rpc-interface

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ShortUrlService_grpc.pb.go 3.92 KB
一键复制 编辑 原始数据 按行查看 历史
xlizy 提交于 2024-10-21 16:27 . fix
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.25.3
// source: ShortUrlService.proto
package rpcApi
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 (
ShortUrlService_CreateShortUrl_FullMethodName = "/ShortUrlService/CreateShortUrl"
)
// ShortUrlServiceClient is the client API for ShortUrlService 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 ShortUrlServiceClient interface {
CreateShortUrl(ctx context.Context, in *CreateShortUrlReq, opts ...grpc.CallOption) (*CreateShortUrlRsp, error)
}
type shortUrlServiceClient struct {
cc grpc.ClientConnInterface
}
func NewShortUrlServiceClient(cc grpc.ClientConnInterface) ShortUrlServiceClient {
return &shortUrlServiceClient{cc}
}
func (c *shortUrlServiceClient) CreateShortUrl(ctx context.Context, in *CreateShortUrlReq, opts ...grpc.CallOption) (*CreateShortUrlRsp, error) {
out := new(CreateShortUrlRsp)
err := c.cc.Invoke(ctx, ShortUrlService_CreateShortUrl_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ShortUrlServiceServer is the server API for ShortUrlService service.
// All implementations must embed UnimplementedShortUrlServiceServer
// for forward compatibility
type ShortUrlServiceServer interface {
CreateShortUrl(context.Context, *CreateShortUrlReq) (*CreateShortUrlRsp, error)
mustEmbedUnimplementedShortUrlServiceServer()
}
// UnimplementedShortUrlServiceServer must be embedded to have forward compatible implementations.
type UnimplementedShortUrlServiceServer struct {
}
func (UnimplementedShortUrlServiceServer) CreateShortUrl(context.Context, *CreateShortUrlReq) (*CreateShortUrlRsp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateShortUrl not implemented")
}
func (UnimplementedShortUrlServiceServer) mustEmbedUnimplementedShortUrlServiceServer() {}
// UnsafeShortUrlServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ShortUrlServiceServer will
// result in compilation errors.
type UnsafeShortUrlServiceServer interface {
mustEmbedUnimplementedShortUrlServiceServer()
}
func RegisterShortUrlServiceServer(s grpc.ServiceRegistrar, srv ShortUrlServiceServer) {
s.RegisterService(&ShortUrlService_ServiceDesc, srv)
}
func _ShortUrlService_CreateShortUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateShortUrlReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShortUrlServiceServer).CreateShortUrl(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShortUrlService_CreateShortUrl_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShortUrlServiceServer).CreateShortUrl(ctx, req.(*CreateShortUrlReq))
}
return interceptor(ctx, in, info, handler)
}
// ShortUrlService_ServiceDesc is the grpc.ServiceDesc for ShortUrlService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ShortUrlService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "ShortUrlService",
HandlerType: (*ShortUrlServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateShortUrl",
Handler: _ShortUrlService_CreateShortUrl_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "ShortUrlService.proto",
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xlizy/rpc-interface.git
git@gitee.com:xlizy/rpc-interface.git
xlizy
rpc-interface
rpc-interface
v0.3.2

搜索帮助

0d507c66 1850385 C8b1a773 1850385