Documentation ¶
Index ¶
- type FilmRedisRepo
- func (redisRepo *FilmRedisRepo) AddNearFilm(ctx context.Context, active models.NearFilm, lg *slog.Logger) (bool, error)
- func (redisRepo *FilmRedisRepo) CheckActiveNearFilm(ctx context.Context, uid string, fid string, lg *slog.Logger) (bool, error)
- func (redisRepo *FilmRedisRepo) CheckRedisNearFilmConnection(NearFilmCfg configs.DbRedisCfg)
- func (redisRepo *FilmRedisRepo) DeleteNearFilm(ctx context.Context, uid string, fid string, lg *slog.Logger) (bool, error)
- func (redisRepo *FilmRedisRepo) GetNearFilms(ctx context.Context, uid string, lg *slog.Logger) ([]models.NearFilm, error)
- type IFilmsRepo
- type RepoPostgre
- func (repo *RepoPostgre) AddFavoriteFilm(userId uint64, filmId uint64) error
- func (repo *RepoPostgre) AddFilm(film models.FilmItem) error
- func (repo *RepoPostgre) AddRating(filmId uint64, userId uint64, rating uint16) error
- func (repo *RepoPostgre) CheckFilm(userId uint64, filmId uint64) (bool, error)
- func (repo *RepoPostgre) DeleteRating(idUser uint64, idFilm uint64) error
- func (repo *RepoPostgre) FindFilm(title string, dateFrom string, dateTo string, ratingFrom float32, ...) ([]models.FilmItem, error)
- func (repo *RepoPostgre) GetFavoriteFilms(userId uint64, start uint64, end uint64) ([]models.FilmItem, error)
- func (repo *RepoPostgre) GetFilm(filmId uint64) (*models.FilmItem, error)
- func (repo *RepoPostgre) GetFilmId(title string) (uint64, error)
- func (repo *RepoPostgre) GetFilmRating(filmId uint64) (float64, uint64, error)
- func (repo *RepoPostgre) GetFilms(start uint64, end uint64) ([]models.FilmItem, error)
- func (repo *RepoPostgre) GetFilmsByGenre(genre uint64, start uint64, end uint64) ([]models.FilmItem, error)
- func (repo *RepoPostgre) GetLasts(ids []uint64) ([]models.FilmItem, error)
- func (repo *RepoPostgre) HasUsersRating(userId uint64, filmId uint64) (bool, error)
- func (repo *RepoPostgre) RemoveFavoriteFilm(userId uint64, filmId uint64) error
- func (repo *RepoPostgre) Trends() ([]models.FilmItem, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilmRedisRepo ¶
type FilmRedisRepo struct { Connection bool // contains filtered or unexported fields }
func GetFilmRedisRepo ¶
func GetFilmRedisRepo(NearFilmCfg configs.DbRedisCfg, lg *slog.Logger) (*FilmRedisRepo, error)
func (*FilmRedisRepo) AddNearFilm ¶
func (*FilmRedisRepo) CheckActiveNearFilm ¶
func (*FilmRedisRepo) CheckRedisNearFilmConnection ¶
func (redisRepo *FilmRedisRepo) CheckRedisNearFilmConnection(NearFilmCfg configs.DbRedisCfg)
func (*FilmRedisRepo) DeleteNearFilm ¶
type IFilmsRepo ¶
type IFilmsRepo interface { GetFilmsByGenre(genre uint64, start uint64, end uint64) ([]models.FilmItem, error) GetFilms(start uint64, end uint64) ([]models.FilmItem, error) GetFilm(filmId uint64) (*models.FilmItem, error) GetFilmRating(filmId uint64) (float64, uint64, error) FindFilm(title string, dateFrom string, dateTo string, ratingFrom float32, ratingTo float32, mpaa string, genres []uint32, actors []string, first uint64, limit uint64, ) ([]models.FilmItem, error) GetFavoriteFilms(userId uint64, start uint64, end uint64) ([]models.FilmItem, error) AddFavoriteFilm(userId uint64, filmId uint64) error RemoveFavoriteFilm(userId uint64, filmId uint64) error CheckFilm(userId uint64, filmId uint64) (bool, error) AddRating(filmId uint64, userId uint64, rating uint16) error HasUsersRating(userId uint64, filmId uint64) (bool, error) AddFilm(film models.FilmItem) error GetFilmId(title string) (uint64, error) DeleteRating(idUser uint64, idFilm uint64) error Trends() ([]models.FilmItem, error) GetLasts(ids []uint64) ([]models.FilmItem, error) }
type RepoPostgre ¶
type RepoPostgre struct {
// contains filtered or unexported fields
}
func GetFilmRepo ¶
func (*RepoPostgre) AddFavoriteFilm ¶
func (repo *RepoPostgre) AddFavoriteFilm(userId uint64, filmId uint64) error
func (*RepoPostgre) AddRating ¶
func (repo *RepoPostgre) AddRating(filmId uint64, userId uint64, rating uint16) error
func (*RepoPostgre) CheckFilm ¶
func (repo *RepoPostgre) CheckFilm(userId uint64, filmId uint64) (bool, error)
func (*RepoPostgre) DeleteRating ¶
func (repo *RepoPostgre) DeleteRating(idUser uint64, idFilm uint64) error
func (*RepoPostgre) GetFavoriteFilms ¶
func (*RepoPostgre) GetFilm ¶
func (repo *RepoPostgre) GetFilm(filmId uint64) (*models.FilmItem, error)
func (*RepoPostgre) GetFilmRating ¶
func (repo *RepoPostgre) GetFilmRating(filmId uint64) (float64, uint64, error)
func (*RepoPostgre) GetFilmsByGenre ¶
func (*RepoPostgre) GetLasts ¶
func (repo *RepoPostgre) GetLasts(ids []uint64) ([]models.FilmItem, error)
func (*RepoPostgre) HasUsersRating ¶
func (repo *RepoPostgre) HasUsersRating(userId uint64, filmId uint64) (bool, error)
func (*RepoPostgre) RemoveFavoriteFilm ¶
func (repo *RepoPostgre) RemoveFavoriteFilm(userId uint64, filmId uint64) error
Click to show internal directories.
Click to hide internal directories.