Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CompanyExists(ctx context.Context, companyName string) (bool, error)
- func (c *Client) GetGameInfoForUpdate(ctx context.Context, igdbID int64) (GameInfoForUpdate, error)
- func (c *Client) GetImageByURL(ctx context.Context, imageURL, imageType string) (GetImageResp, error)
- func (c *Client) GetTopRatedGames(ctx context.Context, platformsIDs []int64, releasedBefore time.Time, ...) ([]TopRatedGames, error)
- type Company
- type CompanyInfo
- type GameInfoForUpdate
- type GetImageResp
- type IDName
- type TokenResp
- type TopRatedGames
- type URL
- type Website
Constants ¶
View Source
const ( ImageTypeThumbAlias = "thumb" ImageTypeCoverBig2xAlias = "cover_big_2x" ImageTypeScreenshotBigAlias = "screenshot_big" )
Image types aliases
View Source
const ( WebsiteTypeOfficial int8 = 1 WebsiteTypeFacebook int8 = 4 WebsiteTypeTwitter int8 = 5 WebsiteTypeTwitch int8 = 6 WebsiteTypeYoutube int8 = 9 WebsiteTypeSteam int8 = 13 WebsiteTypeEpicGames int8 = 16 WebsiteTypeGOG int8 = 17 WebsiteTypeDiscord int8 = 18 )
Website types
Variables ¶
View Source
var WebsiteTypeNames = map[int8]string{ WebsiteTypeOfficial: "Official", WebsiteTypeFacebook: "Facebook", WebsiteTypeTwitter: "Twitter", WebsiteTypeTwitch: "Twitch", WebsiteTypeYoutube: "Youtube", WebsiteTypeSteam: "Steam", WebsiteTypeEpicGames: "EpicGames", WebsiteTypeGOG: "GOG", WebsiteTypeDiscord: "Discord", }
WebsiteTypeNames - mapping of a website type to name
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents dependencies for igdb client
func (*Client) CompanyExists ¶
CompanyExists checks if a company with the given name exists in IGDB (case-insensitive)
func (*Client) GetGameInfoForUpdate ¶
GetGameInfoForUpdate returns game info for update
func (*Client) GetImageByURL ¶
func (c *Client) GetImageByURL(ctx context.Context, imageURL, imageType string) (GetImageResp, error)
GetImageByURL downloads image by url and image type and returns data as io.ReadSeeker and file name
type Company ¶
type Company struct {
Company IDName `json:"company"`
Developer bool `json:"developer"`
Publisher bool `json:"publisher"`
}
Company - company
type CompanyInfo ¶
CompanyInfo - company information from IGDB
type GameInfoForUpdate ¶
type GameInfoForUpdate struct {
ID int64 `json:"id"`
Name string `json:"name"`
TotalRating float64 `json:"total_rating"`
TotalRatingCount int32 `json:"total_rating_count"`
Platforms []int64 `json:"platforms"`
Websites []Website `json:"websites"`
}
GameInfoForUpdate - game info for update
type GetImageResp ¶
GetImageResp - get image response
type TokenResp ¶
type TokenResp struct {
AccessToken string `json:"access_token"`
ExpiresIn int64 `json:"expires_in"`
TokenType string `json:"token_type"`
}
TokenResp - access token response
type TopRatedGames ¶
type TopRatedGames struct {
ID int64 `json:"id"`
Name string `json:"name"`
TotalRating float64 `json:"total_rating"`
TotalRatingCount int32 `json:"total_rating_count"`
Cover URL `json:"cover"`
FirstReleaseDate int64 `json:"first_release_date"`
Genres []IDName `json:"genres"`
InvolvedCompanies []Company `json:"involved_companies"`
Platforms []int64 `json:"platforms"`
Screenshots []URL `json:"screenshots"`
Slug string `json:"slug"`
Summary string `json:"summary"`
Websites []Website `json:"websites"`
}
TopRatedGames - top-rated games
Click to show internal directories.
Click to hide internal directories.