Versions in this module Expand all Collapse all v1 v1.1.0 May 5, 2026 v1.0.0 May 3, 2026 Changes in this version + const ImageTypeCover + const ImageTypeScreenshot + const MaxCovers + const MaxGamesPerPublisherPerMonth + const MaxImageSizeKB + const MaxScreenshots + type IGDBAPIClient interface + CompanyExists func(ctx context.Context, companyName string) (bool, error) + type OpenAIClient interface + AnalyzeGameImages func(ctx context.Context, gameData model.ModerationData) (*openaiapi.VisionAnalysisResult, error) + ModerateText func(ctx context.Context, gameData model.ModerationData) (*openaiapi.ModerationResponse, error) + type Provider struct + func NewProvider(logger *zap.Logger, storage Storage, cache *cache.RedisStore, ...) *Provider + func (p *Provider) CompanyExistsInIGDB(ctx context.Context, companyName string) (bool, error) + func (p *Provider) CreateCompany(ctx context.Context, company model.Company) (int32, error) + func (p *Provider) CreateGame(ctx context.Context, cg model.CreateGame) (id int32, err error) + func (p *Provider) CreateModerationRecord(ctx context.Context, gameID int32) (int32, error) + func (p *Provider) DeleteGame(ctx context.Context, id int32, publisher string) error + func (p *Provider) GetCompanies(ctx context.Context) ([]model.Company, error) + func (p *Provider) GetCompaniesMap(ctx context.Context) (map[int32]model.Company, error) + func (p *Provider) GetCompanyByID(ctx context.Context, id int32) (model.Company, error) + func (p *Provider) GetGameByID(ctx context.Context, id int32) (model.Game, error) + func (p *Provider) GetGameModerations(ctx context.Context, gameID int32, publisher string) ([]model.Moderation, error) + func (p *Provider) GetGames(ctx context.Context, page, pageSize uint32, filter model.GamesFilter) (games []model.Game, count uint64, err error) + func (p *Provider) GetGenreByID(ctx context.Context, id int32) (model.Genre, error) + func (p *Provider) GetGenres(ctx context.Context) ([]model.Genre, error) + func (p *Provider) GetGenresMap(ctx context.Context) (map[int32]model.Genre, error) + func (p *Provider) GetPlatformByID(ctx context.Context, id int32) (model.Platform, error) + func (p *Provider) GetPlatforms(ctx context.Context) ([]model.Platform, error) + func (p *Provider) GetPlatformsMap(ctx context.Context) (map[int32]model.Platform, error) + func (p *Provider) GetPublisherGames(ctx context.Context, publisher string) ([]model.Game, error) + func (p *Provider) GetTopCompanies(ctx context.Context, companyType string, limit int64) ([]model.Company, error) + func (p *Provider) GetTopGenres(ctx context.Context, limit int64) ([]model.Genre, error) + func (p *Provider) GetUserRatings(ctx context.Context, userID string) (map[int32]uint8, error) + func (p *Provider) ProcessModeration(ctx context.Context, gameID int32) error + func (p *Provider) RateGame(ctx context.Context, gameID int32, userID string, rating uint8) error + func (p *Provider) UpdateGame(ctx context.Context, id int32, upd model.UpdateGame) error + func (p *Provider) UpdateGameTrendingIndex(ctx context.Context, gameID int32) error + func (p *Provider) UploadGameImages(ctx context.Context, coverFiles, screenshotFiles []*multipart.FileHeader, ...) ([]model.File, error) + type S3Client interface + Upload func(ctx context.Context, data io.ReadSeeker, contentType string, ...) (s3.UploadResult, error) + type Storage interface + AddRating func(ctx context.Context, cr model.CreateRating) error + CreateCompany func(ctx context.Context, c model.Company) (id int32, err error) + CreateGame func(ctx context.Context, cg model.CreateGameData) (id int32, err error) + CreateModerationRecord func(ctx context.Context, m model.CreateModeration) (id int32, err error) + DeleteGame func(ctx context.Context, id int32) error + GetCompanies func(ctx context.Context) (companies []model.Company, err error) + GetCompanyByID func(ctx context.Context, id int32) (company model.Company, err error) + GetCompanyIDByName func(ctx context.Context, name string) (id int32, err error) + GetGameByID func(ctx context.Context, id int32) (game model.Game, err error) + GetGameTrendingData func(ctx context.Context, gameID int32) (model.GameTrendingData, error) + GetGames func(ctx context.Context, pageSize, page uint32, filter model.GamesFilter) (list []model.Game, err error) + GetGamesByPublisherID func(ctx context.Context, publisherID int32) (list []model.Game, err error) + GetGamesCount func(ctx context.Context, filter model.GamesFilter) (count uint64, err error) + GetGenreByID func(ctx context.Context, id int32) (genre model.Genre, err error) + GetGenres func(ctx context.Context) (genres []model.Genre, err error) + GetModerationRecordByGameID func(ctx context.Context, gameID int32) (m model.Moderation, err error) + GetModerationRecordByID func(ctx context.Context, id int32) (m model.Moderation, err error) + GetModerationRecordsByGameID func(ctx context.Context, gameID int32) (list []model.Moderation, err error) + GetPlatformByID func(ctx context.Context, id int32) (platform model.Platform, err error) + GetPlatforms func(ctx context.Context) (platforms []model.Platform, err error) + GetPublisherGamesCount func(ctx context.Context, publisherID int32, startDate, endDate time.Time) (count int, err error) + GetTopDevelopers func(ctx context.Context, limit int64) (companies []model.Company, err error) + GetTopGenres func(ctx context.Context, limit int64) (genres []model.Genre, err error) + GetTopPublishers func(ctx context.Context, limit int64) (companies []model.Company, err error) + GetUserRatings func(ctx context.Context, userID string) (map[int32]uint8, error) + RemoveRating func(ctx context.Context, rr model.RemoveRating) error + RunWithTx func(ctx context.Context, f func(context.Context) error) error + SetModerationRecordResultByGameID func(ctx context.Context, gameID int32, res model.UpdateModerationResult) error + SetModerationRecordsStatus func(ctx context.Context, gameIDs []int32, status model.ModerationStatus) error + UpdateGame func(ctx context.Context, id int32, ug model.UpdateGameData) error + UpdateGameModerationID func(ctx context.Context, gameID, moderationID int32) error + UpdateGameRating func(ctx context.Context, id int32) error + UpdateGameTrendingIndex func(ctx context.Context, gameID int32, trendingIndex float64) error