// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// versions:
|
// - protoc-gen-go-grpc v1.3.0
|
// - protoc v3.19.0
|
// source: product.proto
|
|
package product
|
|
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 (
|
ProductService_GetProductInfo_FullMethodName = "/productService/GetProductInfo"
|
ProductService_GetProductList_FullMethodName = "/productService/GetProductList"
|
)
|
|
// ProductServiceClient is the client API for ProductService 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 ProductServiceClient interface {
|
GetProductInfo(ctx context.Context, in *GetProductInfoRequest, opts ...grpc.CallOption) (*GetProductInfoResponse, error)
|
GetProductList(ctx context.Context, in *GetProductListRequest, opts ...grpc.CallOption) (*GetProductListResponse, error)
|
}
|
|
type productServiceClient struct {
|
cc grpc.ClientConnInterface
|
}
|
|
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient {
|
return &productServiceClient{cc}
|
}
|
|
func (c *productServiceClient) GetProductInfo(ctx context.Context, in *GetProductInfoRequest, opts ...grpc.CallOption) (*GetProductInfoResponse, error) {
|
out := new(GetProductInfoResponse)
|
err := c.cc.Invoke(ctx, ProductService_GetProductInfo_FullMethodName, in, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
func (c *productServiceClient) GetProductList(ctx context.Context, in *GetProductListRequest, opts ...grpc.CallOption) (*GetProductListResponse, error) {
|
out := new(GetProductListResponse)
|
err := c.cc.Invoke(ctx, ProductService_GetProductList_FullMethodName, in, out, opts...)
|
if err != nil {
|
return nil, err
|
}
|
return out, nil
|
}
|
|
// ProductServiceServer is the server API for ProductService service.
|
// All implementations must embed UnimplementedProductServiceServer
|
// for forward compatibility
|
type ProductServiceServer interface {
|
GetProductInfo(context.Context, *GetProductInfoRequest) (*GetProductInfoResponse, error)
|
GetProductList(context.Context, *GetProductListRequest) (*GetProductListResponse, error)
|
mustEmbedUnimplementedProductServiceServer()
|
}
|
|
// UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
|
type UnimplementedProductServiceServer struct {
|
}
|
|
func (UnimplementedProductServiceServer) GetProductInfo(context.Context, *GetProductInfoRequest) (*GetProductInfoResponse, error) {
|
return nil, status.Errorf(codes.Unimplemented, "method GetProductInfo not implemented")
|
}
|
func (UnimplementedProductServiceServer) GetProductList(context.Context, *GetProductListRequest) (*GetProductListResponse, error) {
|
return nil, status.Errorf(codes.Unimplemented, "method GetProductList not implemented")
|
}
|
func (UnimplementedProductServiceServer) mustEmbedUnimplementedProductServiceServer() {}
|
|
// UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service.
|
// Use of this interface is not recommended, as added methods to ProductServiceServer will
|
// result in compilation errors.
|
type UnsafeProductServiceServer interface {
|
mustEmbedUnimplementedProductServiceServer()
|
}
|
|
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer) {
|
s.RegisterService(&ProductService_ServiceDesc, srv)
|
}
|
|
func _ProductService_GetProductInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
in := new(GetProductInfoRequest)
|
if err := dec(in); err != nil {
|
return nil, err
|
}
|
if interceptor == nil {
|
return srv.(ProductServiceServer).GetProductInfo(ctx, in)
|
}
|
info := &grpc.UnaryServerInfo{
|
Server: srv,
|
FullMethod: ProductService_GetProductInfo_FullMethodName,
|
}
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
return srv.(ProductServiceServer).GetProductInfo(ctx, req.(*GetProductInfoRequest))
|
}
|
return interceptor(ctx, in, info, handler)
|
}
|
|
func _ProductService_GetProductList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
in := new(GetProductListRequest)
|
if err := dec(in); err != nil {
|
return nil, err
|
}
|
if interceptor == nil {
|
return srv.(ProductServiceServer).GetProductList(ctx, in)
|
}
|
info := &grpc.UnaryServerInfo{
|
Server: srv,
|
FullMethod: ProductService_GetProductList_FullMethodName,
|
}
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
return srv.(ProductServiceServer).GetProductList(ctx, req.(*GetProductListRequest))
|
}
|
return interceptor(ctx, in, info, handler)
|
}
|
|
// ProductService_ServiceDesc is the grpc.ServiceDesc for ProductService service.
|
// It's only intended for direct use with grpc.RegisterService,
|
// and not to be introspected or modified (even as a copy)
|
var ProductService_ServiceDesc = grpc.ServiceDesc{
|
ServiceName: "productService",
|
HandlerType: (*ProductServiceServer)(nil),
|
Methods: []grpc.MethodDesc{
|
{
|
MethodName: "GetProductInfo",
|
Handler: _ProductService_GetProductInfo_Handler,
|
},
|
{
|
MethodName: "GetProductList",
|
Handler: _ProductService_GetProductList_Handler,
|
},
|
},
|
Streams: []grpc.StreamDesc{},
|
Metadata: "product.proto",
|
}
|