repository

package
v0.0.0-...-90e0d95 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

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