Documentation ¶
Index ¶
- Variables
- func RegisterInventoryServiceServer(s grpc.ServiceRegistrar, srv InventoryServiceServer)
- type CheckProductStockQuantityRequest
- func (*CheckProductStockQuantityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckProductStockQuantityRequest) GetProducts() []*ProductQuantity
- func (*CheckProductStockQuantityRequest) ProtoMessage()
- func (x *CheckProductStockQuantityRequest) ProtoReflect() protoreflect.Message
- func (x *CheckProductStockQuantityRequest) Reset()
- func (x *CheckProductStockQuantityRequest) String() string
- type CheckProductStockQuantityResponse
- func (*CheckProductStockQuantityResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckProductStockQuantityResponse) GetProducts() []*ProductStock
- func (*CheckProductStockQuantityResponse) ProtoMessage()
- func (x *CheckProductStockQuantityResponse) ProtoReflect() protoreflect.Message
- func (x *CheckProductStockQuantityResponse) Reset()
- func (x *CheckProductStockQuantityResponse) String() string
- type GetProductDetailsRequest
- func (*GetProductDetailsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetProductDetailsRequest) GetProductCodes() []string
- func (*GetProductDetailsRequest) ProtoMessage()
- func (x *GetProductDetailsRequest) ProtoReflect() protoreflect.Message
- func (x *GetProductDetailsRequest) Reset()
- func (x *GetProductDetailsRequest) String() string
- type GetProductDetailsResponse
- func (*GetProductDetailsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetProductDetailsResponse) GetProductDetails() []*ProductDetails
- func (*GetProductDetailsResponse) ProtoMessage()
- func (x *GetProductDetailsResponse) ProtoReflect() protoreflect.Message
- func (x *GetProductDetailsResponse) Reset()
- func (x *GetProductDetailsResponse) String() string
- type InventoryServiceClient
- type InventoryServiceServer
- type ProductDetails
- func (*ProductDetails) Descriptor() ([]byte, []int)deprecated
- func (x *ProductDetails) GetDescription() string
- func (x *ProductDetails) GetName() string
- func (x *ProductDetails) GetProductCode() string
- func (x *ProductDetails) GetUnitPriceCents() int32
- func (*ProductDetails) ProtoMessage()
- func (x *ProductDetails) ProtoReflect() protoreflect.Message
- func (x *ProductDetails) Reset()
- func (x *ProductDetails) String() string
- type ProductQuantity
- func (*ProductQuantity) Descriptor() ([]byte, []int)deprecated
- func (x *ProductQuantity) GetProductCode() string
- func (x *ProductQuantity) GetQuantity() int32
- func (*ProductQuantity) ProtoMessage()
- func (x *ProductQuantity) ProtoReflect() protoreflect.Message
- func (x *ProductQuantity) Reset()
- func (x *ProductQuantity) String() string
- type ProductStock
- func (*ProductStock) Descriptor() ([]byte, []int)deprecated
- func (x *ProductStock) GetAvailableQuantity() int32
- func (x *ProductStock) GetIsAvailable() bool
- func (x *ProductStock) GetProductCode() string
- func (*ProductStock) ProtoMessage()
- func (x *ProductStock) ProtoReflect() protoreflect.Message
- func (x *ProductStock) Reset()
- func (x *ProductStock) String() string
- type ReduceProductStockQuantityRequest
- func (*ReduceProductStockQuantityRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReduceProductStockQuantityRequest) GetProducts() []*ProductQuantity
- func (*ReduceProductStockQuantityRequest) ProtoMessage()
- func (x *ReduceProductStockQuantityRequest) ProtoReflect() protoreflect.Message
- func (x *ReduceProductStockQuantityRequest) Reset()
- func (x *ReduceProductStockQuantityRequest) String() string
- type ReduceProductStockQuantityResponse
- func (*ReduceProductStockQuantityResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReduceProductStockQuantityResponse) GetProducts() []*ProductStock
- func (*ReduceProductStockQuantityResponse) ProtoMessage()
- func (x *ReduceProductStockQuantityResponse) ProtoReflect() protoreflect.Message
- func (x *ReduceProductStockQuantityResponse) Reset()
- func (x *ReduceProductStockQuantityResponse) String() string
- type UnimplementedInventoryServiceServer
- func (UnimplementedInventoryServiceServer) CheckProductStockQuantity(context.Context, *CheckProductStockQuantityRequest) (*CheckProductStockQuantityResponse, error)
- func (UnimplementedInventoryServiceServer) GetProductDetails(context.Context, *GetProductDetailsRequest) (*GetProductDetailsResponse, error)
- func (UnimplementedInventoryServiceServer) ReduceProductStockQuantity(context.Context, *ReduceProductStockQuantityRequest) (*ReduceProductStockQuantityResponse, error)
- type UnsafeInventoryServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_def_inventory_inventory_proto protoreflect.FileDescriptor
var InventoryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "inventorypb.InventoryService", HandlerType: (*InventoryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetProductDetails", Handler: _InventoryService_GetProductDetails_Handler, }, { MethodName: "CheckProductStockQuantity", Handler: _InventoryService_CheckProductStockQuantity_Handler, }, { MethodName: "ReduceProductStockQuantity", Handler: _InventoryService_ReduceProductStockQuantity_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "def/inventory/inventory.proto", }
InventoryService_ServiceDesc is the grpc.ServiceDesc for InventoryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterInventoryServiceServer ¶
func RegisterInventoryServiceServer(s grpc.ServiceRegistrar, srv InventoryServiceServer)
Types ¶
type CheckProductStockQuantityRequest ¶
type CheckProductStockQuantityRequest struct { // The products whose stock quantities should be checked. Products []*ProductQuantity `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*CheckProductStockQuantityRequest) Descriptor
deprecated
func (*CheckProductStockQuantityRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckProductStockQuantityRequest.ProtoReflect.Descriptor instead.
func (*CheckProductStockQuantityRequest) GetProducts ¶
func (x *CheckProductStockQuantityRequest) GetProducts() []*ProductQuantity
func (*CheckProductStockQuantityRequest) ProtoMessage ¶
func (*CheckProductStockQuantityRequest) ProtoMessage()
func (*CheckProductStockQuantityRequest) ProtoReflect ¶
func (x *CheckProductStockQuantityRequest) ProtoReflect() protoreflect.Message
func (*CheckProductStockQuantityRequest) Reset ¶
func (x *CheckProductStockQuantityRequest) Reset()
func (*CheckProductStockQuantityRequest) String ¶
func (x *CheckProductStockQuantityRequest) String() string
type CheckProductStockQuantityResponse ¶
type CheckProductStockQuantityResponse struct { // The product stock quantity results. Products []*ProductStock `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*CheckProductStockQuantityResponse) Descriptor
deprecated
func (*CheckProductStockQuantityResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckProductStockQuantityResponse.ProtoReflect.Descriptor instead.
func (*CheckProductStockQuantityResponse) GetProducts ¶
func (x *CheckProductStockQuantityResponse) GetProducts() []*ProductStock
func (*CheckProductStockQuantityResponse) ProtoMessage ¶
func (*CheckProductStockQuantityResponse) ProtoMessage()
func (*CheckProductStockQuantityResponse) ProtoReflect ¶
func (x *CheckProductStockQuantityResponse) ProtoReflect() protoreflect.Message
func (*CheckProductStockQuantityResponse) Reset ¶
func (x *CheckProductStockQuantityResponse) Reset()
func (*CheckProductStockQuantityResponse) String ¶
func (x *CheckProductStockQuantityResponse) String() string
type GetProductDetailsRequest ¶
type GetProductDetailsRequest struct { // The codes of the products whose details should be returned. ProductCodes []string `protobuf:"bytes,1,rep,name=product_codes,json=productCodes,proto3" json:"product_codes,omitempty"` // contains filtered or unexported fields }
func (*GetProductDetailsRequest) Descriptor
deprecated
func (*GetProductDetailsRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetProductDetailsRequest.ProtoReflect.Descriptor instead.
func (*GetProductDetailsRequest) GetProductCodes ¶
func (x *GetProductDetailsRequest) GetProductCodes() []string
func (*GetProductDetailsRequest) ProtoMessage ¶
func (*GetProductDetailsRequest) ProtoMessage()
func (*GetProductDetailsRequest) ProtoReflect ¶
func (x *GetProductDetailsRequest) ProtoReflect() protoreflect.Message
func (*GetProductDetailsRequest) Reset ¶
func (x *GetProductDetailsRequest) Reset()
func (*GetProductDetailsRequest) String ¶
func (x *GetProductDetailsRequest) String() string
type GetProductDetailsResponse ¶
type GetProductDetailsResponse struct { // The returned product details. ProductDetails []*ProductDetails `protobuf:"bytes,1,rep,name=product_details,json=productDetails,proto3" json:"product_details,omitempty"` // contains filtered or unexported fields }
func (*GetProductDetailsResponse) Descriptor
deprecated
func (*GetProductDetailsResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetProductDetailsResponse.ProtoReflect.Descriptor instead.
func (*GetProductDetailsResponse) GetProductDetails ¶
func (x *GetProductDetailsResponse) GetProductDetails() []*ProductDetails
func (*GetProductDetailsResponse) ProtoMessage ¶
func (*GetProductDetailsResponse) ProtoMessage()
func (*GetProductDetailsResponse) ProtoReflect ¶
func (x *GetProductDetailsResponse) ProtoReflect() protoreflect.Message
func (*GetProductDetailsResponse) Reset ¶
func (x *GetProductDetailsResponse) Reset()
func (*GetProductDetailsResponse) String ¶
func (x *GetProductDetailsResponse) String() string
type InventoryServiceClient ¶
type InventoryServiceClient interface { GetProductDetails(ctx context.Context, in *GetProductDetailsRequest, opts ...grpc.CallOption) (*GetProductDetailsResponse, error) CheckProductStockQuantity(ctx context.Context, in *CheckProductStockQuantityRequest, opts ...grpc.CallOption) (*CheckProductStockQuantityResponse, error) ReduceProductStockQuantity(ctx context.Context, in *ReduceProductStockQuantityRequest, opts ...grpc.CallOption) (*ReduceProductStockQuantityResponse, error) }
InventoryServiceClient is the client API for InventoryService 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.
func NewInventoryServiceClient ¶
func NewInventoryServiceClient(cc grpc.ClientConnInterface) InventoryServiceClient
type InventoryServiceServer ¶
type InventoryServiceServer interface { GetProductDetails(context.Context, *GetProductDetailsRequest) (*GetProductDetailsResponse, error) CheckProductStockQuantity(context.Context, *CheckProductStockQuantityRequest) (*CheckProductStockQuantityResponse, error) ReduceProductStockQuantity(context.Context, *ReduceProductStockQuantityRequest) (*ReduceProductStockQuantityResponse, error) // contains filtered or unexported methods }
InventoryServiceServer is the server API for InventoryService service. All implementations must embed UnimplementedInventoryServiceServer for forward compatibility
type ProductDetails ¶
type ProductDetails struct { // The code that identifies the product. ProductCode string `protobuf:"bytes,1,opt,name=product_code,json=productCode,proto3" json:"product_code,omitempty"` // The name of the product. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // The description of the product. Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // The unit price of the product in cents. UnitPriceCents int32 `protobuf:"varint,4,opt,name=unit_price_cents,json=unitPriceCents,proto3" json:"unit_price_cents,omitempty"` // contains filtered or unexported fields }
func (*ProductDetails) Descriptor
deprecated
func (*ProductDetails) Descriptor() ([]byte, []int)
Deprecated: Use ProductDetails.ProtoReflect.Descriptor instead.
func (*ProductDetails) GetDescription ¶
func (x *ProductDetails) GetDescription() string
func (*ProductDetails) GetName ¶
func (x *ProductDetails) GetName() string
func (*ProductDetails) GetProductCode ¶
func (x *ProductDetails) GetProductCode() string
func (*ProductDetails) GetUnitPriceCents ¶
func (x *ProductDetails) GetUnitPriceCents() int32
func (*ProductDetails) ProtoMessage ¶
func (*ProductDetails) ProtoMessage()
func (*ProductDetails) ProtoReflect ¶
func (x *ProductDetails) ProtoReflect() protoreflect.Message
func (*ProductDetails) Reset ¶
func (x *ProductDetails) Reset()
func (*ProductDetails) String ¶
func (x *ProductDetails) String() string
type ProductQuantity ¶
type ProductQuantity struct { // The code of the product. ProductCode string `protobuf:"bytes,1,opt,name=product_code,json=productCode,proto3" json:"product_code,omitempty"` // The quantity of the product. Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*ProductQuantity) Descriptor
deprecated
func (*ProductQuantity) Descriptor() ([]byte, []int)
Deprecated: Use ProductQuantity.ProtoReflect.Descriptor instead.
func (*ProductQuantity) GetProductCode ¶
func (x *ProductQuantity) GetProductCode() string
func (*ProductQuantity) GetQuantity ¶
func (x *ProductQuantity) GetQuantity() int32
func (*ProductQuantity) ProtoMessage ¶
func (*ProductQuantity) ProtoMessage()
func (*ProductQuantity) ProtoReflect ¶
func (x *ProductQuantity) ProtoReflect() protoreflect.Message
func (*ProductQuantity) Reset ¶
func (x *ProductQuantity) Reset()
func (*ProductQuantity) String ¶
func (x *ProductQuantity) String() string
type ProductStock ¶
type ProductStock struct { // The code of the product. ProductCode string `protobuf:"bytes,1,opt,name=product_code,json=productCode,proto3" json:"product_code,omitempty"` // The available quantity of the product in stock. AvailableQuantity int32 `protobuf:"varint,2,opt,name=available_quantity,json=availableQuantity,proto3" json:"available_quantity,omitempty"` // True if there are enough units of the product in stock. Otherwise false. IsAvailable bool `protobuf:"varint,3,opt,name=is_available,json=isAvailable,proto3" json:"is_available,omitempty"` // contains filtered or unexported fields }
func (*ProductStock) Descriptor
deprecated
func (*ProductStock) Descriptor() ([]byte, []int)
Deprecated: Use ProductStock.ProtoReflect.Descriptor instead.
func (*ProductStock) GetAvailableQuantity ¶
func (x *ProductStock) GetAvailableQuantity() int32
func (*ProductStock) GetIsAvailable ¶
func (x *ProductStock) GetIsAvailable() bool
func (*ProductStock) GetProductCode ¶
func (x *ProductStock) GetProductCode() string
func (*ProductStock) ProtoMessage ¶
func (*ProductStock) ProtoMessage()
func (*ProductStock) ProtoReflect ¶
func (x *ProductStock) ProtoReflect() protoreflect.Message
func (*ProductStock) Reset ¶
func (x *ProductStock) Reset()
func (*ProductStock) String ¶
func (x *ProductStock) String() string
type ReduceProductStockQuantityRequest ¶
type ReduceProductStockQuantityRequest struct { // The products whose stock quantity should be reduced. Products []*ProductQuantity `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*ReduceProductStockQuantityRequest) Descriptor
deprecated
func (*ReduceProductStockQuantityRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReduceProductStockQuantityRequest.ProtoReflect.Descriptor instead.
func (*ReduceProductStockQuantityRequest) GetProducts ¶
func (x *ReduceProductStockQuantityRequest) GetProducts() []*ProductQuantity
func (*ReduceProductStockQuantityRequest) ProtoMessage ¶
func (*ReduceProductStockQuantityRequest) ProtoMessage()
func (*ReduceProductStockQuantityRequest) ProtoReflect ¶
func (x *ReduceProductStockQuantityRequest) ProtoReflect() protoreflect.Message
func (*ReduceProductStockQuantityRequest) Reset ¶
func (x *ReduceProductStockQuantityRequest) Reset()
func (*ReduceProductStockQuantityRequest) String ¶
func (x *ReduceProductStockQuantityRequest) String() string
type ReduceProductStockQuantityResponse ¶
type ReduceProductStockQuantityResponse struct { // The product stock quantity results after reducing the quantities. Products []*ProductStock `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*ReduceProductStockQuantityResponse) Descriptor
deprecated
func (*ReduceProductStockQuantityResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReduceProductStockQuantityResponse.ProtoReflect.Descriptor instead.
func (*ReduceProductStockQuantityResponse) GetProducts ¶
func (x *ReduceProductStockQuantityResponse) GetProducts() []*ProductStock
func (*ReduceProductStockQuantityResponse) ProtoMessage ¶
func (*ReduceProductStockQuantityResponse) ProtoMessage()
func (*ReduceProductStockQuantityResponse) ProtoReflect ¶
func (x *ReduceProductStockQuantityResponse) ProtoReflect() protoreflect.Message
func (*ReduceProductStockQuantityResponse) Reset ¶
func (x *ReduceProductStockQuantityResponse) Reset()
func (*ReduceProductStockQuantityResponse) String ¶
func (x *ReduceProductStockQuantityResponse) String() string
type UnimplementedInventoryServiceServer ¶
type UnimplementedInventoryServiceServer struct { }
UnimplementedInventoryServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedInventoryServiceServer) CheckProductStockQuantity ¶
func (UnimplementedInventoryServiceServer) CheckProductStockQuantity(context.Context, *CheckProductStockQuantityRequest) (*CheckProductStockQuantityResponse, error)
func (UnimplementedInventoryServiceServer) GetProductDetails ¶
func (UnimplementedInventoryServiceServer) GetProductDetails(context.Context, *GetProductDetailsRequest) (*GetProductDetailsResponse, error)
func (UnimplementedInventoryServiceServer) ReduceProductStockQuantity ¶
func (UnimplementedInventoryServiceServer) ReduceProductStockQuantity(context.Context, *ReduceProductStockQuantityRequest) (*ReduceProductStockQuantityResponse, error)
type UnsafeInventoryServiceServer ¶
type UnsafeInventoryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeInventoryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InventoryServiceServer will result in compilation errors.