inventorypb

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_def_inventory_inventory_proto protoreflect.FileDescriptor
View Source
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 (*CheckProductStockQuantityRequest) ProtoMessage

func (*CheckProductStockQuantityRequest) ProtoMessage()

func (*CheckProductStockQuantityRequest) ProtoReflect

func (*CheckProductStockQuantityRequest) Reset

func (*CheckProductStockQuantityRequest) 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 (*CheckProductStockQuantityResponse) Reset

func (*CheckProductStockQuantityResponse) 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 (*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.

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 (*ReduceProductStockQuantityRequest) ProtoMessage

func (*ReduceProductStockQuantityRequest) ProtoMessage()

func (*ReduceProductStockQuantityRequest) ProtoReflect

func (*ReduceProductStockQuantityRequest) Reset

func (*ReduceProductStockQuantityRequest) 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 (*ReduceProductStockQuantityResponse) ProtoMessage

func (*ReduceProductStockQuantityResponse) ProtoMessage()

func (*ReduceProductStockQuantityResponse) ProtoReflect

func (*ReduceProductStockQuantityResponse) Reset

func (*ReduceProductStockQuantityResponse) String

type UnimplementedInventoryServiceServer

type UnimplementedInventoryServiceServer struct {
}

UnimplementedInventoryServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedInventoryServiceServer) GetProductDetails

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL