Documentation ¶
Index ¶
- Variables
- func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetProducts() []*ProductOrder
- func (x *CreateRequest) GetSupplierId() int32
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type CreateResponse
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetCanceledAt() *timestamppb.Timestamp
- func (x *Order) GetCompletedAt() *timestamppb.Timestamp
- func (x *Order) GetCreatedAt() *timestamppb.Timestamp
- func (x *Order) GetId() int32
- func (x *Order) GetStatus() OrderStatus
- func (x *Order) GetSupplierId() int32
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) String() string
- type OrderServiceClient
- type OrderServiceServer
- type OrderStatus
- func (OrderStatus) Descriptor() protoreflect.EnumDescriptor
- func (x OrderStatus) Enum() *OrderStatus
- func (OrderStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x OrderStatus) Number() protoreflect.EnumNumber
- func (x OrderStatus) String() string
- func (OrderStatus) Type() protoreflect.EnumType
- type ProductOrder
- func (*ProductOrder) Descriptor() ([]byte, []int)deprecated
- func (x *ProductOrder) GetPrice() *core.Money
- func (x *ProductOrder) GetProduct() *product.Product
- func (x *ProductOrder) GetQuantity() int32
- func (*ProductOrder) ProtoMessage()
- func (x *ProductOrder) ProtoReflect() protoreflect.Message
- func (x *ProductOrder) Reset()
- func (x *ProductOrder) String() string
- type UnimplementedOrderServiceServer
- type UnsafeOrderServiceServer
Constants ¶
This section is empty.
Variables ¶
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.
var File_order_order_proto protoreflect.FileDescriptor
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) 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) GetStatus ¶
func (x *Order) GetStatus() OrderStatus
func (*Order) GetSupplierId ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
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.
func NewOrderServiceClient ¶
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient
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) Descriptor() protoreflect.EnumDescriptor
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 ¶
func (OrderStatus) Type() protoreflect.EnumType
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 ¶
func (UnimplementedOrderServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error)
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.