model

package
v0.0.0-...-fbd6a26 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanDB

type CleanDB struct {
	Games         []Game
	ImageBaseUrls map[string]string
}

type Developers

type Developers struct {
	Code   int            `json:"code"`
	Status string         `json:"status"`
	Data   DevelopersData `json:"data"`
}

type DevelopersData

type DevelopersData struct {
	Developers StrLookupItems `json:"developers"`
}

type DumpDb

type DumpDb struct {
	LastEditID int           `json:"last_edit_id"`
	Include    DumpIncludes  `json:"include"`
	Data       DumpGamesData `json:"data"`
}

type DumpGame

type DumpGame struct {
	ID           int              `json:"id"`
	GameTitle    string           `json:"game_title"`
	PlatformID   int              `json:"platform"`
	ReleaseDate  *DumpGamesDbDate `json:"release_date"`
	Overview     *string          `json:"overview"`
	Youtube      *string          `json:"youtube"`
	Players      *int             `json:"players"`
	Coop         *string          `json:"coop"`
	Rating       *string          `json:"rating"`
	DeveloperIDS *[]int           `json:"developers"`
	GenreIDS     *[]int           `json:"genres"`
	PublisherIDS *[]int           `json:"publishers"`
	Alternatives *[]string        `json:"alternatives"`
	Uids         *[]DumpUIDType   `json:"uids"`
}

type DumpGamesData

type DumpGamesData struct {
	Games []DumpGame `json:"games"`
}

type DumpGamesDbDate

type DumpGamesDbDate struct {
	time.Time
}

func (*DumpGamesDbDate) MarshalJSON

func (sd *DumpGamesDbDate) MarshalJSON() ([]byte, error)

func (*DumpGamesDbDate) UnmarshalJSON

func (sd *DumpGamesDbDate) UnmarshalJSON(input []byte) error

type DumpImage

type DumpImage struct {
	Id         int     `json:"id"`
	Type       string  `json:"type"`
	Side       *string `json:"side"`
	Filename   string  `json:"filename"`
	Resolution *string `json:"resolution"`
}

type DumpImagesData

type DumpImagesData struct {
	BaseUrls map[string]string      `json:"base_url"`
	ByGameId map[string][]DumpImage `json:"data"`
}

type DumpIncludes

type DumpIncludes struct {
	Platform DumpPlatformsData `json:"platform"`
	Images   DumpImagesData    `json:"boxart"`
}

type DumpPlatform

type DumpPlatform struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	Alias string `json:"alias"`
}

type DumpPlatformsData

type DumpPlatformsData struct {
	ByGameId map[string]DumpPlatform `json:"data"`
}

type DumpUIDType

type DumpUIDType struct {
	UID                 string `json:"uid"`
	GamesUidsPatternsID int    `json:"games_uids_patterns_id"`
}

type Game

type Game struct {
	ID             int
	Title          string
	Platform       platform
	ReleaseDate    *DumpGamesDbDate
	Overview       NullString
	Youtube        NullString
	Players        NullInt
	IsCoop         NullBool
	Rating         NullString
	Developers     []LookupItem
	Genres         []LookupItem
	Publishers     []LookupItem
	AlternateNames []string
	Uids           []uidType
	Images         []image
}

func NewGame

func NewGame(db *DumpDb, source *DumpGame, genres IntLookupItems, developers IntLookupItems, publishers IntLookupItems) Game

type Genres

type Genres struct {
	Code   int        `json:"code"`
	Status string     `json:"status"`
	Data   GenresData `json:"data"`
}

type GenresData

type GenresData struct {
	Genres StrLookupItems `json:"genres"`
}

type IntLookupItems

type IntLookupItems map[int]LookupItem

type LookupItem

type LookupItem struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type NullBool

type NullBool sql.NullBool

func (*NullBool) MarshalJSON

func (nb *NullBool) MarshalJSON() ([]byte, error)

func (*NullBool) UnmarshalJSON

func (nb *NullBool) UnmarshalJSON(data []byte) error

type NullInt

type NullInt sql.NullInt32

func (*NullInt) MarshalJSON

func (ni *NullInt) MarshalJSON() ([]byte, error)

func (*NullInt) UnmarshalJSON

func (ni *NullInt) UnmarshalJSON(data []byte) error

type NullString

type NullString sql.NullString

func (*NullString) MarshalJSON

func (ns *NullString) MarshalJSON() ([]byte, error)

func (*NullString) UnmarshalJSON

func (ns *NullString) UnmarshalJSON(data []byte) error

type Publishers

type Publishers struct {
	Code   int            `json:"code"`
	Status string         `json:"status"`
	Data   PublishersData `json:"data"`
}

type PublishersData

type PublishersData struct {
	Publishers StrLookupItems `json:"publishers"`
}

type StrLookupItems

type StrLookupItems map[string]LookupItem

Jump to

Keyboard shortcuts

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