使用最新的protoc-gen-go和protoc-gen-go-grpc插件

This commit is contained in:
刘祥超
2023-08-06 23:36:50 +08:00
parent 65be70d015
commit e6af6b6575
315 changed files with 55373 additions and 51574 deletions

View File

@@ -1,17 +1,12 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc-gen-go v1.31.0
// protoc v3.19.4
// source: service_ns_user_plan.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -25,10 +20,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 创建用户套餐
type CreateNSUserPlanRequest struct {
state protoimpl.MessageState
@@ -1056,313 +1047,3 @@ func file_service_ns_user_plan_proto_init() {
file_service_ns_user_plan_proto_goTypes = nil
file_service_ns_user_plan_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// NSUserPlanServiceClient is the client API for NSUserPlanService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type NSUserPlanServiceClient interface {
// 创建用户套餐
CreateNSUserPlan(ctx context.Context, in *CreateNSUserPlanRequest, opts ...grpc.CallOption) (*CreateNSUserPlanResponse, error)
// 修改用户套餐
UpdateNSUserPlan(ctx context.Context, in *UpdateNSUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 删除用户套餐
DeleteNSUserPlan(ctx context.Context, in *DeleteNSUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 读取用户套餐
FindNSUserPlan(ctx context.Context, in *FindNSUserPlanRequest, opts ...grpc.CallOption) (*FindNSUserPlanResponse, error)
// 计算用户套餐数量
CountNSUserPlans(ctx context.Context, in *CountNSUserPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error)
// 列出单页套餐
ListNSUserPlans(ctx context.Context, in *ListNSUserPlansRequest, opts ...grpc.CallOption) (*ListNSUserPlansResponse, error)
// 使用余额购买用户套餐
BuyNSUserPlan(ctx context.Context, in *BuyNSUserPlanRequest, opts ...grpc.CallOption) (*BuyNSUserPlanResponse, error)
}
type nSUserPlanServiceClient struct {
cc grpc.ClientConnInterface
}
func NewNSUserPlanServiceClient(cc grpc.ClientConnInterface) NSUserPlanServiceClient {
return &nSUserPlanServiceClient{cc}
}
func (c *nSUserPlanServiceClient) CreateNSUserPlan(ctx context.Context, in *CreateNSUserPlanRequest, opts ...grpc.CallOption) (*CreateNSUserPlanResponse, error) {
out := new(CreateNSUserPlanResponse)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/createNSUserPlan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) UpdateNSUserPlan(ctx context.Context, in *UpdateNSUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/updateNSUserPlan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) DeleteNSUserPlan(ctx context.Context, in *DeleteNSUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/deleteNSUserPlan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) FindNSUserPlan(ctx context.Context, in *FindNSUserPlanRequest, opts ...grpc.CallOption) (*FindNSUserPlanResponse, error) {
out := new(FindNSUserPlanResponse)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/findNSUserPlan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) CountNSUserPlans(ctx context.Context, in *CountNSUserPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) {
out := new(RPCCountResponse)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/countNSUserPlans", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) ListNSUserPlans(ctx context.Context, in *ListNSUserPlansRequest, opts ...grpc.CallOption) (*ListNSUserPlansResponse, error) {
out := new(ListNSUserPlansResponse)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/listNSUserPlans", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *nSUserPlanServiceClient) BuyNSUserPlan(ctx context.Context, in *BuyNSUserPlanRequest, opts ...grpc.CallOption) (*BuyNSUserPlanResponse, error) {
out := new(BuyNSUserPlanResponse)
err := c.cc.Invoke(ctx, "/pb.NSUserPlanService/buyNSUserPlan", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NSUserPlanServiceServer is the server API for NSUserPlanService service.
type NSUserPlanServiceServer interface {
// 创建用户套餐
CreateNSUserPlan(context.Context, *CreateNSUserPlanRequest) (*CreateNSUserPlanResponse, error)
// 修改用户套餐
UpdateNSUserPlan(context.Context, *UpdateNSUserPlanRequest) (*RPCSuccess, error)
// 删除用户套餐
DeleteNSUserPlan(context.Context, *DeleteNSUserPlanRequest) (*RPCSuccess, error)
// 读取用户套餐
FindNSUserPlan(context.Context, *FindNSUserPlanRequest) (*FindNSUserPlanResponse, error)
// 计算用户套餐数量
CountNSUserPlans(context.Context, *CountNSUserPlansRequest) (*RPCCountResponse, error)
// 列出单页套餐
ListNSUserPlans(context.Context, *ListNSUserPlansRequest) (*ListNSUserPlansResponse, error)
// 使用余额购买用户套餐
BuyNSUserPlan(context.Context, *BuyNSUserPlanRequest) (*BuyNSUserPlanResponse, error)
}
// UnimplementedNSUserPlanServiceServer can be embedded to have forward compatible implementations.
type UnimplementedNSUserPlanServiceServer struct {
}
func (*UnimplementedNSUserPlanServiceServer) CreateNSUserPlan(context.Context, *CreateNSUserPlanRequest) (*CreateNSUserPlanResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateNSUserPlan not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) UpdateNSUserPlan(context.Context, *UpdateNSUserPlanRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateNSUserPlan not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) DeleteNSUserPlan(context.Context, *DeleteNSUserPlanRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteNSUserPlan not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) FindNSUserPlan(context.Context, *FindNSUserPlanRequest) (*FindNSUserPlanResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindNSUserPlan not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) CountNSUserPlans(context.Context, *CountNSUserPlansRequest) (*RPCCountResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountNSUserPlans not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) ListNSUserPlans(context.Context, *ListNSUserPlansRequest) (*ListNSUserPlansResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListNSUserPlans not implemented")
}
func (*UnimplementedNSUserPlanServiceServer) BuyNSUserPlan(context.Context, *BuyNSUserPlanRequest) (*BuyNSUserPlanResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BuyNSUserPlan not implemented")
}
func RegisterNSUserPlanServiceServer(s *grpc.Server, srv NSUserPlanServiceServer) {
s.RegisterService(&_NSUserPlanService_serviceDesc, srv)
}
func _NSUserPlanService_CreateNSUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateNSUserPlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).CreateNSUserPlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/CreateNSUserPlan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).CreateNSUserPlan(ctx, req.(*CreateNSUserPlanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_UpdateNSUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateNSUserPlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).UpdateNSUserPlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/UpdateNSUserPlan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).UpdateNSUserPlan(ctx, req.(*UpdateNSUserPlanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_DeleteNSUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteNSUserPlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).DeleteNSUserPlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/DeleteNSUserPlan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).DeleteNSUserPlan(ctx, req.(*DeleteNSUserPlanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_FindNSUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindNSUserPlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).FindNSUserPlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/FindNSUserPlan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).FindNSUserPlan(ctx, req.(*FindNSUserPlanRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_CountNSUserPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CountNSUserPlansRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).CountNSUserPlans(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/CountNSUserPlans",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).CountNSUserPlans(ctx, req.(*CountNSUserPlansRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_ListNSUserPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListNSUserPlansRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).ListNSUserPlans(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/ListNSUserPlans",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).ListNSUserPlans(ctx, req.(*ListNSUserPlansRequest))
}
return interceptor(ctx, in, info, handler)
}
func _NSUserPlanService_BuyNSUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BuyNSUserPlanRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NSUserPlanServiceServer).BuyNSUserPlan(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NSUserPlanService/BuyNSUserPlan",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NSUserPlanServiceServer).BuyNSUserPlan(ctx, req.(*BuyNSUserPlanRequest))
}
return interceptor(ctx, in, info, handler)
}
var _NSUserPlanService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.NSUserPlanService",
HandlerType: (*NSUserPlanServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "createNSUserPlan",
Handler: _NSUserPlanService_CreateNSUserPlan_Handler,
},
{
MethodName: "updateNSUserPlan",
Handler: _NSUserPlanService_UpdateNSUserPlan_Handler,
},
{
MethodName: "deleteNSUserPlan",
Handler: _NSUserPlanService_DeleteNSUserPlan_Handler,
},
{
MethodName: "findNSUserPlan",
Handler: _NSUserPlanService_FindNSUserPlan_Handler,
},
{
MethodName: "countNSUserPlans",
Handler: _NSUserPlanService_CountNSUserPlans_Handler,
},
{
MethodName: "listNSUserPlans",
Handler: _NSUserPlanService_ListNSUserPlans_Handler,
},
{
MethodName: "buyNSUserPlan",
Handler: _NSUserPlanService_BuyNSUserPlan_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_ns_user_plan.proto",
}