You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.6 KiB

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.4
// source: protobufs/product.proto
package compilesReadOnly
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
// 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 {
// 定义服务的操作
// 远程过程,服务器端的过程
ProductInfo(ctx context.Context, in *ProductRequest, opts ...grpc.CallOption) (*ProductResponse, error)
}
type productClient struct {
cc grpc.ClientConnInterface
}
func NewProductClient(cc grpc.ClientConnInterface) ProductClient {
return &productClient{cc}
}
func (c *productClient) ProductInfo(ctx context.Context, in *ProductRequest, opts ...grpc.CallOption) (*ProductResponse, error) {
out := new(ProductResponse)
err := c.cc.Invoke(ctx, "/Product/ProductInfo", in, out, opts...)
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 {
// 定义服务的操作
// 远程过程,服务器端的过程
ProductInfo(context.Context, *ProductRequest) (*ProductResponse, error)
mustEmbedUnimplementedProductServer()
}
// UnimplementedProductServer must be embedded to have forward compatible implementations.
type UnimplementedProductServer struct {
}
func (UnimplementedProductServer) ProductInfo(context.Context, *ProductRequest) (*ProductResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProductInfo 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_ProductInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServer).ProductInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Product/ProductInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServer).ProductInfo(ctx, req.(*ProductRequest))
}
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: "ProductInfo",
Handler: _Product_ProductInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "protobufs/product.proto",
}