Documentation ¶
Index ¶
- func NewSessionPostgresqlRepository(db *sql.DB) product.Repository
- type PostgresqlRepository
- func (r *PostgresqlRepository) CreateFilterString(filter *models.ProductFilter) string
- func (r *PostgresqlRepository) CreateSortString(sortKey, sortDirection string) (string, error)
- func (r *PostgresqlRepository) GetCountPages(category uint64, count int, filterString string) (int, error)
- func (r *PostgresqlRepository) GetCountSearchPages(category uint64, count int, searchString, filterString string) (int, error)
- func (r *PostgresqlRepository) SearchRangeProducts(searchQuery *models.SearchQuery, sortString, filterString string) ([]*models.ViewProduct, error)
- func (r *PostgresqlRepository) SelectProductById(productId uint64) (*models.Product, error)
- func (r *PostgresqlRepository) SelectRangeProducts(paginator *models.PaginatorProducts, sortString, filterString string) ([]*models.ViewProduct, error)
- func (r *PostgresqlRepository) SelectRecommendationsByReviews(productId uint64, count int) ([]*models.RecommendationProduct, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSessionPostgresqlRepository ¶
func NewSessionPostgresqlRepository(db *sql.DB) product.Repository
Types ¶
type PostgresqlRepository ¶
type PostgresqlRepository struct {
// contains filtered or unexported fields
}
func (*PostgresqlRepository) CreateFilterString ¶
func (r *PostgresqlRepository) CreateFilterString(filter *models.ProductFilter) string
Create filter string from filter options
func (*PostgresqlRepository) CreateSortString ¶
func (r *PostgresqlRepository) CreateSortString(sortKey, sortDirection string) (string, error)
Create sort string from paginator options
func (*PostgresqlRepository) GetCountPages ¶
func (r *PostgresqlRepository) GetCountPages(category uint64, count int, filterString string) (int, error)
Get count of all pages for this category
func (*PostgresqlRepository) GetCountSearchPages ¶
func (r *PostgresqlRepository) GetCountSearchPages(category uint64, count int, searchString, filterString string) (int, error)
Get count of all pages for this search
func (*PostgresqlRepository) SearchRangeProducts ¶
func (r *PostgresqlRepository) SearchRangeProducts(searchQuery *models.SearchQuery, sortString, filterString string) ([]*models.ViewProduct, error)
Find list of products by query string
func (*PostgresqlRepository) SelectProductById ¶
func (r *PostgresqlRepository) SelectProductById(productId uint64) (*models.Product, error)
Select one product by id
func (*PostgresqlRepository) SelectRangeProducts ¶
func (r *PostgresqlRepository) SelectRangeProducts(paginator *models.PaginatorProducts, sortString, filterString string) ([]*models.ViewProduct, error)
Select range of products by paginate settings
func (*PostgresqlRepository) SelectRecommendationsByReviews ¶
func (r *PostgresqlRepository) SelectRecommendationsByReviews(productId uint64, count int) ( []*models.RecommendationProduct, error)
Click to show internal directories.
Click to hide internal directories.