1053 lines
40 KiB
Go
1053 lines
40 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.4.0
|
|
// - protoc v3.19.4
|
|
// source: sentinel.proto
|
|
|
|
package sentinel
|
|
|
|
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.62.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion8
|
|
|
|
const (
|
|
Whitelist_CreateWhitelist_FullMethodName = "/whitelist/CreateWhitelist"
|
|
Whitelist_UpdateWhitelist_FullMethodName = "/whitelist/UpdateWhitelist"
|
|
Whitelist_DeleteWhitelist_FullMethodName = "/whitelist/DeleteWhitelist"
|
|
Whitelist_GetWhitePageList_FullMethodName = "/whitelist/GetWhitePageList"
|
|
Whitelist_MatchWhitelistByIp_FullMethodName = "/whitelist/MatchWhitelistByIp"
|
|
)
|
|
|
|
// WhitelistClient is the client API for Whitelist 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 WhitelistClient interface {
|
|
// Whitelist methods
|
|
CreateWhitelist(ctx context.Context, in *CreateWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error)
|
|
UpdateWhitelist(ctx context.Context, in *UpdateWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error)
|
|
DeleteWhitelist(ctx context.Context, in *DeleteWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error)
|
|
GetWhitePageList(ctx context.Context, in *WhitePageListRequest, opts ...grpc.CallOption) (*WhitelistResponse, error)
|
|
MatchWhitelistByIp(ctx context.Context, in *MatchWhitelistByIpRequest, opts ...grpc.CallOption) (*MatchResponse, error)
|
|
}
|
|
|
|
type whitelistClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewWhitelistClient(cc grpc.ClientConnInterface) WhitelistClient {
|
|
return &whitelistClient{cc}
|
|
}
|
|
|
|
func (c *whitelistClient) CreateWhitelist(ctx context.Context, in *CreateWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Whitelist)
|
|
err := c.cc.Invoke(ctx, Whitelist_CreateWhitelist_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *whitelistClient) UpdateWhitelist(ctx context.Context, in *UpdateWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Whitelist)
|
|
err := c.cc.Invoke(ctx, Whitelist_UpdateWhitelist_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *whitelistClient) DeleteWhitelist(ctx context.Context, in *DeleteWhitelistRequest, opts ...grpc.CallOption) (*Whitelist, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Whitelist)
|
|
err := c.cc.Invoke(ctx, Whitelist_DeleteWhitelist_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *whitelistClient) GetWhitePageList(ctx context.Context, in *WhitePageListRequest, opts ...grpc.CallOption) (*WhitelistResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(WhitelistResponse)
|
|
err := c.cc.Invoke(ctx, Whitelist_GetWhitePageList_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *whitelistClient) MatchWhitelistByIp(ctx context.Context, in *MatchWhitelistByIpRequest, opts ...grpc.CallOption) (*MatchResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(MatchResponse)
|
|
err := c.cc.Invoke(ctx, Whitelist_MatchWhitelistByIp_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// WhitelistServer is the server API for Whitelist service.
|
|
// All implementations must embed UnimplementedWhitelistServer
|
|
// for forward compatibility
|
|
type WhitelistServer interface {
|
|
// Whitelist methods
|
|
CreateWhitelist(context.Context, *CreateWhitelistRequest) (*Whitelist, error)
|
|
UpdateWhitelist(context.Context, *UpdateWhitelistRequest) (*Whitelist, error)
|
|
DeleteWhitelist(context.Context, *DeleteWhitelistRequest) (*Whitelist, error)
|
|
GetWhitePageList(context.Context, *WhitePageListRequest) (*WhitelistResponse, error)
|
|
MatchWhitelistByIp(context.Context, *MatchWhitelistByIpRequest) (*MatchResponse, error)
|
|
mustEmbedUnimplementedWhitelistServer()
|
|
}
|
|
|
|
// UnimplementedWhitelistServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedWhitelistServer struct {
|
|
}
|
|
|
|
func (UnimplementedWhitelistServer) CreateWhitelist(context.Context, *CreateWhitelistRequest) (*Whitelist, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateWhitelist not implemented")
|
|
}
|
|
func (UnimplementedWhitelistServer) UpdateWhitelist(context.Context, *UpdateWhitelistRequest) (*Whitelist, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateWhitelist not implemented")
|
|
}
|
|
func (UnimplementedWhitelistServer) DeleteWhitelist(context.Context, *DeleteWhitelistRequest) (*Whitelist, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteWhitelist not implemented")
|
|
}
|
|
func (UnimplementedWhitelistServer) GetWhitePageList(context.Context, *WhitePageListRequest) (*WhitelistResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetWhitePageList not implemented")
|
|
}
|
|
func (UnimplementedWhitelistServer) MatchWhitelistByIp(context.Context, *MatchWhitelistByIpRequest) (*MatchResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method MatchWhitelistByIp not implemented")
|
|
}
|
|
func (UnimplementedWhitelistServer) mustEmbedUnimplementedWhitelistServer() {}
|
|
|
|
// UnsafeWhitelistServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to WhitelistServer will
|
|
// result in compilation errors.
|
|
type UnsafeWhitelistServer interface {
|
|
mustEmbedUnimplementedWhitelistServer()
|
|
}
|
|
|
|
func RegisterWhitelistServer(s grpc.ServiceRegistrar, srv WhitelistServer) {
|
|
s.RegisterService(&Whitelist_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Whitelist_CreateWhitelist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateWhitelistRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhitelistServer).CreateWhitelist(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whitelist_CreateWhitelist_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhitelistServer).CreateWhitelist(ctx, req.(*CreateWhitelistRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Whitelist_UpdateWhitelist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateWhitelistRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhitelistServer).UpdateWhitelist(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whitelist_UpdateWhitelist_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhitelistServer).UpdateWhitelist(ctx, req.(*UpdateWhitelistRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Whitelist_DeleteWhitelist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteWhitelistRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhitelistServer).DeleteWhitelist(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whitelist_DeleteWhitelist_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhitelistServer).DeleteWhitelist(ctx, req.(*DeleteWhitelistRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Whitelist_GetWhitePageList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(WhitePageListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhitelistServer).GetWhitePageList(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whitelist_GetWhitePageList_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhitelistServer).GetWhitePageList(ctx, req.(*WhitePageListRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Whitelist_MatchWhitelistByIp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MatchWhitelistByIpRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(WhitelistServer).MatchWhitelistByIp(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Whitelist_MatchWhitelistByIp_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(WhitelistServer).MatchWhitelistByIp(ctx, req.(*MatchWhitelistByIpRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Whitelist_ServiceDesc is the grpc.ServiceDesc for Whitelist service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Whitelist_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "whitelist",
|
|
HandlerType: (*WhitelistServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateWhitelist",
|
|
Handler: _Whitelist_CreateWhitelist_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateWhitelist",
|
|
Handler: _Whitelist_UpdateWhitelist_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteWhitelist",
|
|
Handler: _Whitelist_DeleteWhitelist_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetWhitePageList",
|
|
Handler: _Whitelist_GetWhitePageList_Handler,
|
|
},
|
|
{
|
|
MethodName: "MatchWhitelistByIp",
|
|
Handler: _Whitelist_MatchWhitelistByIp_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sentinel.proto",
|
|
}
|
|
|
|
const (
|
|
Secret_CreateSecret_FullMethodName = "/secret/CreateSecret"
|
|
Secret_GetSecretByUserId_FullMethodName = "/secret/GetSecretByUserId"
|
|
Secret_GetSecretBySecretId_FullMethodName = "/secret/GetSecretBySecretId"
|
|
)
|
|
|
|
// SecretClient is the client API for Secret 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 SecretClient interface {
|
|
// Secret methods
|
|
CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*Secret, error)
|
|
GetSecretByUserId(ctx context.Context, in *GetRecordByIdRequest, opts ...grpc.CallOption) (*Secret, error)
|
|
GetSecretBySecretId(ctx context.Context, in *GetSecretBySecretIdRequest, opts ...grpc.CallOption) (*Secret, error)
|
|
}
|
|
|
|
type secretClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewSecretClient(cc grpc.ClientConnInterface) SecretClient {
|
|
return &secretClient{cc}
|
|
}
|
|
|
|
func (c *secretClient) CreateSecret(ctx context.Context, in *CreateSecretRequest, opts ...grpc.CallOption) (*Secret, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Secret)
|
|
err := c.cc.Invoke(ctx, Secret_CreateSecret_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *secretClient) GetSecretByUserId(ctx context.Context, in *GetRecordByIdRequest, opts ...grpc.CallOption) (*Secret, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Secret)
|
|
err := c.cc.Invoke(ctx, Secret_GetSecretByUserId_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *secretClient) GetSecretBySecretId(ctx context.Context, in *GetSecretBySecretIdRequest, opts ...grpc.CallOption) (*Secret, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Secret)
|
|
err := c.cc.Invoke(ctx, Secret_GetSecretBySecretId_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SecretServer is the server API for Secret service.
|
|
// All implementations must embed UnimplementedSecretServer
|
|
// for forward compatibility
|
|
type SecretServer interface {
|
|
// Secret methods
|
|
CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error)
|
|
GetSecretByUserId(context.Context, *GetRecordByIdRequest) (*Secret, error)
|
|
GetSecretBySecretId(context.Context, *GetSecretBySecretIdRequest) (*Secret, error)
|
|
mustEmbedUnimplementedSecretServer()
|
|
}
|
|
|
|
// UnimplementedSecretServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedSecretServer struct {
|
|
}
|
|
|
|
func (UnimplementedSecretServer) CreateSecret(context.Context, *CreateSecretRequest) (*Secret, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateSecret not implemented")
|
|
}
|
|
func (UnimplementedSecretServer) GetSecretByUserId(context.Context, *GetRecordByIdRequest) (*Secret, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetSecretByUserId not implemented")
|
|
}
|
|
func (UnimplementedSecretServer) GetSecretBySecretId(context.Context, *GetSecretBySecretIdRequest) (*Secret, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetSecretBySecretId not implemented")
|
|
}
|
|
func (UnimplementedSecretServer) mustEmbedUnimplementedSecretServer() {}
|
|
|
|
// UnsafeSecretServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to SecretServer will
|
|
// result in compilation errors.
|
|
type UnsafeSecretServer interface {
|
|
mustEmbedUnimplementedSecretServer()
|
|
}
|
|
|
|
func RegisterSecretServer(s grpc.ServiceRegistrar, srv SecretServer) {
|
|
s.RegisterService(&Secret_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Secret_CreateSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateSecretRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SecretServer).CreateSecret(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Secret_CreateSecret_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SecretServer).CreateSecret(ctx, req.(*CreateSecretRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Secret_GetSecretByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRecordByIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SecretServer).GetSecretByUserId(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Secret_GetSecretByUserId_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SecretServer).GetSecretByUserId(ctx, req.(*GetRecordByIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Secret_GetSecretBySecretId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetSecretBySecretIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SecretServer).GetSecretBySecretId(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Secret_GetSecretBySecretId_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SecretServer).GetSecretBySecretId(ctx, req.(*GetSecretBySecretIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Secret_ServiceDesc is the grpc.ServiceDesc for Secret service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Secret_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "secret",
|
|
HandlerType: (*SecretServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateSecret",
|
|
Handler: _Secret_CreateSecret_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetSecretByUserId",
|
|
Handler: _Secret_GetSecretByUserId_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetSecretBySecretId",
|
|
Handler: _Secret_GetSecretBySecretId_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sentinel.proto",
|
|
}
|
|
|
|
const (
|
|
Product_CreateProduct_FullMethodName = "/product/CreateProduct"
|
|
Product_UpdateProduct_FullMethodName = "/product/UpdateProduct"
|
|
Product_DeleteProduct_FullMethodName = "/product/DeleteProduct"
|
|
Product_GetProductPageList_FullMethodName = "/product/GetProductPageList"
|
|
Product_GetProductById_FullMethodName = "/product/GetProductById"
|
|
Product_GetProductByCode_FullMethodName = "/product/GetProductByCode"
|
|
)
|
|
|
|
// ProductClient is the client API for Product 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 ProductClient interface {
|
|
// Product methods
|
|
CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*Product, error)
|
|
UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...grpc.CallOption) (*Product, error)
|
|
DeleteProduct(ctx context.Context, in *DeleteProductRequest, opts ...grpc.CallOption) (*Product, error)
|
|
GetProductPageList(ctx context.Context, in *PageListRequest, opts ...grpc.CallOption) (*ProductResponse, error)
|
|
GetProductById(ctx context.Context, in *GetRecordByIdRequest, opts ...grpc.CallOption) (*Product, error)
|
|
GetProductByCode(ctx context.Context, in *GetRecordByCodeRequest, opts ...grpc.CallOption) (*Product, error)
|
|
}
|
|
|
|
type productClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewProductClient(cc grpc.ClientConnInterface) ProductClient {
|
|
return &productClient{cc}
|
|
}
|
|
|
|
func (c *productClient) CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*Product, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Product)
|
|
err := c.cc.Invoke(ctx, Product_CreateProduct_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productClient) UpdateProduct(ctx context.Context, in *UpdateProductRequest, opts ...grpc.CallOption) (*Product, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Product)
|
|
err := c.cc.Invoke(ctx, Product_UpdateProduct_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productClient) DeleteProduct(ctx context.Context, in *DeleteProductRequest, opts ...grpc.CallOption) (*Product, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Product)
|
|
err := c.cc.Invoke(ctx, Product_DeleteProduct_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productClient) GetProductPageList(ctx context.Context, in *PageListRequest, opts ...grpc.CallOption) (*ProductResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ProductResponse)
|
|
err := c.cc.Invoke(ctx, Product_GetProductPageList_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productClient) GetProductById(ctx context.Context, in *GetRecordByIdRequest, opts ...grpc.CallOption) (*Product, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Product)
|
|
err := c.cc.Invoke(ctx, Product_GetProductById_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *productClient) GetProductByCode(ctx context.Context, in *GetRecordByCodeRequest, opts ...grpc.CallOption) (*Product, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(Product)
|
|
err := c.cc.Invoke(ctx, Product_GetProductByCode_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ProductServer is the server API for Product service.
|
|
// All implementations must embed UnimplementedProductServer
|
|
// for forward compatibility
|
|
type ProductServer interface {
|
|
// Product methods
|
|
CreateProduct(context.Context, *CreateProductRequest) (*Product, error)
|
|
UpdateProduct(context.Context, *UpdateProductRequest) (*Product, error)
|
|
DeleteProduct(context.Context, *DeleteProductRequest) (*Product, error)
|
|
GetProductPageList(context.Context, *PageListRequest) (*ProductResponse, error)
|
|
GetProductById(context.Context, *GetRecordByIdRequest) (*Product, error)
|
|
GetProductByCode(context.Context, *GetRecordByCodeRequest) (*Product, error)
|
|
mustEmbedUnimplementedProductServer()
|
|
}
|
|
|
|
// UnimplementedProductServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedProductServer struct {
|
|
}
|
|
|
|
func (UnimplementedProductServer) CreateProduct(context.Context, *CreateProductRequest) (*Product, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateProduct not implemented")
|
|
}
|
|
func (UnimplementedProductServer) UpdateProduct(context.Context, *UpdateProductRequest) (*Product, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateProduct not implemented")
|
|
}
|
|
func (UnimplementedProductServer) DeleteProduct(context.Context, *DeleteProductRequest) (*Product, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteProduct not implemented")
|
|
}
|
|
func (UnimplementedProductServer) GetProductPageList(context.Context, *PageListRequest) (*ProductResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetProductPageList not implemented")
|
|
}
|
|
func (UnimplementedProductServer) GetProductById(context.Context, *GetRecordByIdRequest) (*Product, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetProductById not implemented")
|
|
}
|
|
func (UnimplementedProductServer) GetProductByCode(context.Context, *GetRecordByCodeRequest) (*Product, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetProductByCode not implemented")
|
|
}
|
|
func (UnimplementedProductServer) mustEmbedUnimplementedProductServer() {}
|
|
|
|
// UnsafeProductServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ProductServer will
|
|
// result in compilation errors.
|
|
type UnsafeProductServer interface {
|
|
mustEmbedUnimplementedProductServer()
|
|
}
|
|
|
|
func RegisterProductServer(s grpc.ServiceRegistrar, srv ProductServer) {
|
|
s.RegisterService(&Product_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Product_CreateProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateProductRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).CreateProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_CreateProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).CreateProduct(ctx, req.(*CreateProductRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Product_UpdateProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateProductRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).UpdateProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_UpdateProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).UpdateProduct(ctx, req.(*UpdateProductRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Product_DeleteProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteProductRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).DeleteProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_DeleteProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).DeleteProduct(ctx, req.(*DeleteProductRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Product_GetProductPageList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(PageListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).GetProductPageList(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_GetProductPageList_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).GetProductPageList(ctx, req.(*PageListRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Product_GetProductById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRecordByIdRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).GetProductById(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_GetProductById_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).GetProductById(ctx, req.(*GetRecordByIdRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Product_GetProductByCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRecordByCodeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ProductServer).GetProductByCode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Product_GetProductByCode_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ProductServer).GetProductByCode(ctx, req.(*GetRecordByCodeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Product_ServiceDesc is the grpc.ServiceDesc for Product service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Product_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "product",
|
|
HandlerType: (*ProductServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateProduct",
|
|
Handler: _Product_CreateProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateProduct",
|
|
Handler: _Product_UpdateProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteProduct",
|
|
Handler: _Product_DeleteProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetProductPageList",
|
|
Handler: _Product_GetProductPageList_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetProductById",
|
|
Handler: _Product_GetProductById_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetProductByCode",
|
|
Handler: _Product_GetProductByCode_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sentinel.proto",
|
|
}
|
|
|
|
const (
|
|
UserProduct_CreateUserProduct_FullMethodName = "/userProduct/CreateUserProduct"
|
|
UserProduct_GetUserProductPageList_FullMethodName = "/userProduct/GetUserProductPageList"
|
|
UserProduct_GetUserProduct_FullMethodName = "/userProduct/GetUserProduct"
|
|
UserProduct_MatchingUserIdProductCode_FullMethodName = "/userProduct/MatchingUserIdProductCode"
|
|
)
|
|
|
|
// UserProductClient is the client API for UserProduct 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 UserProductClient interface {
|
|
// UserProduct methods
|
|
CreateUserProduct(ctx context.Context, in *CreateUserProductRequest, opts ...grpc.CallOption) (*UserProductEmptyResponse, error)
|
|
GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductPageListResponse, error)
|
|
GetUserProduct(ctx context.Context, in *UserProuctRequest, opts ...grpc.CallOption) (*UserProductResponse, error)
|
|
MatchingUserIdProductCode(ctx context.Context, in *MatchingUserIdProductCodeRequest, opts ...grpc.CallOption) (*MatchResponse, error)
|
|
}
|
|
|
|
type userProductClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserProductClient(cc grpc.ClientConnInterface) UserProductClient {
|
|
return &userProductClient{cc}
|
|
}
|
|
|
|
func (c *userProductClient) CreateUserProduct(ctx context.Context, in *CreateUserProductRequest, opts ...grpc.CallOption) (*UserProductEmptyResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UserProductEmptyResponse)
|
|
err := c.cc.Invoke(ctx, UserProduct_CreateUserProduct_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userProductClient) GetUserProductPageList(ctx context.Context, in *UserProuctPageListRequest, opts ...grpc.CallOption) (*UserProductPageListResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UserProductPageListResponse)
|
|
err := c.cc.Invoke(ctx, UserProduct_GetUserProductPageList_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userProductClient) GetUserProduct(ctx context.Context, in *UserProuctRequest, opts ...grpc.CallOption) (*UserProductResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UserProductResponse)
|
|
err := c.cc.Invoke(ctx, UserProduct_GetUserProduct_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userProductClient) MatchingUserIdProductCode(ctx context.Context, in *MatchingUserIdProductCodeRequest, opts ...grpc.CallOption) (*MatchResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(MatchResponse)
|
|
err := c.cc.Invoke(ctx, UserProduct_MatchingUserIdProductCode_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// UserProductServer is the server API for UserProduct service.
|
|
// All implementations must embed UnimplementedUserProductServer
|
|
// for forward compatibility
|
|
type UserProductServer interface {
|
|
// UserProduct methods
|
|
CreateUserProduct(context.Context, *CreateUserProductRequest) (*UserProductEmptyResponse, error)
|
|
GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductPageListResponse, error)
|
|
GetUserProduct(context.Context, *UserProuctRequest) (*UserProductResponse, error)
|
|
MatchingUserIdProductCode(context.Context, *MatchingUserIdProductCodeRequest) (*MatchResponse, error)
|
|
mustEmbedUnimplementedUserProductServer()
|
|
}
|
|
|
|
// UnimplementedUserProductServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserProductServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserProductServer) CreateUserProduct(context.Context, *CreateUserProductRequest) (*UserProductEmptyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateUserProduct not implemented")
|
|
}
|
|
func (UnimplementedUserProductServer) GetUserProductPageList(context.Context, *UserProuctPageListRequest) (*UserProductPageListResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserProductPageList not implemented")
|
|
}
|
|
func (UnimplementedUserProductServer) GetUserProduct(context.Context, *UserProuctRequest) (*UserProductResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetUserProduct not implemented")
|
|
}
|
|
func (UnimplementedUserProductServer) MatchingUserIdProductCode(context.Context, *MatchingUserIdProductCodeRequest) (*MatchResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method MatchingUserIdProductCode not implemented")
|
|
}
|
|
func (UnimplementedUserProductServer) mustEmbedUnimplementedUserProductServer() {}
|
|
|
|
// UnsafeUserProductServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to UserProductServer will
|
|
// result in compilation errors.
|
|
type UnsafeUserProductServer interface {
|
|
mustEmbedUnimplementedUserProductServer()
|
|
}
|
|
|
|
func RegisterUserProductServer(s grpc.ServiceRegistrar, srv UserProductServer) {
|
|
s.RegisterService(&UserProduct_ServiceDesc, srv)
|
|
}
|
|
|
|
func _UserProduct_CreateUserProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateUserProductRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserProductServer).CreateUserProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserProduct_CreateUserProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserProductServer).CreateUserProduct(ctx, req.(*CreateUserProductRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserProduct_GetUserProductPageList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserProuctPageListRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserProductServer).GetUserProductPageList(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserProduct_GetUserProductPageList_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserProductServer).GetUserProductPageList(ctx, req.(*UserProuctPageListRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserProduct_GetUserProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UserProuctRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserProductServer).GetUserProduct(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserProduct_GetUserProduct_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserProductServer).GetUserProduct(ctx, req.(*UserProuctRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserProduct_MatchingUserIdProductCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(MatchingUserIdProductCodeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserProductServer).MatchingUserIdProductCode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: UserProduct_MatchingUserIdProductCode_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserProductServer).MatchingUserIdProductCode(ctx, req.(*MatchingUserIdProductCodeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// UserProduct_ServiceDesc is the grpc.ServiceDesc for UserProduct service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var UserProduct_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "userProduct",
|
|
HandlerType: (*UserProductServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateUserProduct",
|
|
Handler: _UserProduct_CreateUserProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUserProductPageList",
|
|
Handler: _UserProduct_GetUserProductPageList_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetUserProduct",
|
|
Handler: _UserProduct_GetUserProduct_Handler,
|
|
},
|
|
{
|
|
MethodName: "MatchingUserIdProductCode",
|
|
Handler: _UserProduct_MatchingUserIdProductCode_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sentinel.proto",
|
|
}
|
|
|
|
const (
|
|
TopUp_AliTopUp_FullMethodName = "/topUp/AliTopUp"
|
|
TopUp_AliTopUpNotify_FullMethodName = "/topUp/AliTopUpNotify"
|
|
)
|
|
|
|
// TopUpClient is the client API for TopUp 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 TopUpClient interface {
|
|
AliTopUp(ctx context.Context, in *AliTopUpRequest, opts ...grpc.CallOption) (*AliTopUpResponse, error)
|
|
AliTopUpNotify(ctx context.Context, in *AliTopUpNotifyRequest, opts ...grpc.CallOption) (*AliTopUpNotifyResponse, error)
|
|
}
|
|
|
|
type topUpClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewTopUpClient(cc grpc.ClientConnInterface) TopUpClient {
|
|
return &topUpClient{cc}
|
|
}
|
|
|
|
func (c *topUpClient) AliTopUp(ctx context.Context, in *AliTopUpRequest, opts ...grpc.CallOption) (*AliTopUpResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AliTopUpResponse)
|
|
err := c.cc.Invoke(ctx, TopUp_AliTopUp_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *topUpClient) AliTopUpNotify(ctx context.Context, in *AliTopUpNotifyRequest, opts ...grpc.CallOption) (*AliTopUpNotifyResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(AliTopUpNotifyResponse)
|
|
err := c.cc.Invoke(ctx, TopUp_AliTopUpNotify_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// TopUpServer is the server API for TopUp service.
|
|
// All implementations must embed UnimplementedTopUpServer
|
|
// for forward compatibility
|
|
type TopUpServer interface {
|
|
AliTopUp(context.Context, *AliTopUpRequest) (*AliTopUpResponse, error)
|
|
AliTopUpNotify(context.Context, *AliTopUpNotifyRequest) (*AliTopUpNotifyResponse, error)
|
|
mustEmbedUnimplementedTopUpServer()
|
|
}
|
|
|
|
// UnimplementedTopUpServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedTopUpServer struct {
|
|
}
|
|
|
|
func (UnimplementedTopUpServer) AliTopUp(context.Context, *AliTopUpRequest) (*AliTopUpResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AliTopUp not implemented")
|
|
}
|
|
func (UnimplementedTopUpServer) AliTopUpNotify(context.Context, *AliTopUpNotifyRequest) (*AliTopUpNotifyResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method AliTopUpNotify not implemented")
|
|
}
|
|
func (UnimplementedTopUpServer) mustEmbedUnimplementedTopUpServer() {}
|
|
|
|
// UnsafeTopUpServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to TopUpServer will
|
|
// result in compilation errors.
|
|
type UnsafeTopUpServer interface {
|
|
mustEmbedUnimplementedTopUpServer()
|
|
}
|
|
|
|
func RegisterTopUpServer(s grpc.ServiceRegistrar, srv TopUpServer) {
|
|
s.RegisterService(&TopUp_ServiceDesc, srv)
|
|
}
|
|
|
|
func _TopUp_AliTopUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AliTopUpRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TopUpServer).AliTopUp(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TopUp_AliTopUp_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TopUpServer).AliTopUp(ctx, req.(*AliTopUpRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _TopUp_AliTopUpNotify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(AliTopUpNotifyRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TopUpServer).AliTopUpNotify(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: TopUp_AliTopUpNotify_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TopUpServer).AliTopUpNotify(ctx, req.(*AliTopUpNotifyRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// TopUp_ServiceDesc is the grpc.ServiceDesc for TopUp service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var TopUp_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "topUp",
|
|
HandlerType: (*TopUpServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "AliTopUp",
|
|
Handler: _TopUp_AliTopUp_Handler,
|
|
},
|
|
{
|
|
MethodName: "AliTopUpNotify",
|
|
Handler: _TopUp_AliTopUpNotify_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sentinel.proto",
|
|
}
|