Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProductListToGrpc ¶
func ProductListToGrpc(products *ProductsList) *readerService.SearchRes
func ProductToGrpcMessage ¶
func ProductToGrpcMessage(product *Product) *readerService.Product
Types ¶
type Product ¶
type Product struct { ProductID string `json:"productId" bson:"_id,omitempty"` Name string `json:"name,omitempty" bson:"name,omitempty" validate:"required,min=3,max=250"` Description string `json:"description,omitempty" bson:"description,omitempty" validate:"required,min=3,max=500"` Price float64 `json:"price,omitempty" bson:"price,omitempty" validate:"required"` CreatedAt time.Time `json:"createdAt,omitempty" bson:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty" bson:"updatedAt,omitempty"` }
type ProductsList ¶
type ProductsList struct { TotalCount int64 `json:"totalCount" bson:"totalCount"` TotalPages int64 `json:"totalPages" bson:"totalPages"` Page int64 `json:"page" bson:"page"` Size int64 `json:"size" bson:"size"` HasMore bool `json:"hasMore" bson:"hasMore"` Products []*Product `json:"products" bson:"products"` }
ProductsList products list response with pagination
func NewProductListWithPagination ¶
func NewProductListWithPagination(products []*Product, count int64, pagination *utils.Pagination) *ProductsList
Click to show internal directories.
Click to hide internal directories.