order

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OrderStatus_name = map[int32]string{
		0: "ORDER_STATUS_COMPLETED",
		1: "ORDER_STATUS_CANCELLED",
		2: "ORDER_STATUS_IN_PROGRESS",
	}
	OrderStatus_value = map[string]int32{
		"ORDER_STATUS_COMPLETED":   0,
		"ORDER_STATUS_CANCELLED":   1,
		"ORDER_STATUS_IN_PROGRESS": 2,
	}
)

Enum value maps for OrderStatus.

View Source
var File_order_order_proto protoreflect.FileDescriptor
View Source
var OrderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "customer.OrderService",
	HandlerType: (*OrderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _OrderService_Create_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "order/order.proto",
}

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)

Functions

func RegisterOrderServiceServer

func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)

Types

type CreateRequest

type CreateRequest struct {
	SupplierId int32           `protobuf:"varint,1,opt,name=supplier_id,json=supplierId,proto3" json:"supplier_id,omitempty"`
	Products   []*ProductOrder `protobuf:"bytes,3,rep,name=products,proto3" json:"products,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetProducts

func (x *CreateRequest) GetProducts() []*ProductOrder

func (*CreateRequest) GetSupplierId

func (x *CreateRequest) GetSupplierId() int32

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId

func (x *CreateResponse) GetId() int32

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type Order

type Order struct {
	Id          int32                  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	SupplierId  int32                  `protobuf:"varint,2,opt,name=supplier_id,json=supplierId,proto3" json:"supplier_id,omitempty"`
	CreatedAt   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	Status      OrderStatus            `protobuf:"varint,4,opt,name=status,proto3,enum=customer.OrderStatus" json:"status,omitempty"`
	CompletedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=completed_at,json=completedAt,proto3,oneof" json:"completed_at,omitempty"`
	CanceledAt  *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=canceled_at,json=canceledAt,proto3,oneof" json:"canceled_at,omitempty"`
	// contains filtered or unexported fields
}

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetCanceledAt

func (x *Order) GetCanceledAt() *timestamppb.Timestamp

func (*Order) GetCompletedAt

func (x *Order) GetCompletedAt() *timestamppb.Timestamp

func (*Order) GetCreatedAt

func (x *Order) GetCreatedAt() *timestamppb.Timestamp

func (*Order) GetId

func (x *Order) GetId() int32

func (*Order) GetStatus

func (x *Order) GetStatus() OrderStatus

func (*Order) GetSupplierId

func (x *Order) GetSupplierId() int32

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

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

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type OrderServiceClient

type OrderServiceClient interface {
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
}

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 OrderServiceServer

type OrderServiceServer interface {
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// contains filtered or unexported methods
}

OrderServiceServer is the server API for OrderService service. All implementations must embed UnimplementedOrderServiceServer for forward compatibility

type OrderStatus

type OrderStatus int32
const (
	OrderStatus_ORDER_STATUS_COMPLETED   OrderStatus = 0
	OrderStatus_ORDER_STATUS_CANCELLED   OrderStatus = 1
	OrderStatus_ORDER_STATUS_IN_PROGRESS OrderStatus = 2
)

func (OrderStatus) Descriptor

func (OrderStatus) Enum

func (x OrderStatus) Enum() *OrderStatus

func (OrderStatus) EnumDescriptor deprecated

func (OrderStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use OrderStatus.Descriptor instead.

func (OrderStatus) Number

func (x OrderStatus) Number() protoreflect.EnumNumber

func (OrderStatus) String

func (x OrderStatus) String() string

func (OrderStatus) Type

type ProductOrder

type ProductOrder struct {
	Quantity int32            `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"`
	Price    *core.Money      `protobuf:"bytes,3,opt,name=price,proto3" json:"price,omitempty"`
	Product  *product.Product `protobuf:"bytes,4,opt,name=product,proto3" json:"product,omitempty"`
	// contains filtered or unexported fields
}

func (*ProductOrder) Descriptor deprecated

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

Deprecated: Use ProductOrder.ProtoReflect.Descriptor instead.

func (*ProductOrder) GetPrice

func (x *ProductOrder) GetPrice() *core.Money

func (*ProductOrder) GetProduct

func (x *ProductOrder) GetProduct() *product.Product

func (*ProductOrder) GetQuantity

func (x *ProductOrder) GetQuantity() int32

func (*ProductOrder) ProtoMessage

func (*ProductOrder) ProtoMessage()

func (*ProductOrder) ProtoReflect

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

func (*ProductOrder) Reset

func (x *ProductOrder) Reset()

func (*ProductOrder) String

func (x *ProductOrder) String() string

type UnimplementedOrderServiceServer

type UnimplementedOrderServiceServer struct {
}

UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOrderServiceServer) Create

type UnsafeOrderServiceServer

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

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.

Jump to

Keyboard shortcuts

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