Documentation ¶
Overview ¶
Package orderingpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterOrderingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterOrderingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderingServiceClient) error
- func RegisterOrderingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterOrderingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderingServiceServer) error
- func RegisterOrderingServiceServer(s grpc.ServiceRegistrar, srv OrderingServiceServer)
- type CancelOrderRequest
- type CancelOrderResponse
- type CompleteOrderRequest
- func (*CompleteOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CompleteOrderRequest) GetId() string
- func (x *CompleteOrderRequest) GetInvoiceId() string
- func (*CompleteOrderRequest) ProtoMessage()
- func (x *CompleteOrderRequest) ProtoReflect() protoreflect.Message
- func (x *CompleteOrderRequest) Reset()
- func (x *CompleteOrderRequest) String() string
- type CompleteOrderResponse
- type CreateOrderRequest
- func (*CreateOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderRequest) GetCustomerId() string
- func (x *CreateOrderRequest) GetItems() []*Item
- func (x *CreateOrderRequest) GetPaymentId() string
- func (*CreateOrderRequest) ProtoMessage()
- func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOrderRequest) Reset()
- func (x *CreateOrderRequest) String() string
- type CreateOrderResponse
- func (*CreateOrderResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderResponse) GetId() string
- func (*CreateOrderResponse) ProtoMessage()
- func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message
- func (x *CreateOrderResponse) Reset()
- func (x *CreateOrderResponse) String() string
- type GetOrderRequest
- type GetOrderResponse
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetPrice() float64
- func (x *Item) GetProductId() string
- func (x *Item) GetProductName() string
- func (x *Item) GetQuantity() int32
- func (x *Item) GetStoreId() string
- func (x *Item) GetStoreName() string
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetCustomerId() string
- func (x *Order) GetId() string
- func (x *Order) GetItems() []*Item
- func (x *Order) GetPaymentId() string
- func (x *Order) GetStatus() string
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) String() string
- type OrderingServiceClient
- type OrderingServiceServer
- type ReadyOrderRequest
- type ReadyOrderResponse
- type UnimplementedOrderingServiceServer
- func (UnimplementedOrderingServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error)
- func (UnimplementedOrderingServiceServer) CompleteOrder(context.Context, *CompleteOrderRequest) (*CompleteOrderResponse, error)
- func (UnimplementedOrderingServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
- func (UnimplementedOrderingServiceServer) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
- func (UnimplementedOrderingServiceServer) ReadyOrder(context.Context, *ReadyOrderRequest) (*ReadyOrderResponse, error)
- type UnsafeOrderingServiceServer
Constants ¶
const ( OrderingService_CreateOrder_FullMethodName = "/orderingpb.OrderingService/CreateOrder" OrderingService_GetOrder_FullMethodName = "/orderingpb.OrderingService/GetOrder" OrderingService_CancelOrder_FullMethodName = "/orderingpb.OrderingService/CancelOrder" OrderingService_ReadyOrder_FullMethodName = "/orderingpb.OrderingService/ReadyOrder" OrderingService_CompleteOrder_FullMethodName = "/orderingpb.OrderingService/CompleteOrder" )
Variables ¶
var File_orderingpb_api_proto protoreflect.FileDescriptor
var File_orderingpb_messages_proto protoreflect.FileDescriptor
var OrderingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "orderingpb.OrderingService", HandlerType: (*OrderingServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrder", Handler: _OrderingService_CreateOrder_Handler, }, { MethodName: "GetOrder", Handler: _OrderingService_GetOrder_Handler, }, { MethodName: "CancelOrder", Handler: _OrderingService_CancelOrder_Handler, }, { MethodName: "ReadyOrder", Handler: _OrderingService_ReadyOrder_Handler, }, { MethodName: "CompleteOrder", Handler: _OrderingService_CompleteOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "orderingpb/api.proto", }
OrderingService_ServiceDesc is the grpc.ServiceDesc for OrderingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterOrderingServiceHandler ¶
func RegisterOrderingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterOrderingServiceHandler registers the http handlers for service OrderingService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterOrderingServiceHandlerClient ¶
func RegisterOrderingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderingServiceClient) error
RegisterOrderingServiceHandlerClient registers the http handlers for service OrderingService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrderingServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrderingServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrderingServiceClient" to call the correct interceptors.
func RegisterOrderingServiceHandlerFromEndpoint ¶
func RegisterOrderingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterOrderingServiceHandlerFromEndpoint is same as RegisterOrderingServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOrderingServiceHandlerServer ¶
func RegisterOrderingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderingServiceServer) error
RegisterOrderingServiceHandlerServer registers the http handlers for service OrderingService to "mux". UnaryRPC :call OrderingServiceServer 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 RegisterOrderingServiceHandlerFromEndpoint instead.
func RegisterOrderingServiceServer ¶
func RegisterOrderingServiceServer(s grpc.ServiceRegistrar, srv OrderingServiceServer)
Types ¶
type CancelOrderRequest ¶
type CancelOrderRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CancelOrderRequest) Descriptor
deprecated
func (*CancelOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CancelOrderRequest.ProtoReflect.Descriptor instead.
func (*CancelOrderRequest) GetId ¶
func (x *CancelOrderRequest) GetId() string
func (*CancelOrderRequest) ProtoMessage ¶
func (*CancelOrderRequest) ProtoMessage()
func (*CancelOrderRequest) ProtoReflect ¶
func (x *CancelOrderRequest) ProtoReflect() protoreflect.Message
func (*CancelOrderRequest) Reset ¶
func (x *CancelOrderRequest) Reset()
func (*CancelOrderRequest) String ¶
func (x *CancelOrderRequest) String() string
type CancelOrderResponse ¶
type CancelOrderResponse struct {
// contains filtered or unexported fields
}
func (*CancelOrderResponse) Descriptor
deprecated
func (*CancelOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use CancelOrderResponse.ProtoReflect.Descriptor instead.
func (*CancelOrderResponse) ProtoMessage ¶
func (*CancelOrderResponse) ProtoMessage()
func (*CancelOrderResponse) ProtoReflect ¶
func (x *CancelOrderResponse) ProtoReflect() protoreflect.Message
func (*CancelOrderResponse) Reset ¶
func (x *CancelOrderResponse) Reset()
func (*CancelOrderResponse) String ¶
func (x *CancelOrderResponse) String() string
type CompleteOrderRequest ¶
type CompleteOrderRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` InvoiceId string `protobuf:"bytes,2,opt,name=invoice_id,json=invoiceId,proto3" json:"invoice_id,omitempty"` // contains filtered or unexported fields }
func (*CompleteOrderRequest) Descriptor
deprecated
func (*CompleteOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CompleteOrderRequest.ProtoReflect.Descriptor instead.
func (*CompleteOrderRequest) GetId ¶
func (x *CompleteOrderRequest) GetId() string
func (*CompleteOrderRequest) GetInvoiceId ¶
func (x *CompleteOrderRequest) GetInvoiceId() string
func (*CompleteOrderRequest) ProtoMessage ¶
func (*CompleteOrderRequest) ProtoMessage()
func (*CompleteOrderRequest) ProtoReflect ¶
func (x *CompleteOrderRequest) ProtoReflect() protoreflect.Message
func (*CompleteOrderRequest) Reset ¶
func (x *CompleteOrderRequest) Reset()
func (*CompleteOrderRequest) String ¶
func (x *CompleteOrderRequest) String() string
type CompleteOrderResponse ¶
type CompleteOrderResponse struct {
// contains filtered or unexported fields
}
func (*CompleteOrderResponse) Descriptor
deprecated
func (*CompleteOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use CompleteOrderResponse.ProtoReflect.Descriptor instead.
func (*CompleteOrderResponse) ProtoMessage ¶
func (*CompleteOrderResponse) ProtoMessage()
func (*CompleteOrderResponse) ProtoReflect ¶
func (x *CompleteOrderResponse) ProtoReflect() protoreflect.Message
func (*CompleteOrderResponse) Reset ¶
func (x *CompleteOrderResponse) Reset()
func (*CompleteOrderResponse) String ¶
func (x *CompleteOrderResponse) String() string
type CreateOrderRequest ¶
type CreateOrderRequest struct { Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` PaymentId string `protobuf:"bytes,3,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderRequest) Descriptor
deprecated
func (*CreateOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.
func (*CreateOrderRequest) GetCustomerId ¶
func (x *CreateOrderRequest) GetCustomerId() string
func (*CreateOrderRequest) GetItems ¶
func (x *CreateOrderRequest) GetItems() []*Item
func (*CreateOrderRequest) GetPaymentId ¶
func (x *CreateOrderRequest) GetPaymentId() string
func (*CreateOrderRequest) ProtoMessage ¶
func (*CreateOrderRequest) ProtoMessage()
func (*CreateOrderRequest) ProtoReflect ¶
func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
func (*CreateOrderRequest) Reset ¶
func (x *CreateOrderRequest) Reset()
func (*CreateOrderRequest) String ¶
func (x *CreateOrderRequest) String() string
type CreateOrderResponse ¶
type CreateOrderResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderResponse) Descriptor
deprecated
func (*CreateOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.
func (*CreateOrderResponse) GetId ¶
func (x *CreateOrderResponse) GetId() string
func (*CreateOrderResponse) ProtoMessage ¶
func (*CreateOrderResponse) ProtoMessage()
func (*CreateOrderResponse) ProtoReflect ¶
func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message
func (*CreateOrderResponse) Reset ¶
func (x *CreateOrderResponse) Reset()
func (*CreateOrderResponse) String ¶
func (x *CreateOrderResponse) String() string
type GetOrderRequest ¶
type GetOrderRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetOrderRequest) Descriptor
deprecated
func (*GetOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.
func (*GetOrderRequest) GetId ¶
func (x *GetOrderRequest) GetId() string
func (*GetOrderRequest) ProtoMessage ¶
func (*GetOrderRequest) ProtoMessage()
func (*GetOrderRequest) ProtoReflect ¶
func (x *GetOrderRequest) ProtoReflect() protoreflect.Message
func (*GetOrderRequest) Reset ¶
func (x *GetOrderRequest) Reset()
func (*GetOrderRequest) String ¶
func (x *GetOrderRequest) String() string
type GetOrderResponse ¶
type GetOrderResponse struct { Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"` // contains filtered or unexported fields }
func (*GetOrderResponse) Descriptor
deprecated
func (*GetOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetOrderResponse.ProtoReflect.Descriptor instead.
func (*GetOrderResponse) GetOrder ¶
func (x *GetOrderResponse) GetOrder() *Order
func (*GetOrderResponse) ProtoMessage ¶
func (*GetOrderResponse) ProtoMessage()
func (*GetOrderResponse) ProtoReflect ¶
func (x *GetOrderResponse) ProtoReflect() protoreflect.Message
func (*GetOrderResponse) Reset ¶
func (x *GetOrderResponse) Reset()
func (*GetOrderResponse) String ¶
func (x *GetOrderResponse) String() string
type Item ¶
type Item struct { StoreId string `protobuf:"bytes,1,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` StoreName string `protobuf:"bytes,3,opt,name=store_name,json=storeName,proto3" json:"store_name,omitempty"` ProductName string `protobuf:"bytes,4,opt,name=product_name,json=productName,proto3" json:"product_name,omitempty"` Price float64 `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` Quantity int32 `protobuf:"varint,6,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*Item) Descriptor
deprecated
func (*Item) GetProductId ¶
func (*Item) GetProductName ¶
func (*Item) GetQuantity ¶
func (*Item) GetStoreId ¶
func (*Item) GetStoreName ¶
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type Order ¶
type Order struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` PaymentId string `protobuf:"bytes,3,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` Items []*Item `protobuf:"bytes,4,rep,name=items,proto3" json:"items,omitempty"` Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) GetCustomerId ¶
func (*Order) GetPaymentId ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
type OrderingServiceClient ¶
type OrderingServiceClient interface { CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*CancelOrderResponse, error) ReadyOrder(ctx context.Context, in *ReadyOrderRequest, opts ...grpc.CallOption) (*ReadyOrderResponse, error) CompleteOrder(ctx context.Context, in *CompleteOrderRequest, opts ...grpc.CallOption) (*CompleteOrderResponse, error) }
OrderingServiceClient is the client API for OrderingService 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 NewOrderingServiceClient ¶
func NewOrderingServiceClient(cc grpc.ClientConnInterface) OrderingServiceClient
type OrderingServiceServer ¶
type OrderingServiceServer interface { CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error) ReadyOrder(context.Context, *ReadyOrderRequest) (*ReadyOrderResponse, error) CompleteOrder(context.Context, *CompleteOrderRequest) (*CompleteOrderResponse, error) // contains filtered or unexported methods }
OrderingServiceServer is the server API for OrderingService service. All implementations must embed UnimplementedOrderingServiceServer for forward compatibility
type ReadyOrderRequest ¶
type ReadyOrderRequest struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ReadyOrderRequest) Descriptor
deprecated
func (*ReadyOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadyOrderRequest.ProtoReflect.Descriptor instead.
func (*ReadyOrderRequest) GetId ¶
func (x *ReadyOrderRequest) GetId() string
func (*ReadyOrderRequest) ProtoMessage ¶
func (*ReadyOrderRequest) ProtoMessage()
func (*ReadyOrderRequest) ProtoReflect ¶
func (x *ReadyOrderRequest) ProtoReflect() protoreflect.Message
func (*ReadyOrderRequest) Reset ¶
func (x *ReadyOrderRequest) Reset()
func (*ReadyOrderRequest) String ¶
func (x *ReadyOrderRequest) String() string
type ReadyOrderResponse ¶
type ReadyOrderResponse struct {
// contains filtered or unexported fields
}
func (*ReadyOrderResponse) Descriptor
deprecated
func (*ReadyOrderResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadyOrderResponse.ProtoReflect.Descriptor instead.
func (*ReadyOrderResponse) ProtoMessage ¶
func (*ReadyOrderResponse) ProtoMessage()
func (*ReadyOrderResponse) ProtoReflect ¶
func (x *ReadyOrderResponse) ProtoReflect() protoreflect.Message
func (*ReadyOrderResponse) Reset ¶
func (x *ReadyOrderResponse) Reset()
func (*ReadyOrderResponse) String ¶
func (x *ReadyOrderResponse) String() string
type UnimplementedOrderingServiceServer ¶
type UnimplementedOrderingServiceServer struct { }
UnimplementedOrderingServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOrderingServiceServer) CancelOrder ¶
func (UnimplementedOrderingServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error)
func (UnimplementedOrderingServiceServer) CompleteOrder ¶
func (UnimplementedOrderingServiceServer) CompleteOrder(context.Context, *CompleteOrderRequest) (*CompleteOrderResponse, error)
func (UnimplementedOrderingServiceServer) CreateOrder ¶
func (UnimplementedOrderingServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
func (UnimplementedOrderingServiceServer) GetOrder ¶
func (UnimplementedOrderingServiceServer) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
func (UnimplementedOrderingServiceServer) ReadyOrder ¶
func (UnimplementedOrderingServiceServer) ReadyOrder(context.Context, *ReadyOrderRequest) (*ReadyOrderResponse, error)
type UnsafeOrderingServiceServer ¶
type UnsafeOrderingServiceServer interface {
// contains filtered or unexported methods
}
UnsafeOrderingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrderingServiceServer will result in compilation errors.