Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
- type Category
- type GetByFiltersRequest
- func (*GetByFiltersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetByFiltersRequest) GetCategory() string
- func (x *GetByFiltersRequest) GetLimit() int64
- func (x *GetByFiltersRequest) GetPage() int64
- func (x *GetByFiltersRequest) GetSearch() string
- func (*GetByFiltersRequest) ProtoMessage()
- func (x *GetByFiltersRequest) ProtoReflect() protoreflect.Message
- func (x *GetByFiltersRequest) Reset()
- func (x *GetByFiltersRequest) String() string
- type GetBySlugRequest
- type ManyProductResponse
- func (*ManyProductResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ManyProductResponse) GetProducts() []*Product
- func (*ManyProductResponse) ProtoMessage()
- func (x *ManyProductResponse) ProtoReflect() protoreflect.Message
- func (x *ManyProductResponse) Reset()
- func (x *ManyProductResponse) String() string
- type NewProduct
- func (*NewProduct) Descriptor() ([]byte, []int)deprecated
- func (x *NewProduct) GetCategory() string
- func (x *NewProduct) GetDescription() string
- func (x *NewProduct) GetPrice() int64
- func (x *NewProduct) GetStock() int64
- func (x *NewProduct) GetTags() string
- func (x *NewProduct) GetTitle() string
- func (x *NewProduct) GetVariants() []*Variant
- func (*NewProduct) ProtoMessage()
- func (x *NewProduct) ProtoReflect() protoreflect.Message
- func (x *NewProduct) Reset()
- func (x *NewProduct) String() string
- type Product
- func (*Product) Descriptor() ([]byte, []int)deprecated
- func (x *Product) GetAverageRating() float32
- func (x *Product) GetCategory() *Category
- func (x *Product) GetCreatedAt() int64
- func (x *Product) GetDescription() string
- func (x *Product) GetId() string
- func (x *Product) GetPrice() int64
- func (x *Product) GetSlug() string
- func (x *Product) GetStock() int64
- func (x *Product) GetStoreId() string
- func (x *Product) GetTags() []string
- func (x *Product) GetTitle() string
- func (x *Product) GetTotalReview() int64
- func (x *Product) GetTotalSold() int64
- func (x *Product) GetTotalViews() int64
- func (x *Product) GetUpdatedAt() int64
- func (x *Product) GetVariants() []*Variant
- func (*Product) ProtoMessage()
- func (x *Product) ProtoReflect() protoreflect.Message
- func (x *Product) Reset()
- func (x *Product) String() string
- type ProductId
- type ProductResponse
- type ProductServiceClient
- type ProductServiceServer
- type StoreId
- type UnimplementedProductServiceServer
- func (UnimplementedProductServiceServer) Create(context.Context, *NewProduct) (*ProductResponse, error)
- func (UnimplementedProductServiceServer) Delete(context.Context, *ProductId) (*ProductId, error)
- func (UnimplementedProductServiceServer) GetByFilters(context.Context, *GetByFiltersRequest) (*ManyProductResponse, error)
- func (UnimplementedProductServiceServer) GetById(context.Context, *ProductId) (*Product, error)
- func (UnimplementedProductServiceServer) GetBySlug(context.Context, *GetBySlugRequest) (*Product, error)
- func (UnimplementedProductServiceServer) GetByStoreId(context.Context, *StoreId) (*ManyProductResponse, error)
- func (UnimplementedProductServiceServer) Update(context.Context, *UpdateRequest) (*Product, error)
- type UnsafeProductServiceServer
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetCategory() string
- func (x *UpdateRequest) GetDescription() string
- func (x *UpdateRequest) GetId() string
- func (x *UpdateRequest) GetPrice() string
- func (x *UpdateRequest) GetTags() string
- func (x *UpdateRequest) GetTitle() string
- func (x *UpdateRequest) GetVariants() []*Variant
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- type Variant
- type VariantItem
- func (*VariantItem) Descriptor() ([]byte, []int)deprecated
- func (x *VariantItem) GetPrice() int64
- func (x *VariantItem) GetStock() int64
- func (x *VariantItem) GetValue() string
- func (*VariantItem) ProtoMessage()
- func (x *VariantItem) ProtoReflect() protoreflect.Message
- func (x *VariantItem) Reset()
- func (x *VariantItem) String() string
Constants ¶
const ( ProductService_Create_FullMethodName = "/product.ProductService/Create" ProductService_GetById_FullMethodName = "/product.ProductService/GetById" ProductService_GetBySlug_FullMethodName = "/product.ProductService/GetBySlug" ProductService_GetByStoreId_FullMethodName = "/product.ProductService/GetByStoreId" ProductService_GetByFilters_FullMethodName = "/product.ProductService/GetByFilters" ProductService_Update_FullMethodName = "/product.ProductService/Update" ProductService_Delete_FullMethodName = "/product.ProductService/Delete" )
Variables ¶
var File_product_proto protoreflect.FileDescriptor
var ProductService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "product.ProductService", HandlerType: (*ProductServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _ProductService_Create_Handler, }, { MethodName: "GetById", Handler: _ProductService_GetById_Handler, }, { MethodName: "GetBySlug", Handler: _ProductService_GetBySlug_Handler, }, { MethodName: "GetByStoreId", Handler: _ProductService_GetByStoreId_Handler, }, { MethodName: "GetByFilters", Handler: _ProductService_GetByFilters_Handler, }, { MethodName: "Update", Handler: _ProductService_Update_Handler, }, { MethodName: "Delete", Handler: _ProductService_Delete_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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 RegisterProductServiceServer ¶
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer)
Types ¶
type Category ¶
type Category struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Hierarchy []string `protobuf:"bytes,2,rep,name=hierarchy,proto3" json:"hierarchy,omitempty"` // contains filtered or unexported fields }
func (*Category) Descriptor
deprecated
func (*Category) GetHierarchy ¶
func (*Category) ProtoMessage ¶
func (*Category) ProtoMessage()
func (*Category) ProtoReflect ¶
func (x *Category) ProtoReflect() protoreflect.Message
type GetByFiltersRequest ¶
type GetByFiltersRequest struct { Search string `protobuf:"bytes,1,opt,name=search,proto3" json:"search,omitempty"` Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` Page int64 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` Limit int64 `protobuf:"varint,4,opt,name=limit,proto3" json:"limit,omitempty"` // contains filtered or unexported fields }
func (*GetByFiltersRequest) Descriptor
deprecated
func (*GetByFiltersRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetByFiltersRequest.ProtoReflect.Descriptor instead.
func (*GetByFiltersRequest) GetCategory ¶
func (x *GetByFiltersRequest) GetCategory() string
func (*GetByFiltersRequest) GetLimit ¶
func (x *GetByFiltersRequest) GetLimit() int64
func (*GetByFiltersRequest) GetPage ¶
func (x *GetByFiltersRequest) GetPage() int64
func (*GetByFiltersRequest) GetSearch ¶
func (x *GetByFiltersRequest) GetSearch() string
func (*GetByFiltersRequest) ProtoMessage ¶
func (*GetByFiltersRequest) ProtoMessage()
func (*GetByFiltersRequest) ProtoReflect ¶
func (x *GetByFiltersRequest) ProtoReflect() protoreflect.Message
func (*GetByFiltersRequest) Reset ¶
func (x *GetByFiltersRequest) Reset()
func (*GetByFiltersRequest) String ¶
func (x *GetByFiltersRequest) String() string
type GetBySlugRequest ¶
type GetBySlugRequest struct { Slug string `protobuf:"bytes,1,opt,name=slug,proto3" json:"slug,omitempty"` // contains filtered or unexported fields }
func (*GetBySlugRequest) Descriptor
deprecated
func (*GetBySlugRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetBySlugRequest.ProtoReflect.Descriptor instead.
func (*GetBySlugRequest) GetSlug ¶
func (x *GetBySlugRequest) GetSlug() string
func (*GetBySlugRequest) ProtoMessage ¶
func (*GetBySlugRequest) ProtoMessage()
func (*GetBySlugRequest) ProtoReflect ¶
func (x *GetBySlugRequest) ProtoReflect() protoreflect.Message
func (*GetBySlugRequest) Reset ¶
func (x *GetBySlugRequest) Reset()
func (*GetBySlugRequest) String ¶
func (x *GetBySlugRequest) String() string
type ManyProductResponse ¶
type ManyProductResponse struct { Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"` // contains filtered or unexported fields }
func (*ManyProductResponse) Descriptor
deprecated
func (*ManyProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use ManyProductResponse.ProtoReflect.Descriptor instead.
func (*ManyProductResponse) GetProducts ¶
func (x *ManyProductResponse) GetProducts() []*Product
func (*ManyProductResponse) ProtoMessage ¶
func (*ManyProductResponse) ProtoMessage()
func (*ManyProductResponse) ProtoReflect ¶
func (x *ManyProductResponse) ProtoReflect() protoreflect.Message
func (*ManyProductResponse) Reset ¶
func (x *ManyProductResponse) Reset()
func (*ManyProductResponse) String ¶
func (x *ManyProductResponse) String() string
type NewProduct ¶
type NewProduct struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"` Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` Tags string `protobuf:"bytes,5,opt,name=tags,proto3" json:"tags,omitempty"` Variants []*Variant `protobuf:"bytes,6,rep,name=variants,proto3" json:"variants,omitempty"` Stock int64 `protobuf:"varint,7,opt,name=stock,proto3" json:"stock,omitempty"` // contains filtered or unexported fields }
func (*NewProduct) Descriptor
deprecated
func (*NewProduct) Descriptor() ([]byte, []int)
Deprecated: Use NewProduct.ProtoReflect.Descriptor instead.
func (*NewProduct) GetCategory ¶
func (x *NewProduct) GetCategory() string
func (*NewProduct) GetDescription ¶
func (x *NewProduct) GetDescription() string
func (*NewProduct) GetPrice ¶
func (x *NewProduct) GetPrice() int64
func (*NewProduct) GetStock ¶
func (x *NewProduct) GetStock() int64
func (*NewProduct) GetTags ¶
func (x *NewProduct) GetTags() string
func (*NewProduct) GetTitle ¶
func (x *NewProduct) GetTitle() string
func (*NewProduct) GetVariants ¶
func (x *NewProduct) GetVariants() []*Variant
func (*NewProduct) ProtoMessage ¶
func (*NewProduct) ProtoMessage()
func (*NewProduct) ProtoReflect ¶
func (x *NewProduct) ProtoReflect() protoreflect.Message
func (*NewProduct) Reset ¶
func (x *NewProduct) Reset()
func (*NewProduct) String ¶
func (x *NewProduct) String() string
type Product ¶
type Product struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` StoreId string `protobuf:"bytes,2,opt,name=store_id,json=storeId,proto3" json:"store_id,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Slug string `protobuf:"bytes,4,opt,name=slug,proto3" json:"slug,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` Tags []string `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"` Category *Category `protobuf:"bytes,7,opt,name=category,proto3" json:"category,omitempty"` Variants []*Variant `protobuf:"bytes,8,rep,name=variants,proto3" json:"variants,omitempty"` AverageRating float32 `protobuf:"fixed32,9,opt,name=average_rating,json=averageRating,proto3" json:"average_rating,omitempty"` TotalReview int64 `protobuf:"varint,10,opt,name=total_review,json=totalReview,proto3" json:"total_review,omitempty"` TotalSold int64 `protobuf:"varint,11,opt,name=total_sold,json=totalSold,proto3" json:"total_sold,omitempty"` Price int64 `protobuf:"varint,12,opt,name=price,proto3" json:"price,omitempty"` Stock int64 `protobuf:"varint,13,opt,name=stock,proto3" json:"stock,omitempty"` TotalViews int64 `protobuf:"varint,14,opt,name=total_views,json=totalViews,proto3" json:"total_views,omitempty"` CreatedAt int64 `protobuf:"varint,15,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt int64 `protobuf:"varint,16,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*Product) Descriptor
deprecated
func (*Product) GetAverageRating ¶
func (*Product) GetCategory ¶
func (*Product) GetCreatedAt ¶
func (*Product) GetDescription ¶
func (*Product) GetStoreId ¶
func (*Product) GetTotalReview ¶
func (*Product) GetTotalSold ¶
func (*Product) GetTotalViews ¶
func (*Product) GetUpdatedAt ¶
func (*Product) GetVariants ¶
func (*Product) ProtoMessage ¶
func (*Product) ProtoMessage()
func (*Product) ProtoReflect ¶
func (x *Product) ProtoReflect() protoreflect.Message
type ProductId ¶
type ProductId struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ProductId) Descriptor
deprecated
func (*ProductId) ProtoMessage ¶
func (*ProductId) ProtoMessage()
func (*ProductId) ProtoReflect ¶
func (x *ProductId) ProtoReflect() protoreflect.Message
type ProductResponse ¶
type ProductResponse struct { Product *Product `protobuf:"bytes,1,opt,name=Product,proto3" json:"Product,omitempty"` // contains filtered or unexported fields }
func (*ProductResponse) Descriptor
deprecated
func (*ProductResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProductResponse.ProtoReflect.Descriptor instead.
func (*ProductResponse) GetProduct ¶
func (x *ProductResponse) GetProduct() *Product
func (*ProductResponse) ProtoMessage ¶
func (*ProductResponse) ProtoMessage()
func (*ProductResponse) ProtoReflect ¶
func (x *ProductResponse) ProtoReflect() protoreflect.Message
func (*ProductResponse) Reset ¶
func (x *ProductResponse) Reset()
func (*ProductResponse) String ¶
func (x *ProductResponse) String() string
type ProductServiceClient ¶
type ProductServiceClient interface { Create(ctx context.Context, in *NewProduct, opts ...grpc.CallOption) (*ProductResponse, error) GetById(ctx context.Context, in *ProductId, opts ...grpc.CallOption) (*Product, error) GetBySlug(ctx context.Context, in *GetBySlugRequest, opts ...grpc.CallOption) (*Product, error) GetByStoreId(ctx context.Context, in *StoreId, opts ...grpc.CallOption) (*ManyProductResponse, error) GetByFilters(ctx context.Context, in *GetByFiltersRequest, opts ...grpc.CallOption) (*ManyProductResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Product, error) Delete(ctx context.Context, in *ProductId, opts ...grpc.CallOption) (*ProductId, 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 { Create(context.Context, *NewProduct) (*ProductResponse, error) GetById(context.Context, *ProductId) (*Product, error) GetBySlug(context.Context, *GetBySlugRequest) (*Product, error) GetByStoreId(context.Context, *StoreId) (*ManyProductResponse, error) GetByFilters(context.Context, *GetByFiltersRequest) (*ManyProductResponse, error) Update(context.Context, *UpdateRequest) (*Product, error) Delete(context.Context, *ProductId) (*ProductId, error) // contains filtered or unexported methods }
ProductServiceServer is the server API for ProductService service. All implementations must embed UnimplementedProductServiceServer for forward compatibility
type StoreId ¶
type StoreId struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*StoreId) Descriptor
deprecated
func (*StoreId) ProtoMessage ¶
func (*StoreId) ProtoMessage()
func (*StoreId) ProtoReflect ¶
func (x *StoreId) ProtoReflect() protoreflect.Message
type UnimplementedProductServiceServer ¶
type UnimplementedProductServiceServer struct { }
UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedProductServiceServer) Create ¶
func (UnimplementedProductServiceServer) Create(context.Context, *NewProduct) (*ProductResponse, error)
func (UnimplementedProductServiceServer) GetByFilters ¶
func (UnimplementedProductServiceServer) GetByFilters(context.Context, *GetByFiltersRequest) (*ManyProductResponse, error)
func (UnimplementedProductServiceServer) GetBySlug ¶
func (UnimplementedProductServiceServer) GetBySlug(context.Context, *GetBySlugRequest) (*Product, error)
func (UnimplementedProductServiceServer) GetByStoreId ¶
func (UnimplementedProductServiceServer) GetByStoreId(context.Context, *StoreId) (*ManyProductResponse, error)
func (UnimplementedProductServiceServer) Update ¶
func (UnimplementedProductServiceServer) Update(context.Context, *UpdateRequest) (*Product, 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 UpdateRequest ¶
type UpdateRequest struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Price string `protobuf:"bytes,3,opt,name=price,proto3" json:"price,omitempty"` Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"` Tags string `protobuf:"bytes,5,opt,name=tags,proto3" json:"tags,omitempty"` Variants []*Variant `protobuf:"bytes,6,rep,name=variants,proto3" json:"variants,omitempty"` Id string `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetCategory ¶
func (x *UpdateRequest) GetCategory() string
func (*UpdateRequest) GetDescription ¶
func (x *UpdateRequest) GetDescription() string
func (*UpdateRequest) GetId ¶
func (x *UpdateRequest) GetId() string
func (*UpdateRequest) GetPrice ¶
func (x *UpdateRequest) GetPrice() string
func (*UpdateRequest) GetTags ¶
func (x *UpdateRequest) GetTags() string
func (*UpdateRequest) GetTitle ¶
func (x *UpdateRequest) GetTitle() string
func (*UpdateRequest) GetVariants ¶
func (x *UpdateRequest) GetVariants() []*Variant
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
type Variant ¶
type Variant struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Items []*VariantItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*Variant) Descriptor
deprecated
func (*Variant) GetItems ¶
func (x *Variant) GetItems() []*VariantItem
func (*Variant) ProtoMessage ¶
func (*Variant) ProtoMessage()
func (*Variant) ProtoReflect ¶
func (x *Variant) ProtoReflect() protoreflect.Message
type VariantItem ¶
type VariantItem struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,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 (*VariantItem) Descriptor
deprecated
func (*VariantItem) Descriptor() ([]byte, []int)
Deprecated: Use VariantItem.ProtoReflect.Descriptor instead.
func (*VariantItem) GetPrice ¶
func (x *VariantItem) GetPrice() int64
func (*VariantItem) GetStock ¶
func (x *VariantItem) GetStock() int64
func (*VariantItem) GetValue ¶
func (x *VariantItem) GetValue() string
func (*VariantItem) ProtoMessage ¶
func (*VariantItem) ProtoMessage()
func (*VariantItem) ProtoReflect ¶
func (x *VariantItem) ProtoReflect() protoreflect.Message
func (*VariantItem) Reset ¶
func (x *VariantItem) Reset()
func (*VariantItem) String ¶
func (x *VariantItem) String() string