Documentation ¶
Index ¶
- Variables
- func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer)
- func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
- type CreateOrderRequest
- func (*CreateOrderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrderRequest) GetProductId() int64
- func (x *CreateOrderRequest) GetQuantity() int64
- func (x *CreateOrderRequest) GetUserId() int64
- 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) GetError() string
- func (x *CreateOrderResponse) GetId() int64
- func (x *CreateOrderResponse) GetStatus() int64
- func (*CreateOrderResponse) ProtoMessage()
- func (x *CreateOrderResponse) ProtoReflect() protoreflect.Message
- func (x *CreateOrderResponse) Reset()
- func (x *CreateOrderResponse) String() string
- type CreateProductRequest
- func (*CreateProductRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductRequest) GetName() string
- func (x *CreateProductRequest) GetPrice() int64
- func (x *CreateProductRequest) GetStock() int64
- func (*CreateProductRequest) ProtoMessage()
- func (x *CreateProductRequest) ProtoReflect() protoreflect.Message
- func (x *CreateProductRequest) Reset()
- func (x *CreateProductRequest) String() string
- type CreateProductResponse
- func (*CreateProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateProductResponse) GetError() string
- func (x *CreateProductResponse) GetId() int64
- func (x *CreateProductResponse) GetStatus() int64
- func (*CreateProductResponse) ProtoMessage()
- func (x *CreateProductResponse) ProtoReflect() protoreflect.Message
- func (x *CreateProductResponse) Reset()
- func (x *CreateProductResponse) String() string
- type DecreaseStockRequest
- func (*DecreaseStockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DecreaseStockRequest) GetId() int64
- func (x *DecreaseStockRequest) GetOrderId() int64
- func (x *DecreaseStockRequest) GetQty() int64
- func (*DecreaseStockRequest) ProtoMessage()
- func (x *DecreaseStockRequest) ProtoReflect() protoreflect.Message
- func (x *DecreaseStockRequest) Reset()
- func (x *DecreaseStockRequest) String() string
- type DecreaseStockResponse
- func (*DecreaseStockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DecreaseStockResponse) GetError() string
- func (x *DecreaseStockResponse) GetStatus() int64
- func (*DecreaseStockResponse) ProtoMessage()
- func (x *DecreaseStockResponse) ProtoReflect() protoreflect.Message
- func (x *DecreaseStockResponse) Reset()
- func (x *DecreaseStockResponse) String() string
- type FindOneData
- func (*FindOneData) Descriptor() ([]byte, []int)deprecated
- func (x *FindOneData) GetId() int64
- func (x *FindOneData) GetName() string
- func (x *FindOneData) GetPrice() int64
- func (x *FindOneData) GetSku() string
- func (x *FindOneData) GetStock() int64
- func (*FindOneData) ProtoMessage()
- func (x *FindOneData) ProtoReflect() protoreflect.Message
- func (x *FindOneData) Reset()
- func (x *FindOneData) String() string
- type FindOneRequest
- type FindOneResponse
- func (*FindOneResponse) Descriptor() ([]byte, []int)deprecated
- func (x *FindOneResponse) GetData() *FindOneData
- func (x *FindOneResponse) GetError() string
- func (x *FindOneResponse) GetStatus() int64
- func (*FindOneResponse) ProtoMessage()
- func (x *FindOneResponse) ProtoReflect() protoreflect.Message
- func (x *FindOneResponse) Reset()
- func (x *FindOneResponse) String() string
- type OrderServiceClient
- type OrderServiceServer
- type ProductServiceClient
- type ProductServiceServer
- type UnimplementedOrderServiceServer
- type UnimplementedProductServiceServer
- func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
- func (UnimplementedProductServiceServer) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error)
- func (UnimplementedProductServiceServer) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, error)
- type UnsafeOrderServiceServer
- type UnsafeProductServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_pkg_pb_order_proto protoreflect.FileDescriptor
var File_pkg_pb_product_proto protoreflect.FileDescriptor
var OrderService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "order.OrderService", HandlerType: (*OrderServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateOrder", Handler: _OrderService_CreateOrder_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/pb/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)
var ProductService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.ProductService", HandlerType: (*ProductServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateProduct", Handler: _ProductService_CreateProduct_Handler, }, { MethodName: "FindOne", Handler: _ProductService_FindOne_Handler, }, { MethodName: "DecreaseStock", Handler: _ProductService_DecreaseStock_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/pb/product.proto", }
ProductService_ServiceDesc is the grpc.ServiceDesc for ProductService 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)
func RegisterProductServiceServer ¶
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
Types ¶
type CreateOrderRequest ¶
type CreateOrderRequest struct { ProductId int64 `protobuf:"varint,1,opt,name=productId,proto3" json:"productId,omitempty"` Quantity int64 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` UserId int64 `protobuf:"varint,3,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
func (*CreateOrderRequest) Descriptor
deprecated
func (*CreateOrderRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead.
func (*CreateOrderRequest) GetProductId ¶
func (x *CreateOrderRequest) GetProductId() int64
func (*CreateOrderRequest) GetQuantity ¶
func (x *CreateOrderRequest) GetQuantity() int64
func (*CreateOrderRequest) GetUserId ¶
func (x *CreateOrderRequest) GetUserId() int64
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 { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Id int64 `protobuf:"varint,3,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) GetError ¶
func (x *CreateOrderResponse) GetError() string
func (*CreateOrderResponse) GetId ¶
func (x *CreateOrderResponse) GetId() int64
func (*CreateOrderResponse) GetStatus ¶
func (x *CreateOrderResponse) GetStatus() int64
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 CreateProductRequest ¶
type CreateProductRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Stock int64 `protobuf:"varint,2,opt,name=stock,proto3" json:"stock,omitempty"` Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
func (*CreateProductRequest) Descriptor
deprecated
func (*CreateProductRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductRequest.ProtoReflect.Descriptor instead.
func (*CreateProductRequest) GetName ¶
func (x *CreateProductRequest) GetName() string
func (*CreateProductRequest) GetPrice ¶
func (x *CreateProductRequest) GetPrice() int64
func (*CreateProductRequest) GetStock ¶
func (x *CreateProductRequest) GetStock() int64
func (*CreateProductRequest) ProtoMessage ¶
func (*CreateProductRequest) ProtoMessage()
func (*CreateProductRequest) ProtoReflect ¶
func (x *CreateProductRequest) ProtoReflect() protoreflect.Message
func (*CreateProductRequest) Reset ¶
func (x *CreateProductRequest) Reset()
func (*CreateProductRequest) String ¶
func (x *CreateProductRequest) String() string
type CreateProductResponse ¶
type CreateProductResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateProductResponse) Descriptor
deprecated
func (*CreateProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateProductResponse.ProtoReflect.Descriptor instead.
func (*CreateProductResponse) GetError ¶
func (x *CreateProductResponse) GetError() string
func (*CreateProductResponse) GetId ¶
func (x *CreateProductResponse) GetId() int64
func (*CreateProductResponse) GetStatus ¶
func (x *CreateProductResponse) GetStatus() int64
func (*CreateProductResponse) ProtoMessage ¶
func (*CreateProductResponse) ProtoMessage()
func (*CreateProductResponse) ProtoReflect ¶
func (x *CreateProductResponse) ProtoReflect() protoreflect.Message
func (*CreateProductResponse) Reset ¶
func (x *CreateProductResponse) Reset()
func (*CreateProductResponse) String ¶
func (x *CreateProductResponse) String() string
type DecreaseStockRequest ¶
type DecreaseStockRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` OrderId int64 `protobuf:"varint,2,opt,name=orderId,proto3" json:"orderId,omitempty"` Qty int64 `protobuf:"varint,3,opt,name=qty,proto3" json:"qty,omitempty"` // contains filtered or unexported fields }
func (*DecreaseStockRequest) Descriptor
deprecated
func (*DecreaseStockRequest) Descriptor() ([]byte, []int)
Deprecated: Use DecreaseStockRequest.ProtoReflect.Descriptor instead.
func (*DecreaseStockRequest) GetId ¶
func (x *DecreaseStockRequest) GetId() int64
func (*DecreaseStockRequest) GetOrderId ¶
func (x *DecreaseStockRequest) GetOrderId() int64
func (*DecreaseStockRequest) GetQty ¶
func (x *DecreaseStockRequest) GetQty() int64
func (*DecreaseStockRequest) ProtoMessage ¶
func (*DecreaseStockRequest) ProtoMessage()
func (*DecreaseStockRequest) ProtoReflect ¶
func (x *DecreaseStockRequest) ProtoReflect() protoreflect.Message
func (*DecreaseStockRequest) Reset ¶
func (x *DecreaseStockRequest) Reset()
func (*DecreaseStockRequest) String ¶
func (x *DecreaseStockRequest) String() string
type DecreaseStockResponse ¶
type DecreaseStockResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*DecreaseStockResponse) Descriptor
deprecated
func (*DecreaseStockResponse) Descriptor() ([]byte, []int)
Deprecated: Use DecreaseStockResponse.ProtoReflect.Descriptor instead.
func (*DecreaseStockResponse) GetError ¶
func (x *DecreaseStockResponse) GetError() string
func (*DecreaseStockResponse) GetStatus ¶
func (x *DecreaseStockResponse) GetStatus() int64
func (*DecreaseStockResponse) ProtoMessage ¶
func (*DecreaseStockResponse) ProtoMessage()
func (*DecreaseStockResponse) ProtoReflect ¶
func (x *DecreaseStockResponse) ProtoReflect() protoreflect.Message
func (*DecreaseStockResponse) Reset ¶
func (x *DecreaseStockResponse) Reset()
func (*DecreaseStockResponse) String ¶
func (x *DecreaseStockResponse) String() string
type FindOneData ¶
type FindOneData struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Sku string `protobuf:"bytes,3,opt,name=sku,proto3" json:"sku,omitempty"` Stock int64 `protobuf:"varint,4,opt,name=stock,proto3" json:"stock,omitempty"` Price int64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"` // contains filtered or unexported fields }
FindOne
func (*FindOneData) Descriptor
deprecated
func (*FindOneData) Descriptor() ([]byte, []int)
Deprecated: Use FindOneData.ProtoReflect.Descriptor instead.
func (*FindOneData) GetId ¶
func (x *FindOneData) GetId() int64
func (*FindOneData) GetName ¶
func (x *FindOneData) GetName() string
func (*FindOneData) GetPrice ¶
func (x *FindOneData) GetPrice() int64
func (*FindOneData) GetSku ¶
func (x *FindOneData) GetSku() string
func (*FindOneData) GetStock ¶
func (x *FindOneData) GetStock() int64
func (*FindOneData) ProtoMessage ¶
func (*FindOneData) ProtoMessage()
func (*FindOneData) ProtoReflect ¶
func (x *FindOneData) ProtoReflect() protoreflect.Message
func (*FindOneData) Reset ¶
func (x *FindOneData) Reset()
func (*FindOneData) String ¶
func (x *FindOneData) String() string
type FindOneRequest ¶
type FindOneRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*FindOneRequest) Descriptor
deprecated
func (*FindOneRequest) Descriptor() ([]byte, []int)
Deprecated: Use FindOneRequest.ProtoReflect.Descriptor instead.
func (*FindOneRequest) GetId ¶
func (x *FindOneRequest) GetId() int64
func (*FindOneRequest) ProtoMessage ¶
func (*FindOneRequest) ProtoMessage()
func (*FindOneRequest) ProtoReflect ¶
func (x *FindOneRequest) ProtoReflect() protoreflect.Message
func (*FindOneRequest) Reset ¶
func (x *FindOneRequest) Reset()
func (*FindOneRequest) String ¶
func (x *FindOneRequest) String() string
type FindOneResponse ¶
type FindOneResponse struct { Status int64 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Data *FindOneData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*FindOneResponse) Descriptor
deprecated
func (*FindOneResponse) Descriptor() ([]byte, []int)
Deprecated: Use FindOneResponse.ProtoReflect.Descriptor instead.
func (*FindOneResponse) GetData ¶
func (x *FindOneResponse) GetData() *FindOneData
func (*FindOneResponse) GetError ¶
func (x *FindOneResponse) GetError() string
func (*FindOneResponse) GetStatus ¶
func (x *FindOneResponse) GetStatus() int64
func (*FindOneResponse) ProtoMessage ¶
func (*FindOneResponse) ProtoMessage()
func (*FindOneResponse) ProtoReflect ¶
func (x *FindOneResponse) ProtoReflect() protoreflect.Message
func (*FindOneResponse) Reset ¶
func (x *FindOneResponse) Reset()
func (*FindOneResponse) String ¶
func (x *FindOneResponse) String() string
type OrderServiceClient ¶
type OrderServiceClient interface {
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, 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) (*CreateOrderResponse, error) // contains filtered or unexported methods }
OrderServiceServer is the server API for OrderService service. All implementations must embed UnimplementedOrderServiceServer for forward compatibility
type ProductServiceClient ¶
type ProductServiceClient interface { CreateProduct(ctx context.Context, in *CreateProductRequest, opts ...grpc.CallOption) (*CreateProductResponse, error) FindOne(ctx context.Context, in *FindOneRequest, opts ...grpc.CallOption) (*FindOneResponse, error) DecreaseStock(ctx context.Context, in *DecreaseStockRequest, opts ...grpc.CallOption) (*DecreaseStockResponse, error) }
ProductServiceClient is the client API for ProductService 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 NewProductServiceClient ¶
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient
type ProductServiceServer ¶
type ProductServiceServer interface { CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, error) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error) // contains filtered or unexported methods }
ProductServiceServer is the server API for ProductService service. All implementations must embed UnimplementedProductServiceServer for forward compatibility
type UnimplementedOrderServiceServer ¶
type UnimplementedOrderServiceServer struct { }
UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOrderServiceServer) CreateOrder ¶
func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
type UnimplementedProductServiceServer ¶
type UnimplementedProductServiceServer struct { }
UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedProductServiceServer) CreateProduct ¶
func (UnimplementedProductServiceServer) CreateProduct(context.Context, *CreateProductRequest) (*CreateProductResponse, error)
func (UnimplementedProductServiceServer) DecreaseStock ¶
func (UnimplementedProductServiceServer) DecreaseStock(context.Context, *DecreaseStockRequest) (*DecreaseStockResponse, error)
func (UnimplementedProductServiceServer) FindOne ¶
func (UnimplementedProductServiceServer) FindOne(context.Context, *FindOneRequest) (*FindOneResponse, 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.
type UnsafeProductServiceServer ¶
type UnsafeProductServiceServer interface {
// contains filtered or unexported methods
}
UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProductServiceServer will result in compilation errors.