Documentation ¶
Overview ¶
Package warehouse_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterWarehouseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WarehouseServiceClient) error
- func RegisterWarehouseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WarehouseServiceServer) error
- func RegisterWarehouseServiceServer(s grpc.ServiceRegistrar, srv WarehouseServiceServer)
- type ProductStock
- func (*ProductStock) Descriptor() ([]byte, []int)deprecated
- func (x *ProductStock) GetProductId() string
- func (x *ProductStock) GetQuantity() int32
- func (*ProductStock) ProtoMessage()
- func (x *ProductStock) ProtoReflect() protoreflect.Message
- func (x *ProductStock) Reset()
- func (x *ProductStock) String() string
- type Reservation
- func (*Reservation) Descriptor() ([]byte, []int)deprecated
- func (x *Reservation) GetCreatedAt() int64
- func (x *Reservation) GetId() string
- func (x *Reservation) GetOrderId() string
- func (x *Reservation) GetReservedStock() []*ReservationStock
- func (*Reservation) ProtoMessage()
- func (x *Reservation) ProtoReflect() protoreflect.Message
- func (x *Reservation) Reset()
- func (x *Reservation) String() string
- type ReservationStock
- func (*ReservationStock) Descriptor() ([]byte, []int)deprecated
- func (x *ReservationStock) GetProductId() string
- func (x *ReservationStock) GetQuantity() int32
- func (*ReservationStock) ProtoMessage()
- func (x *ReservationStock) ProtoReflect() protoreflect.Message
- func (x *ReservationStock) Reset()
- func (x *ReservationStock) String() string
- type UnimplementedWarehouseServiceServer
- func (UnimplementedWarehouseServiceServer) ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error)
- func (UnimplementedWarehouseServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
- func (UnimplementedWarehouseServiceServer) ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error)
- func (UnimplementedWarehouseServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
- func (UnimplementedWarehouseServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
- func (UnimplementedWarehouseServiceServer) ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error)
- func (UnimplementedWarehouseServiceServer) ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error)
- type UnsafeWarehouseServiceServer
- type ViewProductStockRequest
- func (*ViewProductStockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ViewProductStockRequest) GetProductId() string
- func (*ViewProductStockRequest) ProtoMessage()
- func (x *ViewProductStockRequest) ProtoReflect() protoreflect.Message
- func (x *ViewProductStockRequest) Reset()
- func (x *ViewProductStockRequest) String() string
- type ViewProductStockResponse
- func (*ViewProductStockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ViewProductStockResponse) GetStock() *ProductStock
- func (*ViewProductStockResponse) ProtoMessage()
- func (x *ViewProductStockResponse) ProtoReflect() protoreflect.Message
- func (x *ViewProductStockResponse) Reset()
- func (x *ViewProductStockResponse) String() string
- type ViewReservationRequest
- func (*ViewReservationRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ViewReservationRequest) GetReservationId() string
- func (*ViewReservationRequest) ProtoMessage()
- func (x *ViewReservationRequest) ProtoReflect() protoreflect.Message
- func (x *ViewReservationRequest) Reset()
- func (x *ViewReservationRequest) String() string
- type ViewReservationResponse
- func (*ViewReservationResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ViewReservationResponse) GetReservation() *Reservation
- func (*ViewReservationResponse) ProtoMessage()
- func (x *ViewReservationResponse) ProtoReflect() protoreflect.Message
- func (x *ViewReservationResponse) Reset()
- func (x *ViewReservationResponse) String() string
- type WarehouseServiceClient
- type WarehouseServiceServer
Constants ¶
const ( WarehouseService_ServiceInfo_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ServiceInfo" WarehouseService_ViewProductStock_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ViewProductStock" WarehouseService_ViewReservation_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ViewReservation" WarehouseService_ProcessProductCreatedEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessProductCreatedEvent" WarehouseService_ProcessOrderPendingEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessOrderPendingEvent" WarehouseService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessShipmentAllocationEvent" WarehouseService_ProcessPaymentProcessedEvent_FullMethodName = "/stocklet.warehouse.v1.WarehouseService/ProcessPaymentProcessedEvent" )
Variables ¶
var File_stocklet_warehouse_v1_service_proto protoreflect.FileDescriptor
var File_stocklet_warehouse_v1_types_proto protoreflect.FileDescriptor
var WarehouseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "stocklet.warehouse.v1.WarehouseService", HandlerType: (*WarehouseServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ServiceInfo", Handler: _WarehouseService_ServiceInfo_Handler, }, { MethodName: "ViewProductStock", Handler: _WarehouseService_ViewProductStock_Handler, }, { MethodName: "ViewReservation", Handler: _WarehouseService_ViewReservation_Handler, }, { MethodName: "ProcessProductCreatedEvent", Handler: _WarehouseService_ProcessProductCreatedEvent_Handler, }, { MethodName: "ProcessOrderPendingEvent", Handler: _WarehouseService_ProcessOrderPendingEvent_Handler, }, { MethodName: "ProcessShipmentAllocationEvent", Handler: _WarehouseService_ProcessShipmentAllocationEvent_Handler, }, { MethodName: "ProcessPaymentProcessedEvent", Handler: _WarehouseService_ProcessPaymentProcessedEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "stocklet/warehouse/v1/service.proto", }
WarehouseService_ServiceDesc is the grpc.ServiceDesc for WarehouseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWarehouseServiceHandler ¶
func RegisterWarehouseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWarehouseServiceHandler registers the http handlers for service WarehouseService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWarehouseServiceHandlerClient ¶
func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WarehouseServiceClient) error
RegisterWarehouseServiceHandlerClient registers the http handlers for service WarehouseService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WarehouseServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WarehouseServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WarehouseServiceClient" to call the correct interceptors.
func RegisterWarehouseServiceHandlerFromEndpoint ¶
func RegisterWarehouseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWarehouseServiceHandlerFromEndpoint is same as RegisterWarehouseServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWarehouseServiceHandlerServer ¶
func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WarehouseServiceServer) error
RegisterWarehouseServiceHandlerServer registers the http handlers for service WarehouseService to "mux". UnaryRPC :call WarehouseServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWarehouseServiceHandlerFromEndpoint instead.
func RegisterWarehouseServiceServer ¶
func RegisterWarehouseServiceServer(s grpc.ServiceRegistrar, srv WarehouseServiceServer)
Types ¶
type ProductStock ¶
type ProductStock struct { ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*ProductStock) Descriptor
deprecated
func (*ProductStock) Descriptor() ([]byte, []int)
Deprecated: Use ProductStock.ProtoReflect.Descriptor instead.
func (*ProductStock) GetProductId ¶
func (x *ProductStock) GetProductId() string
func (*ProductStock) GetQuantity ¶
func (x *ProductStock) GetQuantity() int32
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 Reservation ¶
type Reservation struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` ReservedStock []*ReservationStock `protobuf:"bytes,3,rep,name=reserved_stock,json=reservedStock,proto3" json:"reserved_stock,omitempty"` CreatedAt int64 `protobuf:"varint,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*Reservation) Descriptor
deprecated
func (*Reservation) Descriptor() ([]byte, []int)
Deprecated: Use Reservation.ProtoReflect.Descriptor instead.
func (*Reservation) GetCreatedAt ¶
func (x *Reservation) GetCreatedAt() int64
func (*Reservation) GetId ¶
func (x *Reservation) GetId() string
func (*Reservation) GetOrderId ¶
func (x *Reservation) GetOrderId() string
func (*Reservation) GetReservedStock ¶
func (x *Reservation) GetReservedStock() []*ReservationStock
func (*Reservation) ProtoMessage ¶
func (*Reservation) ProtoMessage()
func (*Reservation) ProtoReflect ¶
func (x *Reservation) ProtoReflect() protoreflect.Message
func (*Reservation) Reset ¶
func (x *Reservation) Reset()
func (*Reservation) String ¶
func (x *Reservation) String() string
type ReservationStock ¶
type ReservationStock struct { ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*ReservationStock) Descriptor
deprecated
func (*ReservationStock) Descriptor() ([]byte, []int)
Deprecated: Use ReservationStock.ProtoReflect.Descriptor instead.
func (*ReservationStock) GetProductId ¶
func (x *ReservationStock) GetProductId() string
func (*ReservationStock) GetQuantity ¶
func (x *ReservationStock) GetQuantity() int32
func (*ReservationStock) ProtoMessage ¶
func (*ReservationStock) ProtoMessage()
func (*ReservationStock) ProtoReflect ¶
func (x *ReservationStock) ProtoReflect() protoreflect.Message
func (*ReservationStock) Reset ¶
func (x *ReservationStock) Reset()
func (*ReservationStock) String ¶
func (x *ReservationStock) String() string
type UnimplementedWarehouseServiceServer ¶
type UnimplementedWarehouseServiceServer struct { }
UnimplementedWarehouseServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedWarehouseServiceServer) ProcessOrderPendingEvent ¶
func (UnimplementedWarehouseServiceServer) ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error)
func (UnimplementedWarehouseServiceServer) ProcessPaymentProcessedEvent ¶
func (UnimplementedWarehouseServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
func (UnimplementedWarehouseServiceServer) ProcessProductCreatedEvent ¶
func (UnimplementedWarehouseServiceServer) ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error)
func (UnimplementedWarehouseServiceServer) ProcessShipmentAllocationEvent ¶
func (UnimplementedWarehouseServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
func (UnimplementedWarehouseServiceServer) ServiceInfo ¶
func (UnimplementedWarehouseServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
func (UnimplementedWarehouseServiceServer) ViewProductStock ¶
func (UnimplementedWarehouseServiceServer) ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error)
func (UnimplementedWarehouseServiceServer) ViewReservation ¶
func (UnimplementedWarehouseServiceServer) ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error)
type UnsafeWarehouseServiceServer ¶
type UnsafeWarehouseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWarehouseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WarehouseServiceServer will result in compilation errors.
type ViewProductStockRequest ¶
type ViewProductStockRequest struct { ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` // contains filtered or unexported fields }
func (*ViewProductStockRequest) Descriptor
deprecated
func (*ViewProductStockRequest) Descriptor() ([]byte, []int)
Deprecated: Use ViewProductStockRequest.ProtoReflect.Descriptor instead.
func (*ViewProductStockRequest) GetProductId ¶
func (x *ViewProductStockRequest) GetProductId() string
func (*ViewProductStockRequest) ProtoMessage ¶
func (*ViewProductStockRequest) ProtoMessage()
func (*ViewProductStockRequest) ProtoReflect ¶
func (x *ViewProductStockRequest) ProtoReflect() protoreflect.Message
func (*ViewProductStockRequest) Reset ¶
func (x *ViewProductStockRequest) Reset()
func (*ViewProductStockRequest) String ¶
func (x *ViewProductStockRequest) String() string
type ViewProductStockResponse ¶
type ViewProductStockResponse struct { Stock *ProductStock `protobuf:"bytes,1,opt,name=stock,proto3" json:"stock,omitempty"` // contains filtered or unexported fields }
func (*ViewProductStockResponse) Descriptor
deprecated
func (*ViewProductStockResponse) Descriptor() ([]byte, []int)
Deprecated: Use ViewProductStockResponse.ProtoReflect.Descriptor instead.
func (*ViewProductStockResponse) GetStock ¶
func (x *ViewProductStockResponse) GetStock() *ProductStock
func (*ViewProductStockResponse) ProtoMessage ¶
func (*ViewProductStockResponse) ProtoMessage()
func (*ViewProductStockResponse) ProtoReflect ¶
func (x *ViewProductStockResponse) ProtoReflect() protoreflect.Message
func (*ViewProductStockResponse) Reset ¶
func (x *ViewProductStockResponse) Reset()
func (*ViewProductStockResponse) String ¶
func (x *ViewProductStockResponse) String() string
type ViewReservationRequest ¶
type ViewReservationRequest struct { ReservationId string `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` // contains filtered or unexported fields }
func (*ViewReservationRequest) Descriptor
deprecated
func (*ViewReservationRequest) Descriptor() ([]byte, []int)
Deprecated: Use ViewReservationRequest.ProtoReflect.Descriptor instead.
func (*ViewReservationRequest) GetReservationId ¶
func (x *ViewReservationRequest) GetReservationId() string
func (*ViewReservationRequest) ProtoMessage ¶
func (*ViewReservationRequest) ProtoMessage()
func (*ViewReservationRequest) ProtoReflect ¶
func (x *ViewReservationRequest) ProtoReflect() protoreflect.Message
func (*ViewReservationRequest) Reset ¶
func (x *ViewReservationRequest) Reset()
func (*ViewReservationRequest) String ¶
func (x *ViewReservationRequest) String() string
type ViewReservationResponse ¶
type ViewReservationResponse struct { Reservation *Reservation `protobuf:"bytes,1,opt,name=reservation,proto3" json:"reservation,omitempty"` // contains filtered or unexported fields }
func (*ViewReservationResponse) Descriptor
deprecated
func (*ViewReservationResponse) Descriptor() ([]byte, []int)
Deprecated: Use ViewReservationResponse.ProtoReflect.Descriptor instead.
func (*ViewReservationResponse) GetReservation ¶
func (x *ViewReservationResponse) GetReservation() *Reservation
func (*ViewReservationResponse) ProtoMessage ¶
func (*ViewReservationResponse) ProtoMessage()
func (*ViewReservationResponse) ProtoReflect ¶
func (x *ViewReservationResponse) ProtoReflect() protoreflect.Message
func (*ViewReservationResponse) Reset ¶
func (x *ViewReservationResponse) Reset()
func (*ViewReservationResponse) String ¶
func (x *ViewReservationResponse) String() string
type WarehouseServiceClient ¶
type WarehouseServiceClient interface { // View information about the service. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) ViewProductStock(ctx context.Context, in *ViewProductStockRequest, opts ...grpc.CallOption) (*ViewProductStockResponse, error) ViewReservation(ctx context.Context, in *ViewReservationRequest, opts ...grpc.CallOption) (*ViewReservationResponse, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessProductCreatedEvent(ctx context.Context, in *v11.ProductCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessOrderPendingEvent(ctx context.Context, in *v11.OrderPendingEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) }
WarehouseServiceClient is the client API for WarehouseService 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 NewWarehouseServiceClient ¶
func NewWarehouseServiceClient(cc grpc.ClientConnInterface) WarehouseServiceClient
type WarehouseServiceServer ¶
type WarehouseServiceServer interface { // View information about the service. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) ViewProductStock(context.Context, *ViewProductStockRequest) (*ViewProductStockResponse, error) ViewReservation(context.Context, *ViewReservationRequest) (*ViewReservationResponse, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessProductCreatedEvent(context.Context, *v11.ProductCreatedEvent) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessOrderPendingEvent(context.Context, *v11.OrderPendingEvent) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) // contains filtered or unexported methods }
WarehouseServiceServer is the server API for WarehouseService service. All implementations must embed UnimplementedWarehouseServiceServer for forward compatibility