296 lines
10 KiB
Go
296 lines
10 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: v1/pastebin_module.proto
|
|
|
|
package genv1
|
|
|
|
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 (
|
|
PastebinService_List_FullMethodName = "/api_services.v1.PastebinService/List"
|
|
PastebinService_Add_FullMethodName = "/api_services.v1.PastebinService/Add"
|
|
PastebinService_Update_FullMethodName = "/api_services.v1.PastebinService/Update"
|
|
PastebinService_Get_FullMethodName = "/api_services.v1.PastebinService/Get"
|
|
PastebinService_Raw_FullMethodName = "/api_services.v1.PastebinService/Raw"
|
|
)
|
|
|
|
// PastebinServiceClient is the client API for PastebinService 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 PastebinServiceClient interface {
|
|
// @desc: 列表
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /list
|
|
List(ctx context.Context, in *PastebinServiceListReq, opts ...grpc.CallOption) (*PastebinServiceListResp, error)
|
|
// @desc: 新建
|
|
// @author: Young Xu
|
|
// @method: PUT
|
|
// @api: /add
|
|
Add(ctx context.Context, in *PastebinServiceAddReq, opts ...grpc.CallOption) (*PastebinServiceAddResp, error)
|
|
// @desc: 更新
|
|
// @author: Young Xu
|
|
// @method: POST
|
|
// @api: /update
|
|
Update(ctx context.Context, in *PastebinServiceUpdateReq, opts ...grpc.CallOption) (*PastebinServiceUpdateResp, error)
|
|
// @desc: 获取一条记录
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /get
|
|
Get(ctx context.Context, in *PastebinServiceGetReq, opts ...grpc.CallOption) (*PastebinServiceGetResp, error)
|
|
// @desc: 获取原文内容
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /raw
|
|
Raw(ctx context.Context, in *PastebinServiceRawReq, opts ...grpc.CallOption) (*PastebinServiceRawResp, error)
|
|
}
|
|
|
|
type pastebinServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewPastebinServiceClient(cc grpc.ClientConnInterface) PastebinServiceClient {
|
|
return &pastebinServiceClient{cc}
|
|
}
|
|
|
|
func (c *pastebinServiceClient) List(ctx context.Context, in *PastebinServiceListReq, opts ...grpc.CallOption) (*PastebinServiceListResp, error) {
|
|
out := new(PastebinServiceListResp)
|
|
err := c.cc.Invoke(ctx, PastebinService_List_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *pastebinServiceClient) Add(ctx context.Context, in *PastebinServiceAddReq, opts ...grpc.CallOption) (*PastebinServiceAddResp, error) {
|
|
out := new(PastebinServiceAddResp)
|
|
err := c.cc.Invoke(ctx, PastebinService_Add_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *pastebinServiceClient) Update(ctx context.Context, in *PastebinServiceUpdateReq, opts ...grpc.CallOption) (*PastebinServiceUpdateResp, error) {
|
|
out := new(PastebinServiceUpdateResp)
|
|
err := c.cc.Invoke(ctx, PastebinService_Update_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *pastebinServiceClient) Get(ctx context.Context, in *PastebinServiceGetReq, opts ...grpc.CallOption) (*PastebinServiceGetResp, error) {
|
|
out := new(PastebinServiceGetResp)
|
|
err := c.cc.Invoke(ctx, PastebinService_Get_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *pastebinServiceClient) Raw(ctx context.Context, in *PastebinServiceRawReq, opts ...grpc.CallOption) (*PastebinServiceRawResp, error) {
|
|
out := new(PastebinServiceRawResp)
|
|
err := c.cc.Invoke(ctx, PastebinService_Raw_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// PastebinServiceServer is the server API for PastebinService service.
|
|
// All implementations should embed UnimplementedPastebinServiceServer
|
|
// for forward compatibility
|
|
type PastebinServiceServer interface {
|
|
// @desc: 列表
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /list
|
|
List(context.Context, *PastebinServiceListReq) (*PastebinServiceListResp, error)
|
|
// @desc: 新建
|
|
// @author: Young Xu
|
|
// @method: PUT
|
|
// @api: /add
|
|
Add(context.Context, *PastebinServiceAddReq) (*PastebinServiceAddResp, error)
|
|
// @desc: 更新
|
|
// @author: Young Xu
|
|
// @method: POST
|
|
// @api: /update
|
|
Update(context.Context, *PastebinServiceUpdateReq) (*PastebinServiceUpdateResp, error)
|
|
// @desc: 获取一条记录
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /get
|
|
Get(context.Context, *PastebinServiceGetReq) (*PastebinServiceGetResp, error)
|
|
// @desc: 获取原文内容
|
|
// @author: Young Xu
|
|
// @method: GET
|
|
// @api: /raw
|
|
Raw(context.Context, *PastebinServiceRawReq) (*PastebinServiceRawResp, error)
|
|
}
|
|
|
|
// UnimplementedPastebinServiceServer should be embedded to have forward compatible implementations.
|
|
type UnimplementedPastebinServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedPastebinServiceServer) List(context.Context, *PastebinServiceListReq) (*PastebinServiceListResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedPastebinServiceServer) Add(context.Context, *PastebinServiceAddReq) (*PastebinServiceAddResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
|
|
}
|
|
func (UnimplementedPastebinServiceServer) Update(context.Context, *PastebinServiceUpdateReq) (*PastebinServiceUpdateResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
|
}
|
|
func (UnimplementedPastebinServiceServer) Get(context.Context, *PastebinServiceGetReq) (*PastebinServiceGetResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
|
}
|
|
func (UnimplementedPastebinServiceServer) Raw(context.Context, *PastebinServiceRawReq) (*PastebinServiceRawResp, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Raw not implemented")
|
|
}
|
|
|
|
// UnsafePastebinServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to PastebinServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafePastebinServiceServer interface {
|
|
mustEmbedUnimplementedPastebinServiceServer()
|
|
}
|
|
|
|
func RegisterPastebinServiceServer(s grpc.ServiceRegistrar, srv PastebinServiceServer) {
|
|
s.RegisterService(&PastebinService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _PastebinService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PastebinServiceListReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PastebinServiceServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PastebinService_List_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PastebinServiceServer).List(ctx, req.(*PastebinServiceListReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PastebinService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PastebinServiceAddReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PastebinServiceServer).Add(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PastebinService_Add_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PastebinServiceServer).Add(ctx, req.(*PastebinServiceAddReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PastebinService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PastebinServiceUpdateReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PastebinServiceServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PastebinService_Update_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PastebinServiceServer).Update(ctx, req.(*PastebinServiceUpdateReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PastebinService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PastebinServiceGetReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PastebinServiceServer).Get(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PastebinService_Get_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PastebinServiceServer).Get(ctx, req.(*PastebinServiceGetReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _PastebinService_Raw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PastebinServiceRawReq)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(PastebinServiceServer).Raw(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: PastebinService_Raw_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(PastebinServiceServer).Raw(ctx, req.(*PastebinServiceRawReq))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// PastebinService_ServiceDesc is the grpc.ServiceDesc for PastebinService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var PastebinService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "api_services.v1.PastebinService",
|
|
HandlerType: (*PastebinServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "List",
|
|
Handler: _PastebinService_List_Handler,
|
|
},
|
|
{
|
|
MethodName: "Add",
|
|
Handler: _PastebinService_Add_Handler,
|
|
},
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _PastebinService_Update_Handler,
|
|
},
|
|
{
|
|
MethodName: "Get",
|
|
Handler: _PastebinService_Get_Handler,
|
|
},
|
|
{
|
|
MethodName: "Raw",
|
|
Handler: _PastebinService_Raw_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "v1/pastebin_module.proto",
|
|
}
|