inventorypb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Inventory_ReserveStock_FullMethodName = "/inventory.v1.Inventory/ReserveStock"
)

Variables

View Source
var File_inventory_proto protoreflect.FileDescriptor
View Source
var Inventory_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "inventory.v1.Inventory",
	HandlerType: (*InventoryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReserveStock",
			Handler:    _Inventory_ReserveStock_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "inventory.proto",
}

Inventory_ServiceDesc is the grpc.ServiceDesc for Inventory service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterInventoryServer

func RegisterInventoryServer(s grpc.ServiceRegistrar, srv InventoryServer)

Types

type InventoryClient

type InventoryClient interface {
	ReserveStock(ctx context.Context, in *ReserveStockRequest, opts ...grpc.CallOption) (*ReserveStockResponse, error)
}

InventoryClient is the client API for Inventory 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 NewInventoryClient

func NewInventoryClient(cc grpc.ClientConnInterface) InventoryClient

type InventoryServer

type InventoryServer interface {
	ReserveStock(context.Context, *ReserveStockRequest) (*ReserveStockResponse, error)
	// contains filtered or unexported methods
}

InventoryServer is the server API for Inventory service. All implementations must embed UnimplementedInventoryServer for forward compatibility.

type ReserveStockRequest

type ReserveStockRequest struct {
	ItemId   string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	Quantity int32  `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

func (*ReserveStockRequest) Descriptor deprecated

func (*ReserveStockRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReserveStockRequest.ProtoReflect.Descriptor instead.

func (*ReserveStockRequest) GetItemId

func (x *ReserveStockRequest) GetItemId() string

func (*ReserveStockRequest) GetQuantity

func (x *ReserveStockRequest) GetQuantity() int32

func (*ReserveStockRequest) ProtoMessage

func (*ReserveStockRequest) ProtoMessage()

func (*ReserveStockRequest) ProtoReflect

func (x *ReserveStockRequest) ProtoReflect() protoreflect.Message

func (*ReserveStockRequest) Reset

func (x *ReserveStockRequest) Reset()

func (*ReserveStockRequest) String

func (x *ReserveStockRequest) String() string

type ReserveStockResponse

type ReserveStockResponse struct {
	ItemId    string `protobuf:"bytes,1,opt,name=item_id,json=itemId,proto3" json:"item_id,omitempty"`
	Remaining int32  `protobuf:"varint,2,opt,name=remaining,proto3" json:"remaining,omitempty"`
	// contains filtered or unexported fields
}

func (*ReserveStockResponse) Descriptor deprecated

func (*ReserveStockResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReserveStockResponse.ProtoReflect.Descriptor instead.

func (*ReserveStockResponse) GetItemId

func (x *ReserveStockResponse) GetItemId() string

func (*ReserveStockResponse) GetRemaining

func (x *ReserveStockResponse) GetRemaining() int32

func (*ReserveStockResponse) ProtoMessage

func (*ReserveStockResponse) ProtoMessage()

func (*ReserveStockResponse) ProtoReflect

func (x *ReserveStockResponse) ProtoReflect() protoreflect.Message

func (*ReserveStockResponse) Reset

func (x *ReserveStockResponse) Reset()

func (*ReserveStockResponse) String

func (x *ReserveStockResponse) String() string

type UnimplementedInventoryServer

type UnimplementedInventoryServer struct{}

UnimplementedInventoryServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedInventoryServer) ReserveStock

type UnsafeInventoryServer

type UnsafeInventoryServer interface {
	// contains filtered or unexported methods
}

UnsafeInventoryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InventoryServer will result in compilation errors.

Jump to

Keyboard shortcuts

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