Documentation ¶
Index ¶
- Variables
- func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)
- type CreateOrderRequest
- func (*CreateOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderRequest) GetCustomerId() string
- func (x *CreateOrderRequest) GetOrderProducts() []*OrderProduct
- func (*CreateOrderRequest) ProtoMessage()
- func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOrderRequest) Reset()
- func (x *CreateOrderRequest) String() string
- type Order
- func (*Order) Descriptor() ([]byte, []int)deprecated
- func (x *Order) GetCustomerId() string
- func (x *Order) GetId() string
- func (x *Order) GetProducts() []*Product
- func (x *Order) GetStatus() string
- func (*Order) ProtoMessage()
- func (x *Order) ProtoReflect() protoreflect.Message
- func (x *Order) Reset()
- func (x *Order) String() string
- type OrderProduct
- func (*OrderProduct) Descriptor() ([]byte, []int)deprecated
- func (x *OrderProduct) GetProductId() string
- func (x *OrderProduct) GetQuantity() int32
- func (*OrderProduct) ProtoMessage()
- func (x *OrderProduct) ProtoReflect() protoreflect.Message
- func (x *OrderProduct) Reset()
- func (x *OrderProduct) String() string
- type OrderServiceClient
- type OrderServiceServer
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetId() string
- func (x *Product) GetName() string
- func (x *Product) GetPriceId() string
- func (x *Product) GetQuantity() int32
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type UnimplementedOrderServiceServer
- type UnsafeOrderServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_api_micro_proto protoreflect.FileDescriptor
var OrderService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.OrderService", HandlerType: (*OrderServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrder", Handler: _OrderService_CreateOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/micro.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 CreateOrderRequest ¶
type CreateOrderRequest struct { CustomerId string `protobuf:"bytes,1,opt,name=customerId,proto3" json:"customerId,omitempty"` OrderProducts []*OrderProduct `protobuf:"bytes,2,rep,name=orderProducts,proto3" json:"orderProducts,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) GetOrderProducts ¶
func (x *CreateOrderRequest) GetOrderProducts() []*OrderProduct
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 Order ¶
type Order struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` CustomerId string `protobuf:"bytes,2,opt,name=customerId,proto3" json:"customerId,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Products []*Product `protobuf:"bytes,4,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*Order) Descriptor
deprecated
func (*Order) GetCustomerId ¶
func (*Order) GetProducts ¶
func (*Order) ProtoMessage ¶
func (*Order) ProtoMessage()
func (*Order) ProtoReflect ¶
func (x *Order) ProtoReflect() protoreflect.Message
type OrderProduct ¶
type OrderProduct struct { ProductId string `protobuf:"bytes,1,opt,name=productId,proto3" json:"productId,omitempty"` Quantity int32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*OrderProduct) Descriptor
deprecated
func (*OrderProduct) Descriptor() ([]byte, []int)
Deprecated: Use OrderProduct.ProtoReflect.Descriptor instead.
func (*OrderProduct) GetProductId ¶
func (x *OrderProduct) GetProductId() string
func (*OrderProduct) GetQuantity ¶
func (x *OrderProduct) GetQuantity() int32
func (*OrderProduct) ProtoMessage ¶
func (*OrderProduct) ProtoMessage()
func (*OrderProduct) ProtoReflect ¶
func (x *OrderProduct) ProtoReflect() protoreflect.Message
func (*OrderProduct) Reset ¶
func (x *OrderProduct) Reset()
func (*OrderProduct) String ¶
func (x *OrderProduct) String() string
type OrderServiceClient ¶
type OrderServiceClient interface {
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*Order, 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 { CreateOrder(context.Context, *CreateOrderRequest) (*Order, error) // contains filtered or unexported methods }
OrderServiceServer is the server API for OrderService service. All implementations must embed UnimplementedOrderServiceServer for forward compatibility
type Product ¶
type Product struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` PriceId string `protobuf:"bytes,4,opt,name=priceId,proto3" json:"priceId,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) GetPriceId ¶
func (*Product) GetQuantity ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type UnimplementedOrderServiceServer ¶
type UnimplementedOrderServiceServer struct { }
UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOrderServiceServer) CreateOrder ¶
func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*Order, 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.