product

package
v0.0.0-...-e662f33 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var File_product_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Category.ProtoReflect.Descriptor instead.

func (*Category) GetHierarchy

func (x *Category) GetHierarchy() []string

func (*Category) GetName

func (x *Category) GetName() string

func (*Category) ProtoMessage

func (*Category) ProtoMessage()

func (*Category) ProtoReflect

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

func (*Category) Reset

func (x *Category) Reset()

func (*Category) String

func (x *Category) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Product.ProtoReflect.Descriptor instead.

func (*Product) GetAverageRating

func (x *Product) GetAverageRating() float32

func (*Product) GetCategory

func (x *Product) GetCategory() *Category

func (*Product) GetCreatedAt

func (x *Product) GetCreatedAt() int64

func (*Product) GetDescription

func (x *Product) GetDescription() string

func (*Product) GetId

func (x *Product) GetId() string

func (*Product) GetPrice

func (x *Product) GetPrice() int64

func (*Product) GetSlug

func (x *Product) GetSlug() string

func (*Product) GetStock

func (x *Product) GetStock() int64

func (*Product) GetStoreId

func (x *Product) GetStoreId() string

func (*Product) GetTags

func (x *Product) GetTags() []string

func (*Product) GetTitle

func (x *Product) GetTitle() string

func (*Product) GetTotalReview

func (x *Product) GetTotalReview() int64

func (*Product) GetTotalSold

func (x *Product) GetTotalSold() int64

func (*Product) GetTotalViews

func (x *Product) GetTotalViews() int64

func (*Product) GetUpdatedAt

func (x *Product) GetUpdatedAt() int64

func (*Product) GetVariants

func (x *Product) GetVariants() []*Variant

func (*Product) ProtoMessage

func (*Product) ProtoMessage()

func (*Product) ProtoReflect

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

func (*Product) Reset

func (x *Product) Reset()

func (*Product) String

func (x *Product) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use ProductId.ProtoReflect.Descriptor instead.

func (*ProductId) GetId

func (x *ProductId) GetId() string

func (*ProductId) ProtoMessage

func (*ProductId) ProtoMessage()

func (*ProductId) ProtoReflect

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

func (*ProductId) Reset

func (x *ProductId) Reset()

func (*ProductId) String

func (x *ProductId) String() string

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use StoreId.ProtoReflect.Descriptor instead.

func (*StoreId) GetId

func (x *StoreId) GetId() string

func (*StoreId) ProtoMessage

func (*StoreId) ProtoMessage()

func (*StoreId) ProtoReflect

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

func (*StoreId) Reset

func (x *StoreId) Reset()

func (*StoreId) String

func (x *StoreId) String() string

type UnimplementedProductServiceServer

type UnimplementedProductServiceServer struct {
}

UnimplementedProductServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedProductServiceServer) Create

func (UnimplementedProductServiceServer) Delete

func (UnimplementedProductServiceServer) GetByFilters

func (UnimplementedProductServiceServer) GetById

func (UnimplementedProductServiceServer) GetBySlug

func (UnimplementedProductServiceServer) GetByStoreId

func (UnimplementedProductServiceServer) Update

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) Descriptor() ([]byte, []int)

Deprecated: Use Variant.ProtoReflect.Descriptor instead.

func (*Variant) GetItems

func (x *Variant) GetItems() []*VariantItem

func (*Variant) GetName

func (x *Variant) GetName() string

func (*Variant) ProtoMessage

func (*Variant) ProtoMessage()

func (*Variant) ProtoReflect

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

func (*Variant) Reset

func (x *Variant) Reset()

func (*Variant) String

func (x *Variant) String() string

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

Jump to

Keyboard shortcuts

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