Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterProductInfoServer(s grpc.ServiceRegistrar, srv ProductInfoServer)
- type Empty
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetDescription() string
- func (x *Product) GetId() uint64
- func (x *Product) GetImage() string
- func (x *Product) GetName() string
- func (x *Product) GetPrice() float32
- func (x *Product) GetSku() string
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type ProductId
- type ProductInfoClient
- type ProductInfoServer
- type ProductList
- type UnimplementedProductInfoServer
- func (UnimplementedProductInfoServer) AddProduct(context.Context, *Product) (*ProductId, error)
- func (UnimplementedProductInfoServer) DeleteProduct(context.Context, *ProductId) (*Empty, error)
- func (UnimplementedProductInfoServer) GetProductInfo(context.Context, *ProductId) (*Product, error)
- func (UnimplementedProductInfoServer) GetProductList(context.Context, *Empty) (*ProductList, error)
- func (UnimplementedProductInfoServer) UpdateProduct(context.Context, *Product) (*Empty, error)
- type UnsafeProductInfoServer
Constants ¶
const ( ProductInfo_GetProductInfo_FullMethodName = "/product.ProductInfo/GetProductInfo" ProductInfo_GetProductList_FullMethodName = "/product.ProductInfo/GetProductList" ProductInfo_AddProduct_FullMethodName = "/product.ProductInfo/AddProduct" ProductInfo_UpdateProduct_FullMethodName = "/product.ProductInfo/UpdateProduct" ProductInfo_DeleteProduct_FullMethodName = "/product.ProductInfo/DeleteProduct" )
Variables ¶
var File_catalog_product_proto protoreflect.FileDescriptor
var ProductInfo_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.ProductInfo", HandlerType: (*ProductInfoServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetProductInfo", Handler: _ProductInfo_GetProductInfo_Handler, }, { MethodName: "GetProductList", Handler: _ProductInfo_GetProductList_Handler, }, { MethodName: "AddProduct", Handler: _ProductInfo_AddProduct_Handler, }, { MethodName: "UpdateProduct", Handler: _ProductInfo_UpdateProduct_Handler, }, { MethodName: "DeleteProduct", Handler: _ProductInfo_DeleteProduct_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "catalog/product.proto", }
ProductInfo_ServiceDesc is the grpc.ServiceDesc for ProductInfo service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProductInfoServer ¶
func RegisterProductInfoServer(s grpc.ServiceRegistrar, srv ProductInfoServer)
Types ¶
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Product ¶
type Product struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Sku string `protobuf:"bytes,3,opt,name=sku,proto3" json:"sku,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Price float32 `protobuf:"fixed32,5,opt,name=price,proto3" json:"price,omitempty"` Image string `protobuf:"bytes,6,opt,name=image,proto3" json:"image,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) GetDescription ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type ProductId ¶
type ProductId struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ProductId) Descriptor
deprecated
func (*ProductId) ProtoMessage ¶
func (*ProductId) ProtoMessage()
func (*ProductId) ProtoReflect ¶
func (x *ProductId) ProtoReflect() protoreflect.Message
type ProductInfoClient ¶
type ProductInfoClient interface { GetProductInfo(ctx context.Context, in *ProductId, opts ...grpc.CallOption) (*Product, error) GetProductList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ProductList, error) AddProduct(ctx context.Context, in *Product, opts ...grpc.CallOption) (*ProductId, error) UpdateProduct(ctx context.Context, in *Product, opts ...grpc.CallOption) (*Empty, error) DeleteProduct(ctx context.Context, in *ProductId, opts ...grpc.CallOption) (*Empty, error) }
ProductInfoClient is the client API for ProductInfo service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewProductInfoClient ¶
func NewProductInfoClient(cc grpc.ClientConnInterface) ProductInfoClient
type ProductInfoServer ¶
type ProductInfoServer interface { GetProductInfo(context.Context, *ProductId) (*Product, error) GetProductList(context.Context, *Empty) (*ProductList, error) AddProduct(context.Context, *Product) (*ProductId, error) UpdateProduct(context.Context, *Product) (*Empty, error) DeleteProduct(context.Context, *ProductId) (*Empty, error) // contains filtered or unexported methods }
ProductInfoServer is the server API for ProductInfo service. All implementations must embed UnimplementedProductInfoServer for forward compatibility
type ProductList ¶
type ProductList struct { Products map[uint64]*Product `` /* 158-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ProductList) Descriptor
deprecated
func (*ProductList) Descriptor() ([]byte, []int)
Deprecated: Use ProductList.ProtoReflect.Descriptor instead.
func (*ProductList) GetProducts ¶
func (x *ProductList) GetProducts() map[uint64]*Product
func (*ProductList) ProtoMessage ¶
func (*ProductList) ProtoMessage()
func (*ProductList) ProtoReflect ¶
func (x *ProductList) ProtoReflect() protoreflect.Message
func (*ProductList) Reset ¶
func (x *ProductList) Reset()
func (*ProductList) String ¶
func (x *ProductList) String() string
type UnimplementedProductInfoServer ¶
type UnimplementedProductInfoServer struct { }
UnimplementedProductInfoServer must be embedded to have forward compatible implementations.
func (UnimplementedProductInfoServer) AddProduct ¶
func (UnimplementedProductInfoServer) DeleteProduct ¶
func (UnimplementedProductInfoServer) GetProductInfo ¶
func (UnimplementedProductInfoServer) GetProductList ¶
func (UnimplementedProductInfoServer) GetProductList(context.Context, *Empty) (*ProductList, error)
func (UnimplementedProductInfoServer) UpdateProduct ¶
type UnsafeProductInfoServer ¶
type UnsafeProductInfoServer interface {
// contains filtered or unexported methods
}
UnsafeProductInfoServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductInfoServer will result in compilation errors.