You've already forked orderservice
init(grpc): added protoc generated code
This commit is contained in:
@@ -0,0 +1,652 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.36.10
|
||||||
|
// protoc v3.19.6
|
||||||
|
// source: api/proto/order.proto
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
import (
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
unsafe "unsafe"
|
||||||
|
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
type Order struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Item string `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"`
|
||||||
|
Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Order) Reset() {
|
||||||
|
*x = Order{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Order) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Order) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *Order) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[0]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use Order.ProtoReflect.Descriptor instead.
|
||||||
|
func (*Order) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Order) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Order) GetItem() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Item
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *Order) GetQuantity() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Quantity
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateOrderRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Item string `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
|
||||||
|
Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderRequest) Reset() {
|
||||||
|
*x = CreateOrderRequest{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CreateOrderRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[1]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CreateOrderRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderRequest) GetItem() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Item
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderRequest) GetQuantity() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Quantity
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateOrderResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderResponse) Reset() {
|
||||||
|
*x = CreateOrderResponse{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CreateOrderResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[2]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use CreateOrderResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CreateOrderResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CreateOrderResponse) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetOrderRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderRequest) Reset() {
|
||||||
|
*x = GetOrderRequest{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetOrderRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetOrderRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[3]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetOrderRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetOrderRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderRequest) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetOrderResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderResponse) Reset() {
|
||||||
|
*x = GetOrderResponse{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*GetOrderResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *GetOrderResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[4]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use GetOrderResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*GetOrderResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *GetOrderResponse) GetOrder() *Order {
|
||||||
|
if x != nil {
|
||||||
|
return x.Order
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateOrderRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Item string `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"`
|
||||||
|
Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) Reset() {
|
||||||
|
*x = UpdateOrderRequest{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateOrderRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[5]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateOrderRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateOrderRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) GetItem() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Item
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderRequest) GetQuantity() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Quantity
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateOrderResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderResponse) Reset() {
|
||||||
|
*x = UpdateOrderResponse{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[6]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*UpdateOrderResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *UpdateOrderResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[6]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use UpdateOrderResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*UpdateOrderResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{6}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *UpdateOrderResponse) GetOrder() *Order {
|
||||||
|
if x != nil {
|
||||||
|
return x.Order
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteOrderRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderRequest) Reset() {
|
||||||
|
*x = DeleteOrderRequest{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[7]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeleteOrderRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeleteOrderRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[7]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DeleteOrderRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeleteOrderRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{7}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderRequest) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteOrderResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderResponse) Reset() {
|
||||||
|
*x = DeleteOrderResponse{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[8]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DeleteOrderResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DeleteOrderResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[8]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DeleteOrderResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DeleteOrderResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{8}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DeleteOrderResponse) GetSuccess() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Success
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListOrdersRequest struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListOrdersRequest) Reset() {
|
||||||
|
*x = ListOrdersRequest{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[9]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListOrdersRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListOrdersRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListOrdersRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[9]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListOrdersRequest.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListOrdersRequest) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{9}
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListOrdersResponse struct {
|
||||||
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
|
Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListOrdersResponse) Reset() {
|
||||||
|
*x = ListOrdersResponse{}
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[10]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListOrdersResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ListOrdersResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ListOrdersResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_api_proto_order_proto_msgTypes[10]
|
||||||
|
if x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ListOrdersResponse.ProtoReflect.Descriptor instead.
|
||||||
|
func (*ListOrdersResponse) Descriptor() ([]byte, []int) {
|
||||||
|
return file_api_proto_order_proto_rawDescGZIP(), []int{10}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ListOrdersResponse) GetOrders() []*Order {
|
||||||
|
if x != nil {
|
||||||
|
return x.Orders
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_api_proto_order_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
const file_api_proto_order_proto_rawDesc = "" +
|
||||||
|
"\n" +
|
||||||
|
"\x15api/proto/order.proto\x12\x03api\"G\n" +
|
||||||
|
"\x05Order\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||||
|
"\x04item\x18\x02 \x01(\tR\x04item\x12\x1a\n" +
|
||||||
|
"\bquantity\x18\x03 \x01(\x05R\bquantity\"D\n" +
|
||||||
|
"\x12CreateOrderRequest\x12\x12\n" +
|
||||||
|
"\x04item\x18\x01 \x01(\tR\x04item\x12\x1a\n" +
|
||||||
|
"\bquantity\x18\x02 \x01(\x05R\bquantity\"%\n" +
|
||||||
|
"\x13CreateOrderResponse\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\"!\n" +
|
||||||
|
"\x0fGetOrderRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\"4\n" +
|
||||||
|
"\x10GetOrderResponse\x12 \n" +
|
||||||
|
"\x05order\x18\x01 \x01(\v2\n" +
|
||||||
|
".api.OrderR\x05order\"T\n" +
|
||||||
|
"\x12UpdateOrderRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" +
|
||||||
|
"\x04item\x18\x02 \x01(\tR\x04item\x12\x1a\n" +
|
||||||
|
"\bquantity\x18\x03 \x01(\x05R\bquantity\"7\n" +
|
||||||
|
"\x13UpdateOrderResponse\x12 \n" +
|
||||||
|
"\x05order\x18\x01 \x01(\v2\n" +
|
||||||
|
".api.OrderR\x05order\"$\n" +
|
||||||
|
"\x12DeleteOrderRequest\x12\x0e\n" +
|
||||||
|
"\x02id\x18\x01 \x01(\tR\x02id\"/\n" +
|
||||||
|
"\x13DeleteOrderResponse\x12\x18\n" +
|
||||||
|
"\asuccess\x18\x01 \x01(\bR\asuccess\"\x13\n" +
|
||||||
|
"\x11ListOrdersRequest\"8\n" +
|
||||||
|
"\x12ListOrdersResponse\x12\"\n" +
|
||||||
|
"\x06orders\x18\x01 \x03(\v2\n" +
|
||||||
|
".api.OrderR\x06orders2\xcc\x02\n" +
|
||||||
|
"\fOrderService\x12@\n" +
|
||||||
|
"\vCreateOrder\x12\x17.api.CreateOrderRequest\x1a\x18.api.CreateOrderResponse\x127\n" +
|
||||||
|
"\bGetOrder\x12\x14.api.GetOrderRequest\x1a\x15.api.GetOrderResponse\x12@\n" +
|
||||||
|
"\vUpdateOrder\x12\x17.api.UpdateOrderRequest\x1a\x18.api.UpdateOrderResponse\x12@\n" +
|
||||||
|
"\vDeleteOrder\x12\x17.api.DeleteOrderRequest\x1a\x18.api.DeleteOrderResponse\x12=\n" +
|
||||||
|
"\n" +
|
||||||
|
"ListOrders\x12\x16.api.ListOrdersRequest\x1a\x17.api.ListOrdersResponseB\x0eZ\fpkg/api/testb\x06proto3"
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_api_proto_order_proto_rawDescOnce sync.Once
|
||||||
|
file_api_proto_order_proto_rawDescData []byte
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_api_proto_order_proto_rawDescGZIP() []byte {
|
||||||
|
file_api_proto_order_proto_rawDescOnce.Do(func() {
|
||||||
|
file_api_proto_order_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_proto_order_proto_rawDesc), len(file_api_proto_order_proto_rawDesc)))
|
||||||
|
})
|
||||||
|
return file_api_proto_order_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_api_proto_order_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
|
||||||
|
var file_api_proto_order_proto_goTypes = []any{
|
||||||
|
(*Order)(nil), // 0: api.Order
|
||||||
|
(*CreateOrderRequest)(nil), // 1: api.CreateOrderRequest
|
||||||
|
(*CreateOrderResponse)(nil), // 2: api.CreateOrderResponse
|
||||||
|
(*GetOrderRequest)(nil), // 3: api.GetOrderRequest
|
||||||
|
(*GetOrderResponse)(nil), // 4: api.GetOrderResponse
|
||||||
|
(*UpdateOrderRequest)(nil), // 5: api.UpdateOrderRequest
|
||||||
|
(*UpdateOrderResponse)(nil), // 6: api.UpdateOrderResponse
|
||||||
|
(*DeleteOrderRequest)(nil), // 7: api.DeleteOrderRequest
|
||||||
|
(*DeleteOrderResponse)(nil), // 8: api.DeleteOrderResponse
|
||||||
|
(*ListOrdersRequest)(nil), // 9: api.ListOrdersRequest
|
||||||
|
(*ListOrdersResponse)(nil), // 10: api.ListOrdersResponse
|
||||||
|
}
|
||||||
|
var file_api_proto_order_proto_depIdxs = []int32{
|
||||||
|
0, // 0: api.GetOrderResponse.order:type_name -> api.Order
|
||||||
|
0, // 1: api.UpdateOrderResponse.order:type_name -> api.Order
|
||||||
|
0, // 2: api.ListOrdersResponse.orders:type_name -> api.Order
|
||||||
|
1, // 3: api.OrderService.CreateOrder:input_type -> api.CreateOrderRequest
|
||||||
|
3, // 4: api.OrderService.GetOrder:input_type -> api.GetOrderRequest
|
||||||
|
5, // 5: api.OrderService.UpdateOrder:input_type -> api.UpdateOrderRequest
|
||||||
|
7, // 6: api.OrderService.DeleteOrder:input_type -> api.DeleteOrderRequest
|
||||||
|
9, // 7: api.OrderService.ListOrders:input_type -> api.ListOrdersRequest
|
||||||
|
2, // 8: api.OrderService.CreateOrder:output_type -> api.CreateOrderResponse
|
||||||
|
4, // 9: api.OrderService.GetOrder:output_type -> api.GetOrderResponse
|
||||||
|
6, // 10: api.OrderService.UpdateOrder:output_type -> api.UpdateOrderResponse
|
||||||
|
8, // 11: api.OrderService.DeleteOrder:output_type -> api.DeleteOrderResponse
|
||||||
|
10, // 12: api.OrderService.ListOrders:output_type -> api.ListOrdersResponse
|
||||||
|
8, // [8:13] is the sub-list for method output_type
|
||||||
|
3, // [3:8] is the sub-list for method input_type
|
||||||
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
|
0, // [0:3] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_api_proto_order_proto_init() }
|
||||||
|
func file_api_proto_order_proto_init() {
|
||||||
|
if File_api_proto_order_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_proto_order_proto_rawDesc), len(file_api_proto_order_proto_rawDesc)),
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 11,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_api_proto_order_proto_goTypes,
|
||||||
|
DependencyIndexes: file_api_proto_order_proto_depIdxs,
|
||||||
|
MessageInfos: file_api_proto_order_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_api_proto_order_proto = out.File
|
||||||
|
file_api_proto_order_proto_goTypes = nil
|
||||||
|
file_api_proto_order_proto_depIdxs = nil
|
||||||
|
}
|
||||||
@@ -0,0 +1,274 @@
|
|||||||
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-grpc v1.5.1
|
||||||
|
// - protoc v3.19.6
|
||||||
|
// source: api/proto/order.proto
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
|
||||||
|
grpc "google.golang.org/grpc"
|
||||||
|
codes "google.golang.org/grpc/codes"
|
||||||
|
status "google.golang.org/grpc/status"
|
||||||
|
)
|
||||||
|
|
||||||
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
|
// is compatible with the grpc package it is being compiled against.
|
||||||
|
// Requires gRPC-Go v1.64.0 or later.
|
||||||
|
const _ = grpc.SupportPackageIsVersion9
|
||||||
|
|
||||||
|
const (
|
||||||
|
OrderService_CreateOrder_FullMethodName = "/api.OrderService/CreateOrder"
|
||||||
|
OrderService_GetOrder_FullMethodName = "/api.OrderService/GetOrder"
|
||||||
|
OrderService_UpdateOrder_FullMethodName = "/api.OrderService/UpdateOrder"
|
||||||
|
OrderService_DeleteOrder_FullMethodName = "/api.OrderService/DeleteOrder"
|
||||||
|
OrderService_ListOrders_FullMethodName = "/api.OrderService/ListOrders"
|
||||||
|
)
|
||||||
|
|
||||||
|
// OrderServiceClient is the client API for OrderService 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 OrderServiceClient interface {
|
||||||
|
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error)
|
||||||
|
GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error)
|
||||||
|
UpdateOrder(ctx context.Context, in *UpdateOrderRequest, opts ...grpc.CallOption) (*UpdateOrderResponse, error)
|
||||||
|
DeleteOrder(ctx context.Context, in *DeleteOrderRequest, opts ...grpc.CallOption) (*DeleteOrderResponse, error)
|
||||||
|
ListOrders(ctx context.Context, in *ListOrdersRequest, opts ...grpc.CallOption) (*ListOrdersResponse, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type orderServiceClient struct {
|
||||||
|
cc grpc.ClientConnInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient {
|
||||||
|
return &orderServiceClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *orderServiceClient) CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(CreateOrderResponse)
|
||||||
|
err := c.cc.Invoke(ctx, OrderService_CreateOrder_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *orderServiceClient) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*GetOrderResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(GetOrderResponse)
|
||||||
|
err := c.cc.Invoke(ctx, OrderService_GetOrder_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *orderServiceClient) UpdateOrder(ctx context.Context, in *UpdateOrderRequest, opts ...grpc.CallOption) (*UpdateOrderResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(UpdateOrderResponse)
|
||||||
|
err := c.cc.Invoke(ctx, OrderService_UpdateOrder_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *orderServiceClient) DeleteOrder(ctx context.Context, in *DeleteOrderRequest, opts ...grpc.CallOption) (*DeleteOrderResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(DeleteOrderResponse)
|
||||||
|
err := c.cc.Invoke(ctx, OrderService_DeleteOrder_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *orderServiceClient) ListOrders(ctx context.Context, in *ListOrdersRequest, opts ...grpc.CallOption) (*ListOrdersResponse, error) {
|
||||||
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||||
|
out := new(ListOrdersResponse)
|
||||||
|
err := c.cc.Invoke(ctx, OrderService_ListOrders_FullMethodName, in, out, cOpts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// OrderServiceServer is the server API for OrderService service.
|
||||||
|
// All implementations must embed UnimplementedOrderServiceServer
|
||||||
|
// for forward compatibility.
|
||||||
|
type OrderServiceServer interface {
|
||||||
|
CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
|
||||||
|
GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error)
|
||||||
|
UpdateOrder(context.Context, *UpdateOrderRequest) (*UpdateOrderResponse, error)
|
||||||
|
DeleteOrder(context.Context, *DeleteOrderRequest) (*DeleteOrderResponse, error)
|
||||||
|
ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error)
|
||||||
|
mustEmbedUnimplementedOrderServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedOrderServiceServer 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.
|
||||||
|
type UnimplementedOrderServiceServer struct{}
|
||||||
|
|
||||||
|
func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CreateOrder not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOrderServiceServer) GetOrder(context.Context, *GetOrderRequest) (*GetOrderResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetOrder not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOrderServiceServer) UpdateOrder(context.Context, *UpdateOrderRequest) (*UpdateOrderResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateOrder not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOrderServiceServer) DeleteOrder(context.Context, *DeleteOrderRequest) (*DeleteOrderResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteOrder not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOrderServiceServer) ListOrders(context.Context, *ListOrdersRequest) (*ListOrdersResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListOrders not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOrderServiceServer) mustEmbedUnimplementedOrderServiceServer() {}
|
||||||
|
func (UnimplementedOrderServiceServer) testEmbeddedByValue() {}
|
||||||
|
|
||||||
|
// UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to OrderServiceServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeOrderServiceServer interface {
|
||||||
|
mustEmbedUnimplementedOrderServiceServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer) {
|
||||||
|
// If the following call pancis, it indicates UnimplementedOrderServiceServer was
|
||||||
|
// embedded by pointer and is nil. This will cause panics if an
|
||||||
|
// unimplemented method is ever invoked, so we test this at initialization
|
||||||
|
// time to prevent it from happening at runtime later due to I/O.
|
||||||
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||||
|
t.testEmbeddedByValue()
|
||||||
|
}
|
||||||
|
s.RegisterService(&OrderService_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _OrderService_CreateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(CreateOrderRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OrderServiceServer).CreateOrder(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: OrderService_CreateOrder_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OrderServiceServer).CreateOrder(ctx, req.(*CreateOrderRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _OrderService_GetOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetOrderRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OrderServiceServer).GetOrder(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: OrderService_GetOrder_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OrderServiceServer).GetOrder(ctx, req.(*GetOrderRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _OrderService_UpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(UpdateOrderRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OrderServiceServer).UpdateOrder(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: OrderService_UpdateOrder_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OrderServiceServer).UpdateOrder(ctx, req.(*UpdateOrderRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _OrderService_DeleteOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteOrderRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OrderServiceServer).DeleteOrder(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: OrderService_DeleteOrder_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OrderServiceServer).DeleteOrder(ctx, req.(*DeleteOrderRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _OrderService_ListOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(ListOrdersRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OrderServiceServer).ListOrders(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: OrderService_ListOrders_FullMethodName,
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OrderServiceServer).ListOrders(ctx, req.(*ListOrdersRequest))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
// OrderService_ServiceDesc is the grpc.ServiceDesc for OrderService service.
|
||||||
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var OrderService_ServiceDesc = grpc.ServiceDesc{
|
||||||
|
ServiceName: "api.OrderService",
|
||||||
|
HandlerType: (*OrderServiceServer)(nil),
|
||||||
|
Methods: []grpc.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CreateOrder",
|
||||||
|
Handler: _OrderService_CreateOrder_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetOrder",
|
||||||
|
Handler: _OrderService_GetOrder_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "UpdateOrder",
|
||||||
|
Handler: _OrderService_UpdateOrder_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteOrder",
|
||||||
|
Handler: _OrderService_DeleteOrder_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListOrders",
|
||||||
|
Handler: _OrderService_ListOrders_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc.StreamDesc{},
|
||||||
|
Metadata: "api/proto/order.proto",
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user