Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
- type ProductCart
- func (*ProductCart) Descriptor() ([]byte, []int)deprecated
- func (x *ProductCart) GetHeight() uint32
- func (x *ProductCart) GetImage() string
- func (x *ProductCart) GetLength() uint32
- func (x *ProductCart) GetPrice() uint32
- func (x *ProductCart) GetProductId() uint32
- func (x *ProductCart) GetProductName() string
- func (x *ProductCart) GetStock() uint32
- func (x *ProductCart) GetWeight() float32
- func (x *ProductCart) GetWidth() uint32
- func (*ProductCart) ProtoMessage()
- func (x *ProductCart) ProtoReflect() protoreflect.Message
- func (x *ProductCart) Reset()
- func (x *ProductCart) String() string
- type ProductData
- func (*ProductData) Descriptor() ([]byte, []int)deprecated
- func (x *ProductData) GetProductId() uint32
- func (x *ProductData) GetQuantity() uint32
- func (*ProductData) ProtoMessage()
- func (x *ProductData) ProtoReflect() protoreflect.Message
- func (x *ProductData) Reset()
- func (x *ProductData) String() string
- type ProductIds
- type ProductServiceClient
- type ProductServiceServer
- type ProductsCartResponse
- func (*ProductsCartResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProductsCartResponse) GetData() []*ProductCart
- func (*ProductsCartResponse) ProtoMessage()
- func (x *ProductsCartResponse) ProtoReflect() protoreflect.Message
- func (x *ProductsCartResponse) Reset()
- func (x *ProductsCartResponse) String() string
- type RollbackStocksReq
- func (*RollbackStocksReq) Descriptor() ([]byte, []int)deprecated
- func (x *RollbackStocksReq) GetData() []*ProductData
- func (*RollbackStocksReq) ProtoMessage()
- func (x *RollbackStocksReq) ProtoReflect() protoreflect.Message
- func (x *RollbackStocksReq) Reset()
- func (x *RollbackStocksReq) String() string
- type UnimplementedProductServiceServer
- func (UnimplementedProductServiceServer) FindManyByIdsForCart(context.Context, *ProductIds) (*ProductsCartResponse, error)
- func (UnimplementedProductServiceServer) RollbackStocks(context.Context, *RollbackStocksReq) (*emptypb.Empty, error)
- func (UnimplementedProductServiceServer) UpdateStocks(context.Context, *UpdateStocksReq) (*emptypb.Empty, error)
- type UnsafeProductServiceServer
- type UpdateStocksReq
Constants ¶
const ( ProductService_FindManyByIdsForCart_FullMethodName = "/product.ProductService/FindManyByIdsForCart" ProductService_UpdateStocks_FullMethodName = "/product.ProductService/UpdateStocks" ProductService_RollbackStocks_FullMethodName = "/product.ProductService/RollbackStocks" )
Variables ¶
var File_proto_product_service_proto protoreflect.FileDescriptor
var File_proto_product_type_cart_proto protoreflect.FileDescriptor
var File_proto_product_type_product_proto protoreflect.FileDescriptor
var ProductService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.ProductService", HandlerType: (*ProductServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "FindManyByIdsForCart", Handler: _ProductService_FindManyByIdsForCart_Handler, }, { MethodName: "UpdateStocks", Handler: _ProductService_UpdateStocks_Handler, }, { MethodName: "RollbackStocks", Handler: _ProductService_RollbackStocks_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/product/service.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 RegisterProductServiceServer ¶
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
Types ¶
type ProductCart ¶
type ProductCart struct { ProductId uint32 `protobuf:"varint,1,opt,name=product_id,proto3" json:"product_id,omitempty"` ProductName string `protobuf:"bytes,2,opt,name=product_name,proto3" json:"product_name,omitempty"` Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` Price uint32 `protobuf:"varint,4,opt,name=price,proto3" json:"price,omitempty"` Stock uint32 `protobuf:"varint,5,opt,name=stock,proto3" json:"stock,omitempty"` Length uint32 `protobuf:"varint,6,opt,name=length,proto3" json:"length,omitempty"` Width uint32 `protobuf:"varint,7,opt,name=width,proto3" json:"width,omitempty"` Height uint32 `protobuf:"varint,8,opt,name=height,proto3" json:"height,omitempty"` Weight float32 `protobuf:"fixed32,9,opt,name=weight,proto3" json:"weight,omitempty"` // contains filtered or unexported fields }
func (*ProductCart) Descriptor
deprecated
func (*ProductCart) Descriptor() ([]byte, []int)
Deprecated: Use ProductCart.ProtoReflect.Descriptor instead.
func (*ProductCart) GetHeight ¶ added in v0.0.23
func (x *ProductCart) GetHeight() uint32
func (*ProductCart) GetImage ¶
func (x *ProductCart) GetImage() string
func (*ProductCart) GetLength ¶ added in v0.0.23
func (x *ProductCart) GetLength() uint32
func (*ProductCart) GetPrice ¶
func (x *ProductCart) GetPrice() uint32
func (*ProductCart) GetProductId ¶
func (x *ProductCart) GetProductId() uint32
func (*ProductCart) GetProductName ¶
func (x *ProductCart) GetProductName() string
func (*ProductCart) GetStock ¶
func (x *ProductCart) GetStock() uint32
func (*ProductCart) GetWeight ¶ added in v0.0.23
func (x *ProductCart) GetWeight() float32
func (*ProductCart) GetWidth ¶ added in v0.0.23
func (x *ProductCart) GetWidth() uint32
func (*ProductCart) ProtoMessage ¶
func (*ProductCart) ProtoMessage()
func (*ProductCart) ProtoReflect ¶
func (x *ProductCart) ProtoReflect() protoreflect.Message
func (*ProductCart) Reset ¶
func (x *ProductCart) Reset()
func (*ProductCart) String ¶
func (x *ProductCart) String() string
type ProductData ¶ added in v0.0.25
type ProductData struct { ProductId uint32 `protobuf:"varint,1,opt,name=productId,json=product_id,proto3" json:"productId,omitempty"` Quantity uint32 `protobuf:"varint,2,opt,name=quantity,proto3" json:"quantity,omitempty"` // contains filtered or unexported fields }
func (*ProductData) Descriptor
deprecated
added in
v0.0.25
func (*ProductData) Descriptor() ([]byte, []int)
Deprecated: Use ProductData.ProtoReflect.Descriptor instead.
func (*ProductData) GetProductId ¶ added in v0.0.25
func (x *ProductData) GetProductId() uint32
func (*ProductData) GetQuantity ¶ added in v0.0.25
func (x *ProductData) GetQuantity() uint32
func (*ProductData) ProtoMessage ¶ added in v0.0.25
func (*ProductData) ProtoMessage()
func (*ProductData) ProtoReflect ¶ added in v0.0.25
func (x *ProductData) ProtoReflect() protoreflect.Message
func (*ProductData) Reset ¶ added in v0.0.25
func (x *ProductData) Reset()
func (*ProductData) String ¶ added in v0.0.25
func (x *ProductData) String() string
type ProductIds ¶
type ProductIds struct { Ids []uint32 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` // contains filtered or unexported fields }
func (*ProductIds) Descriptor
deprecated
func (*ProductIds) Descriptor() ([]byte, []int)
Deprecated: Use ProductIds.ProtoReflect.Descriptor instead.
func (*ProductIds) GetIds ¶
func (x *ProductIds) GetIds() []uint32
func (*ProductIds) ProtoMessage ¶
func (*ProductIds) ProtoMessage()
func (*ProductIds) ProtoReflect ¶
func (x *ProductIds) ProtoReflect() protoreflect.Message
func (*ProductIds) Reset ¶
func (x *ProductIds) Reset()
func (*ProductIds) String ¶
func (x *ProductIds) String() string
type ProductServiceClient ¶
type ProductServiceClient interface { FindManyByIdsForCart(ctx context.Context, in *ProductIds, opts ...grpc.CallOption) (*ProductsCartResponse, error) UpdateStocks(ctx context.Context, in *UpdateStocksReq, opts ...grpc.CallOption) (*emptypb.Empty, error) RollbackStocks(ctx context.Context, in *RollbackStocksReq, opts ...grpc.CallOption) (*emptypb.Empty, 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 { FindManyByIdsForCart(context.Context, *ProductIds) (*ProductsCartResponse, error) UpdateStocks(context.Context, *UpdateStocksReq) (*emptypb.Empty, error) RollbackStocks(context.Context, *RollbackStocksReq) (*emptypb.Empty, error) // contains filtered or unexported methods }
ProductServiceServer is the server API for ProductService service. All implementations must embed UnimplementedProductServiceServer for forward compatibility
type ProductsCartResponse ¶
type ProductsCartResponse struct { Data []*ProductCart `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ProductsCartResponse) Descriptor
deprecated
func (*ProductsCartResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProductsCartResponse.ProtoReflect.Descriptor instead.
func (*ProductsCartResponse) GetData ¶
func (x *ProductsCartResponse) GetData() []*ProductCart
func (*ProductsCartResponse) ProtoMessage ¶
func (*ProductsCartResponse) ProtoMessage()
func (*ProductsCartResponse) ProtoReflect ¶
func (x *ProductsCartResponse) ProtoReflect() protoreflect.Message
func (*ProductsCartResponse) Reset ¶
func (x *ProductsCartResponse) Reset()
func (*ProductsCartResponse) String ¶
func (x *ProductsCartResponse) String() string
type RollbackStocksReq ¶ added in v0.0.26
type RollbackStocksReq struct { Data []*ProductData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*RollbackStocksReq) Descriptor
deprecated
added in
v0.0.26
func (*RollbackStocksReq) Descriptor() ([]byte, []int)
Deprecated: Use RollbackStocksReq.ProtoReflect.Descriptor instead.
func (*RollbackStocksReq) GetData ¶ added in v0.0.26
func (x *RollbackStocksReq) GetData() []*ProductData
func (*RollbackStocksReq) ProtoMessage ¶ added in v0.0.26
func (*RollbackStocksReq) ProtoMessage()
func (*RollbackStocksReq) ProtoReflect ¶ added in v0.0.26
func (x *RollbackStocksReq) ProtoReflect() protoreflect.Message
func (*RollbackStocksReq) Reset ¶ added in v0.0.26
func (x *RollbackStocksReq) Reset()
func (*RollbackStocksReq) String ¶ added in v0.0.26
func (x *RollbackStocksReq) String() string
type UnimplementedProductServiceServer ¶
type UnimplementedProductServiceServer struct { }
UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedProductServiceServer) FindManyByIdsForCart ¶ added in v0.0.23
func (UnimplementedProductServiceServer) FindManyByIdsForCart(context.Context, *ProductIds) (*ProductsCartResponse, error)
func (UnimplementedProductServiceServer) RollbackStocks ¶ added in v0.0.26
func (UnimplementedProductServiceServer) RollbackStocks(context.Context, *RollbackStocksReq) (*emptypb.Empty, error)
func (UnimplementedProductServiceServer) UpdateStocks ¶ added in v0.0.26
func (UnimplementedProductServiceServer) UpdateStocks(context.Context, *UpdateStocksReq) (*emptypb.Empty, error)
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.
type UpdateStocksReq ¶ added in v0.0.26
type UpdateStocksReq struct { Data []*ProductData `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*UpdateStocksReq) Descriptor
deprecated
added in
v0.0.26
func (*UpdateStocksReq) Descriptor() ([]byte, []int)
Deprecated: Use UpdateStocksReq.ProtoReflect.Descriptor instead.
func (*UpdateStocksReq) GetData ¶ added in v0.0.26
func (x *UpdateStocksReq) GetData() []*ProductData
func (*UpdateStocksReq) ProtoMessage ¶ added in v0.0.26
func (*UpdateStocksReq) ProtoMessage()
func (*UpdateStocksReq) ProtoReflect ¶ added in v0.0.26
func (x *UpdateStocksReq) ProtoReflect() protoreflect.Message
func (*UpdateStocksReq) Reset ¶ added in v0.0.26
func (x *UpdateStocksReq) Reset()
func (*UpdateStocksReq) String ¶ added in v0.0.26
func (x *UpdateStocksReq) String() string