Documentation
¶
Index ¶
- Constants
- func GetGameSlug(name string) string
- type Company
- type CreateGame
- type CreateGameData
- type CreateRating
- type File
- type Game
- type GamesFilter
- type Genre
- type OrderBy
- type Platform
- type RemoveRating
- type SortOrder
- type Task
- type TaskInfo
- type TaskSettings
- type TaskStatus
- type UpdateGame
- type UpdateGameData
- type UserRating
Constants ¶
const ( CompanyTypeDeveloper = "dev" CompanyTypePublisher = "pub" )
company types
const ( // ModerationStatusReady represents a game that is ready ModerationStatusReady = "ready" // ModerationStatusCheck represents a game that needs moderation ModerationStatusCheck = "check" // ModerationStatusRecheck represents a game that needs moderation after update ModerationStatusRecheck = "recheck" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Company ¶
type Company struct { ID int32 `db:"id"` Name string `db:"name"` IGDBID sql.NullInt64 `db:"igdb_id"` }
Company represents company entity
type CreateGame ¶
type CreateGame struct { Name string ReleaseDate string GenresIDs []int32 LogoURL string Summary string Slug string PlatformsIDs []int32 Screenshots []string Websites []string Developer string // helper field Publisher string // helper field }
CreateGame - create game data
func (CreateGame) MapToCreateGameData ¶
func (cg CreateGame) MapToCreateGameData(publisherID, developerID int32) CreateGameData
MapToCreateGameData maps CreateGame to CreateGameData
type CreateGameData ¶
type CreateGameData struct { Name string DevelopersIDs []int32 PublishersIDs []int32 ReleaseDate string GenresIDs []int32 LogoURL string Summary string Slug string PlatformsIDs []int32 Screenshots []string Websites []string IGDBRating float64 IGDBID int64 ModerationStatus string }
CreateGameData - data for creating game in db
type CreateRating ¶
CreateRating represents data for rating a game
type Game ¶
type Game struct { ID int32 `db:"id"` Name string `db:"name"` DevelopersIDs []int32 `db:"developers"` PublishersIDs []int32 `db:"publishers"` ReleaseDate types.Date `db:"release_date"` GenresIDs []int32 `db:"genres"` LogoURL string `db:"logo_url"` Rating float64 `db:"rating"` Summary string `db:"summary"` Slug string `db:"slug"` PlatformsIDs []int32 `db:"platforms"` Screenshots []string `db:"screenshots"` Websites []string `db:"websites"` IGDBRating float64 `db:"igdb_rating"` IGDBID int64 `db:"igdb_id"` ModerationStatus string `db:"moderation_status"` Weight float64 `db:"weight"` // Readonly field }
Game - db game model
type GamesFilter ¶
type GamesFilter struct { Name string DeveloperID int32 PublisherID int32 GenreID int32 OrderBy OrderBy }
GamesFilter - games filter
type Platform ¶
type Platform struct { ID int32 `db:"id"` Name string `db:"name"` Abbreviation string `db:"abbreviation"` IGDBID int64 `db:"igdb_id"` }
Platform represents platform entity
type RemoveRating ¶
RemoveRating represents data for removing game rating
type Task ¶
type Task struct { Name string `db:"name"` Status TaskStatus `db:"status"` RunCount int64 `db:"run_count"` LastRun sql.NullTime `db:"last_run"` Settings TaskSettings `db:"settings"` }
Task represents task entity
type TaskSettings ¶
type TaskSettings []byte
TaskSettings task settings value
func (*TaskSettings) Scan ¶
func (ts *TaskSettings) Scan(src interface{}) error
Scan implements sql.Scanner interface
type TaskStatus ¶
type TaskStatus string
TaskStatus represents task status type
const ( IdleTaskStatus TaskStatus = "idle" RunningTaskStatus TaskStatus = "running" ErrorTaskStatus TaskStatus = "error" )
Task status values
type UpdateGame ¶
type UpdateGame struct { Name *string Developer *string Publisher string ReleaseDate *string GenresIDs *[]int32 LogoURL *string Summary *string PlatformsIDs *[]int32 Screenshots *[]string Websites *[]string }
UpdateGame - update game fields
func (UpdateGame) MapToUpdateGameData ¶
func (ug UpdateGame) MapToUpdateGameData(g Game, developersIDs []int32) UpdateGameData
MapToUpdateGameData maps UpdateGame and Game to UpdateGameData
type UpdateGameData ¶
type UpdateGameData struct { Name string Developers []int32 Publishers []int32 ReleaseDate string Genres []int32 LogoURL string Summary string Slug string PlatformsIDs []int32 Screenshots []string Websites []string ModerationStatus string IGDBRating float64 }
UpdateGameData - data for updating game in db
type UserRating ¶
type UserRating struct { GameID int32 `db:"game_id"` UserID string `db:"user_id"` Rating uint8 `db:"rating"` }
UserRating represents user rating entity