product

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProductService_FindManyByIdsForCart_FullMethodName = "/product.ProductService/FindManyByIdsForCart"
	ProductService_ReduceStocks_FullMethodName         = "/product.ProductService/ReduceStocks"
	ProductService_RollbackStocks_FullMethodName       = "/product.ProductService/RollbackStocks"
)

Variables

View Source
var File_proto_product_service_proto protoreflect.FileDescriptor
View Source
var File_proto_product_type_cart_proto protoreflect.FileDescriptor
View Source
var File_proto_product_type_product_proto protoreflect.FileDescriptor
View Source
var ProductService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "product.ProductService",
	HandlerType: (*ProductServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FindManyByIdsForCart",
			Handler:    _ProductService_FindManyByIdsForCart_Handler,
		},
		{
			MethodName: "ReduceStocks",
			Handler:    _ProductService_ReduceStocks_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 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 ProductOrder added in v0.0.27

type ProductOrder struct {
	OrderId     string `protobuf:"bytes,1,opt,name=orderId,json=order_id,proto3" json:"orderId,omitempty"`
	ProductId   uint32 `protobuf:"varint,2,opt,name=productId,json=product_id,proto3" json:"productId,omitempty"`
	ProductName string `protobuf:"bytes,3,opt,name=productName,json=product_name,proto3" json:"productName,omitempty"`
	Quantity    uint32 `protobuf:"varint,4,opt,name=quantity,proto3" json:"quantity,omitempty"`
	Image       string `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"`
	Price       uint32 `protobuf:"varint,7,opt,name=price,proto3" json:"price,omitempty"`
	// contains filtered or unexported fields
}

func (*ProductOrder) Descriptor deprecated added in v0.0.27

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

Deprecated: Use ProductOrder.ProtoReflect.Descriptor instead.

func (*ProductOrder) GetImage added in v0.0.27

func (x *ProductOrder) GetImage() string

func (*ProductOrder) GetOrderId added in v0.0.27

func (x *ProductOrder) GetOrderId() string

func (*ProductOrder) GetPrice added in v0.0.27

func (x *ProductOrder) GetPrice() uint32

func (*ProductOrder) GetProductId added in v0.0.27

func (x *ProductOrder) GetProductId() uint32

func (*ProductOrder) GetProductName added in v0.0.27

func (x *ProductOrder) GetProductName() string

func (*ProductOrder) GetQuantity added in v0.0.27

func (x *ProductOrder) GetQuantity() uint32

func (*ProductOrder) ProtoMessage added in v0.0.27

func (*ProductOrder) ProtoMessage()

func (*ProductOrder) ProtoReflect added in v0.0.27

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

func (*ProductOrder) Reset added in v0.0.27

func (x *ProductOrder) Reset()

func (*ProductOrder) String added in v0.0.27

func (x *ProductOrder) String() string

type ProductServiceClient

type ProductServiceClient interface {
	FindManyByIdsForCart(ctx context.Context, in *ProductIds, opts ...grpc.CallOption) (*ProductsCartRes, error)
	ReduceStocks(ctx context.Context, in *ReduceStocksReq, 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.

type ProductServiceServer

type ProductServiceServer interface {
	FindManyByIdsForCart(context.Context, *ProductIds) (*ProductsCartRes, error)
	ReduceStocks(context.Context, *ReduceStocksReq) (*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 ProductsCartRes added in v0.0.33

type ProductsCartRes struct {
	Data []*ProductCart `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ProductsCartRes) Descriptor deprecated added in v0.0.33

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

Deprecated: Use ProductsCartRes.ProtoReflect.Descriptor instead.

func (*ProductsCartRes) GetData added in v0.0.33

func (x *ProductsCartRes) GetData() []*ProductCart

func (*ProductsCartRes) ProtoMessage added in v0.0.33

func (*ProductsCartRes) ProtoMessage()

func (*ProductsCartRes) ProtoReflect added in v0.0.33

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

func (*ProductsCartRes) Reset added in v0.0.33

func (x *ProductsCartRes) Reset()

func (*ProductsCartRes) String added in v0.0.33

func (x *ProductsCartRes) String() string

type ReduceStocksReq added in v0.0.28

type ReduceStocksReq struct {
	Data []*ProductOrder `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ReduceStocksReq) Descriptor deprecated added in v0.0.28

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

Deprecated: Use ReduceStocksReq.ProtoReflect.Descriptor instead.

func (*ReduceStocksReq) GetData added in v0.0.28

func (x *ReduceStocksReq) GetData() []*ProductOrder

func (*ReduceStocksReq) ProtoMessage added in v0.0.28

func (*ReduceStocksReq) ProtoMessage()

func (*ReduceStocksReq) ProtoReflect added in v0.0.28

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

func (*ReduceStocksReq) Reset added in v0.0.28

func (x *ReduceStocksReq) Reset()

func (*ReduceStocksReq) String added in v0.0.28

func (x *ReduceStocksReq) String() string

type RollbackStocksReq added in v0.0.26

type RollbackStocksReq struct {
	Data []*ProductOrder `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() []*ProductOrder

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) ReduceStocks added in v0.0.28

func (UnimplementedProductServiceServer) RollbackStocks added in v0.0.26

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.

Jump to

Keyboard shortcuts

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