Documentation ¶
Index ¶
- Constants
- Variables
- func SizedImageURL(imageID string, size imageSize, ratio int) (string, error)
- type AgeRating
- type AgeRatingCategory
- type AgeRatingContent
- type AgeRatingContentCategory
- type AgeRatingContentService
- func (as *AgeRatingContentService) Count(opts ...Option) (int, error)
- func (as *AgeRatingContentService) Fields() ([]string, error)
- func (as *AgeRatingContentService) Get(id int, opts ...Option) (*AgeRatingContent, error)
- func (as *AgeRatingContentService) Index(opts ...Option) ([]*AgeRatingContent, error)
- func (as *AgeRatingContentService) List(ids []int, opts ...Option) ([]*AgeRatingContent, error)
- type AgeRatingEnum
- type AgeRatingService
- func (as *AgeRatingService) Count(opts ...Option) (int, error)
- func (as *AgeRatingService) Fields() ([]string, error)
- func (as *AgeRatingService) Get(id int, opts ...Option) (*AgeRating, error)
- func (as *AgeRatingService) Index(opts ...Option) ([]*AgeRating, error)
- func (as *AgeRatingService) List(ids []int, opts ...Option) ([]*AgeRating, error)
- type AlternativeName
- type AlternativeNameService
- func (as *AlternativeNameService) Count(opts ...Option) (int, error)
- func (as *AlternativeNameService) Fields() ([]string, error)
- func (as *AlternativeNameService) Get(id int, opts ...Option) (*AlternativeName, error)
- func (as *AlternativeNameService) Index(opts ...Option) ([]*AlternativeName, error)
- func (as *AlternativeNameService) List(ids []int, opts ...Option) ([]*AlternativeName, error)
- type Artwork
- type ArtworkService
- func (as *ArtworkService) Count(opts ...Option) (int, error)
- func (as *ArtworkService) Fields() ([]string, error)
- func (as *ArtworkService) Get(id int, opts ...Option) (*Artwork, error)
- func (as *ArtworkService) Index(opts ...Option) ([]*Artwork, error)
- func (as *ArtworkService) List(ids []int, opts ...Option) ([]*Artwork, error)
- type Character
- type CharacterGender
- type CharacterMugshot
- type CharacterMugshotService
- func (cs *CharacterMugshotService) Count(opts ...Option) (int, error)
- func (cs *CharacterMugshotService) Fields() ([]string, error)
- func (cs *CharacterMugshotService) Get(id int, opts ...Option) (*CharacterMugshot, error)
- func (cs *CharacterMugshotService) Index(opts ...Option) ([]*CharacterMugshot, error)
- func (cs *CharacterMugshotService) List(ids []int, opts ...Option) ([]*CharacterMugshot, error)
- type CharacterService
- func (cs *CharacterService) Count(opts ...Option) (int, error)
- func (cs *CharacterService) Fields() ([]string, error)
- func (cs *CharacterService) Get(id int, opts ...Option) (*Character, error)
- func (cs *CharacterService) Index(opts ...Option) ([]*Character, error)
- func (cs *CharacterService) List(ids []int, opts ...Option) ([]*Character, error)
- func (cs *CharacterService) Search(qry string, opts ...Option) ([]*Character, error)
- type CharacterSpecies
- type Client
- type Collection
- type CollectionService
- func (cs *CollectionService) Count(opts ...Option) (int, error)
- func (cs *CollectionService) Fields() ([]string, error)
- func (cs *CollectionService) Get(id int, opts ...Option) (*Collection, error)
- func (cs *CollectionService) Index(opts ...Option) ([]*Collection, error)
- func (cs *CollectionService) List(ids []int, opts ...Option) ([]*Collection, error)
- func (cs *CollectionService) Search(qry string, opts ...Option) ([]*Collection, error)
- type Company
- type CompanyLogo
- type CompanyLogoService
- func (cs *CompanyLogoService) Count(opts ...Option) (int, error)
- func (cs *CompanyLogoService) Fields() ([]string, error)
- func (cs *CompanyLogoService) Get(id int, opts ...Option) (*CompanyLogo, error)
- func (cs *CompanyLogoService) Index(opts ...Option) ([]*CompanyLogo, error)
- func (cs *CompanyLogoService) List(ids []int, opts ...Option) ([]*CompanyLogo, error)
- type CompanyService
- func (cs *CompanyService) Count(opts ...Option) (int, error)
- func (cs *CompanyService) Fields() ([]string, error)
- func (cs *CompanyService) Get(id int, opts ...Option) (*Company, error)
- func (cs *CompanyService) Index(opts ...Option) ([]*Company, error)
- func (cs *CompanyService) List(ids []int, opts ...Option) ([]*Company, error)
- type CompanyWebsite
- type CompanyWebsiteService
- func (zs *CompanyWebsiteService) Count(opts ...Option) (int, error)
- func (zs *CompanyWebsiteService) Fields() ([]string, error)
- func (zs *CompanyWebsiteService) Get(id int, opts ...Option) (*CompanyWebsite, error)
- func (zs *CompanyWebsiteService) Index(opts ...Option) ([]*CompanyWebsite, error)
- func (zs *CompanyWebsiteService) List(ids []int, opts ...Option) ([]*CompanyWebsite, error)
- type Count
- type Cover
- type CoverService
- func (cs *CoverService) Count(opts ...Option) (int, error)
- func (cs *CoverService) Fields() ([]string, error)
- func (cs *CoverService) Get(id int, opts ...Option) (*Cover, error)
- func (cs *CoverService) Index(opts ...Option) ([]*Cover, error)
- func (cs *CoverService) List(ids []int, opts ...Option) ([]*Cover, error)
- type DateCategory
- type ExternalGame
- type ExternalGameCategory
- type ExternalGameService
- func (es *ExternalGameService) Count(opts ...Option) (int, error)
- func (es *ExternalGameService) Fields() ([]string, error)
- func (es *ExternalGameService) Get(id int, opts ...Option) (*ExternalGame, error)
- func (es *ExternalGameService) Index(opts ...Option) ([]*ExternalGame, error)
- func (es *ExternalGameService) List(ids []int, opts ...Option) ([]*ExternalGame, error)
- type Franchise
- type FranchiseService
- func (fs *FranchiseService) Count(opts ...Option) (int, error)
- func (fs *FranchiseService) Fields() ([]string, error)
- func (fs *FranchiseService) Get(id int, opts ...Option) (*Franchise, error)
- func (fs *FranchiseService) Index(opts ...Option) ([]*Franchise, error)
- func (fs *FranchiseService) List(ids []int, opts ...Option) ([]*Franchise, error)
- type Game
- type GameCategory
- type GameEngine
- type GameEngineLogo
- type GameEngineLogoService
- func (gs *GameEngineLogoService) Count(opts ...Option) (int, error)
- func (gs *GameEngineLogoService) Fields() ([]string, error)
- func (gs *GameEngineLogoService) Get(id int, opts ...Option) (*GameEngineLogo, error)
- func (gs *GameEngineLogoService) Index(opts ...Option) ([]*GameEngineLogo, error)
- func (gs *GameEngineLogoService) List(ids []int, opts ...Option) ([]*GameEngineLogo, error)
- type GameEngineService
- func (gs *GameEngineService) Count(opts ...Option) (int, error)
- func (gs *GameEngineService) Fields() ([]string, error)
- func (gs *GameEngineService) Get(id int, opts ...Option) (*GameEngine, error)
- func (gs *GameEngineService) Index(opts ...Option) ([]*GameEngine, error)
- func (gs *GameEngineService) List(ids []int, opts ...Option) ([]*GameEngine, error)
- type GameMode
- type GameModeService
- func (gs *GameModeService) Count(opts ...Option) (int, error)
- func (gs *GameModeService) Fields() ([]string, error)
- func (gs *GameModeService) Get(id int, opts ...Option) (*GameMode, error)
- func (gs *GameModeService) Index(opts ...Option) ([]*GameMode, error)
- func (gs *GameModeService) List(ids []int, opts ...Option) ([]*GameMode, error)
- type GameService
- func (gs *GameService) Count(opts ...Option) (int, error)
- func (gs *GameService) Fields() ([]string, error)
- func (gs *GameService) Get(id int, opts ...Option) (*Game, error)
- func (gs *GameService) Index(opts ...Option) ([]*Game, error)
- func (gs *GameService) List(ids []int, opts ...Option) ([]*Game, error)
- func (gs *GameService) Search(qry string, opts ...Option) ([]*Game, error)
- type GameStatus
- type GameVersion
- type GameVersionFeature
- type GameVersionFeatureService
- func (gs *GameVersionFeatureService) Count(opts ...Option) (int, error)
- func (gs *GameVersionFeatureService) Fields() ([]string, error)
- func (gs *GameVersionFeatureService) Get(id int, opts ...Option) (*GameVersionFeature, error)
- func (gs *GameVersionFeatureService) Index(opts ...Option) ([]*GameVersionFeature, error)
- func (gs *GameVersionFeatureService) List(ids []int, opts ...Option) ([]*GameVersionFeature, error)
- type GameVersionFeatureValue
- type GameVersionFeatureValueService
- func (gs *GameVersionFeatureValueService) Count(opts ...Option) (int, error)
- func (gs *GameVersionFeatureValueService) Fields() ([]string, error)
- func (gs *GameVersionFeatureValueService) Get(id int, opts ...Option) (*GameVersionFeatureValue, error)
- func (gs *GameVersionFeatureValueService) Index(opts ...Option) ([]*GameVersionFeatureValue, error)
- func (gs *GameVersionFeatureValueService) List(ids []int, opts ...Option) ([]*GameVersionFeatureValue, error)
- type GameVersionService
- func (gs *GameVersionService) Count(opts ...Option) (int, error)
- func (gs *GameVersionService) Fields() ([]string, error)
- func (gs *GameVersionService) Get(id int, opts ...Option) (*GameVersion, error)
- func (gs *GameVersionService) Index(opts ...Option) ([]*GameVersion, error)
- func (gs *GameVersionService) List(ids []int, opts ...Option) ([]*GameVersion, error)
- type GameVideo
- type GameVideoService
- func (gs *GameVideoService) Count(opts ...Option) (int, error)
- func (gs *GameVideoService) Fields() ([]string, error)
- func (gs *GameVideoService) Get(id int, opts ...Option) (*GameVideo, error)
- func (gs *GameVideoService) Index(opts ...Option) ([]*GameVideo, error)
- func (gs *GameVideoService) List(ids []int, opts ...Option) ([]*GameVideo, error)
- type Genre
- type GenreService
- func (gs *GenreService) Count(opts ...Option) (int, error)
- func (gs *GenreService) Fields() ([]string, error)
- func (gs *GenreService) Get(id int, opts ...Option) (*Genre, error)
- func (gs *GenreService) Index(opts ...Option) ([]*Genre, error)
- func (gs *GenreService) List(ids []int, opts ...Option) ([]*Genre, error)
- type Image
- type InvolvedCompany
- type InvolvedCompanyService
- func (is *InvolvedCompanyService) Count(opts ...Option) (int, error)
- func (is *InvolvedCompanyService) Fields() ([]string, error)
- func (is *InvolvedCompanyService) Get(id int, opts ...Option) (*InvolvedCompany, error)
- func (is *InvolvedCompanyService) Index(opts ...Option) ([]*InvolvedCompany, error)
- func (is *InvolvedCompanyService) List(ids []int, opts ...Option) ([]*InvolvedCompany, error)
- type Keyword
- type KeywordService
- func (ks *KeywordService) Count(opts ...Option) (int, error)
- func (ks *KeywordService) Fields() ([]string, error)
- func (ks *KeywordService) Get(id int, opts ...Option) (*Keyword, error)
- func (ks *KeywordService) Index(opts ...Option) ([]*Keyword, error)
- func (ks *KeywordService) List(ids []int, opts ...Option) ([]*Keyword, error)
- type MultiplayerMode
- type MultiplayerModeService
- func (ms *MultiplayerModeService) Count(opts ...Option) (int, error)
- func (ms *MultiplayerModeService) Fields() ([]string, error)
- func (ms *MultiplayerModeService) Get(id int, opts ...Option) (*MultiplayerMode, error)
- func (ms *MultiplayerModeService) Index(opts ...Option) ([]*MultiplayerMode, error)
- func (ms *MultiplayerModeService) List(ids []int, opts ...Option) ([]*MultiplayerMode, error)
- type Option
- type Platform
- type PlatformCategory
- type PlatformFamily
- type PlatformFamilyService
- func (ps *PlatformFamilyService) Count(opts ...Option) (int, error)
- func (ps *PlatformFamilyService) Fields() ([]string, error)
- func (ps *PlatformFamilyService) Get(id int, opts ...Option) (*PlatformFamily, error)
- func (ps *PlatformFamilyService) Index(opts ...Option) ([]*PlatformFamily, error)
- func (ps *PlatformFamilyService) List(ids []int, opts ...Option) ([]*PlatformFamily, error)
- type PlatformLogo
- type PlatformLogoService
- func (ps *PlatformLogoService) Count(opts ...Option) (int, error)
- func (ps *PlatformLogoService) Fields() ([]string, error)
- func (ps *PlatformLogoService) Get(id int, opts ...Option) (*PlatformLogo, error)
- func (ps *PlatformLogoService) Index(opts ...Option) ([]*PlatformLogo, error)
- func (ps *PlatformLogoService) List(ids []int, opts ...Option) ([]*PlatformLogo, error)
- type PlatformService
- func (ps *PlatformService) Count(opts ...Option) (int, error)
- func (ps *PlatformService) Fields() ([]string, error)
- func (ps *PlatformService) Get(id int, opts ...Option) (*Platform, error)
- func (ps *PlatformService) Index(opts ...Option) ([]*Platform, error)
- func (ps *PlatformService) List(ids []int, opts ...Option) ([]*Platform, error)
- func (ps *PlatformService) Search(qry string, opts ...Option) ([]*Platform, error)
- type PlatformVersion
- type PlatformVersionCompany
- type PlatformVersionCompanyService
- func (ps *PlatformVersionCompanyService) Count(opts ...Option) (int, error)
- func (ps *PlatformVersionCompanyService) Fields() ([]string, error)
- func (ps *PlatformVersionCompanyService) Get(id int, opts ...Option) (*PlatformVersionCompany, error)
- func (ps *PlatformVersionCompanyService) Index(opts ...Option) ([]*PlatformVersionCompany, error)
- func (ps *PlatformVersionCompanyService) List(ids []int, opts ...Option) ([]*PlatformVersionCompany, error)
- type PlatformVersionReleaseDate
- type PlatformVersionReleaseDateService
- func (ps *PlatformVersionReleaseDateService) Count(opts ...Option) (int, error)
- func (ps *PlatformVersionReleaseDateService) Fields() ([]string, error)
- func (ps *PlatformVersionReleaseDateService) Get(id int, opts ...Option) (*PlatformVersionReleaseDate, error)
- func (ps *PlatformVersionReleaseDateService) Index(opts ...Option) ([]*PlatformVersionReleaseDate, error)
- func (ps *PlatformVersionReleaseDateService) List(ids []int, opts ...Option) ([]*PlatformVersionReleaseDate, error)
- type PlatformVersionService
- func (ps *PlatformVersionService) Count(opts ...Option) (int, error)
- func (ps *PlatformVersionService) Fields() ([]string, error)
- func (ps *PlatformVersionService) Get(id int, opts ...Option) (*PlatformVersion, error)
- func (ps *PlatformVersionService) Index(opts ...Option) ([]*PlatformVersion, error)
- func (ps *PlatformVersionService) List(ids []int, opts ...Option) ([]*PlatformVersion, error)
- type PlatformWebsite
- type PlatformWebsiteService
- func (ps *PlatformWebsiteService) Count(opts ...Option) (int, error)
- func (ps *PlatformWebsiteService) Fields() ([]string, error)
- func (ps *PlatformWebsiteService) Get(id int, opts ...Option) (*PlatformWebsite, error)
- func (ps *PlatformWebsiteService) Index(opts ...Option) ([]*PlatformWebsite, error)
- func (ps *PlatformWebsiteService) List(ids []int, opts ...Option) ([]*PlatformWebsite, error)
- type PlayerPerspective
- type PlayerPerspectiveService
- func (ps *PlayerPerspectiveService) Count(opts ...Option) (int, error)
- func (ps *PlayerPerspectiveService) Fields() ([]string, error)
- func (ps *PlayerPerspectiveService) Get(id int, opts ...Option) (*PlayerPerspective, error)
- func (ps *PlayerPerspectiveService) Index(opts ...Option) ([]*PlayerPerspective, error)
- func (ps *PlayerPerspectiveService) List(ids []int, opts ...Option) ([]*PlayerPerspective, error)
- type RegionCategory
- type ReleaseDate
- type ReleaseDateService
- func (rs *ReleaseDateService) Count(opts ...Option) (int, error)
- func (rs *ReleaseDateService) Fields() ([]string, error)
- func (rs *ReleaseDateService) Get(id int, opts ...Option) (*ReleaseDate, error)
- func (rs *ReleaseDateService) Index(opts ...Option) ([]*ReleaseDate, error)
- func (rs *ReleaseDateService) List(ids []int, opts ...Option) ([]*ReleaseDate, error)
- type Screenshot
- type ScreenshotService
- func (ss *ScreenshotService) Count(opts ...Option) (int, error)
- func (ss *ScreenshotService) Fields() ([]string, error)
- func (ss *ScreenshotService) Get(id int, opts ...Option) (*Screenshot, error)
- func (ss *ScreenshotService) Index(opts ...Option) ([]*Screenshot, error)
- func (ss *ScreenshotService) List(ids []int, opts ...Option) ([]*Screenshot, error)
- type SearchResult
- type ServerError
- type Tag
- type Theme
- type ThemeService
- func (ts *ThemeService) Count(opts ...Option) (int, error)
- func (ts *ThemeService) Fields() ([]string, error)
- func (ts *ThemeService) Get(id int, opts ...Option) (*Theme, error)
- func (ts *ThemeService) Index(opts ...Option) ([]*Theme, error)
- func (ts *ThemeService) List(ids []int, opts ...Option) ([]*Theme, error)
- func (ts *ThemeService) Search(qry string, opts ...Option) ([]*Theme, error)
- type VersionFeatureCategory
- type VersionFeatureInclusion
- type Website
- type WebsiteCategory
- type WebsiteService
- func (ws *WebsiteService) Count(opts ...Option) (int, error)
- func (ws *WebsiteService) Fields() ([]string, error)
- func (ws *WebsiteService) Get(id int, opts ...Option) (*Website, error)
- func (ws *WebsiteService) Index(opts ...Option) ([]*Website, error)
- func (ws *WebsiteService) List(ids []int, opts ...Option) ([]*Website, error)
Examples ¶
Constants ¶
const ( EndpointAgeRating endpoint = "age_ratings/" EndpointAgeRatingContent endpoint = "age_rating_content_descriptions/" EndpointAlternativeName endpoint = "alternative_names/" EndpointArtwork endpoint = "artworks/" EndpointCharacter endpoint = "characters/" EndpointCharacterMugshot endpoint = "character_mug_shots/" EndpointCollection endpoint = "collections/" EndpointCompany endpoint = "companies/" EndpointCompanyLogo endpoint = "company_logos/" EndpointCompanyWebsite endpoint = "company_websites/" EndpointCover endpoint = "covers/" EndpointExternalGame endpoint = "external_games/" EndpointFranchise endpoint = "franchises/" EndpointGame endpoint = "games/" EndpointGameEngine endpoint = "game_engines/" EndpointGameEngineLogo endpoint = "game_engine_logos/" EndpointGameMode endpoint = "game_modes/" EndpointGameVersion endpoint = "game_versions/" EndpointGameVersionFeature endpoint = "game_version_features/" EndpointGameVersionFeatureValue endpoint = "game_version_feature_values/" EndpointGameVideo endpoint = "game_videos/" EndpointGenre endpoint = "genres/" EndpointInvolvedCompany endpoint = "involved_companies/" EndpointKeyword endpoint = "keywords/" EndpointMultiplayerMode endpoint = "multiplayer_modes/" EndpointPlatform endpoint = "platforms/" EndpointPlatformLogo endpoint = "platform_logos/" EndpointPlatformVersion endpoint = "platform_versions/" EndpointPlatformVersionCompany endpoint = "platform_version_companies/" EndpointPlatformVersionReleaseDate endpoint = "platform_version_release_dates/" EndpointPlatformWebsite endpoint = "platform_websites/" EndpointPlayerPerspective endpoint = "player_perspectives/" EndpointPlatformFamily endpoint = "product_families/" EndpointPulse endpoint = "pulses/" EndpointReleaseDate endpoint = "release_dates/" EndpointScreenshot endpoint = "screenshots/" EndpointSearch endpoint = "search/" EndpointTheme endpoint = "themes/" EndpointTitle endpoint = "titles/" EndpointWebsite endpoint = "websites/" )
Public IGDB API endpoints
const ( // SizeCoverSmall is sized at 90x128. SizeCoverSmall imageSize = "cover_small" // SizeCoverBig is sized at 227x320. SizeCoverBig imageSize = "cover_big" // SizeScreenshotMed is sized at 569x320. SizeScreenshotMed imageSize = "screenshot_med" // SizeScreenshotBig is sized at 889x500 SizeScreenshotBig imageSize = "screenshot_big" // SizeScreenshotHuge is sized at 1280x720. SizeScreenshotHuge imageSize = "screenshot_huge" // SizeLogoMed is sized at 284x160. SizeLogoMed imageSize = "logo_med" // SizeMicro is sized at 35x35. SizeMicro imageSize = "micro" // SizeThumb is sized at 90x90. SizeThumb imageSize = "thumb" // Size720p is sized at 1280x720. Size720p imageSize = "720p" // Size1080p is sized at 1920x1080. Size1080p imageSize = "1080p" )
Available image sizes supported by the IGDB API
const ( // OrderAscending is used as an argument in the SetOrder functional // option to organize the results from an API call in ascending order. OrderAscending order = "asc" // OrderDescending is used as an argument in the SetOrder functional // option to organize the results from an API call in descending order. OrderDescending order = "desc" )
Available orders for the functional option SetOrder
const ( // OpEquals checks for equality. Must match exactly. OpEquals operator = "%s = %s" // OpNotEquals checks for inequality. Any non-exact match. OpNotEquals operator = "%s != %s" // OpGreaterThan checks if a field value is greater than a given value. Only works on numbers. OpGreaterThan operator = "%s > %s" // OpGreaterThanEqual checks if a field value is greater than or equal to a given value. Only works on numbers. OpGreaterThanEqual operator = "%s >= %s" // OpLessThan checks if a field value is less than a given value. Only works on numbers. OpLessThan operator = "%s < %s" // OpLessThanEqual checks if a field value is less than or equal to a given value. Only works on numbers. OpLessThanEqual operator = "%s <= %s" // OpContainsAll checks if the given value exists in within the array. OpContainsAll operator = "%s = [%s]" // OpNotContainsAll checks if the given value does not exist in within the array. OpNotContainsAll operator = "%s != [%s]" // OpContainsAtLeast checks if any of the given values exist within the array. OpContainsAtLeast operator = "%s = (%s)" // OpNotContainsAtLeast checks if any of the given values do not exist within the array. OpNotContainsAtLeast operator = "%s != (%s)" // OpContainsExactly checks if the the given values exactly match the array. OpContainsExactly operator = "%s = {%s}" )
Available operators for the functional option SetFilter
const ( TagTheme tagType = iota TagGenre TagKeyword TagGame TagPerspective )
These tagTypes correspond to their respective IGDB Object Type IDs.
For the list of these IDs and other information, visit: https://igdb.github.io/api/references/tag-numbers/
Variables ¶
var ( // ErrNegativeID occurs when a negative ID is used as an argument in an API call. ErrNegativeID = errors.New("ID cannot be negative") // ErrEmptyIDs occurs when a List function is called without a populated int slice. ErrEmptyIDs = errors.New("IDs argument empty") // ErrNoResults occurs when the IGDB returns an empty array, void of results. ErrNoResults = errors.New("results are empty") )
var ( // ErrBadRequest occurs when a request is malformed. ErrBadRequest = ServerError{ Status: http.StatusBadRequest, Msg: "bad request: check query parameters", Temp: false, } ErrUnauthorized = ServerError{ Status: http.StatusUnauthorized, Msg: "authentication failed: check for valid API key in user-key header", Temp: false, } // ErrForbidden occurs when a request is made without authorization. ErrForbidden = ServerError{ Status: http.StatusForbidden, Msg: "authentication failed: check for valid API key in user-key header", Temp: false, } // ErrInternalError occurs when an unexpected IGDB server error occurs and should be reported. ErrInternalError = ServerError{ Status: http.StatusInternalServerError, Msg: "internal error: report bug", Temp: false, } // ErrManyRequests occurs when request rate exceeds 4 per second. // For full information, visit https://api-docs.igdb.com/#rate-limits ErrManyRequests = ServerError{ Status: http.StatusTooManyRequests, Msg: "too many requests", Temp: true, } )
Errors returned when encountering error status codes.
var ( // ErrBlankID occurs when an empty string is used as an argument. ErrBlankID = errors.New("image id value empty") // ErrPixelRatio occurs when an unsupported display pixel ratio is used as an argument in a function. ErrPixelRatio = errors.New("invalid display pixel ratio") )
Errors returned when creating Image URLs.
var ( // ErrEmptyQry occurs when an empty string is used as a query value. ErrEmptyQry = errors.New("provided option query value is empty") // ErrEmptyFields occurs when an empty string is used as a field value. ErrEmptyFields = errors.New("one or more provided option field values are empty") // ErrExpandedField occurs when a field value tries to access an expanded subfield. ErrExpandedField = errors.New("one or more provided option field values is an expanded subfield which is not supported") // ErrEmptyFilterVals occurs when an empty string is used as a filter value. ErrEmptyFilterVals = errors.New("one or more provided filter option values are empty") // ErrOutOfRange occurs when a provided number value is out of valid range. ErrOutOfRange = errors.New("provided option value is out of range") )
Errors returned by an Option when setting options for an API call.
Functions ¶
func SizedImageURL ¶
SizedImageURL returns the URL of an image identified by the provided imageID, image size, and display pixel ratio. The display pixel ratio only multiplies the resolution of the image. The current available ratios are 1 and 2.
Types ¶
type AgeRating ¶
type AgeRating struct { ID int `json:"id"` Category AgeRatingCategory `json:"category"` ContentDescriptions []int `json:"content_descriptions"` Rating AgeRatingEnum `json:"rating"` RatingCoverURL string `json:"rating_cover_url"` Synopsis string `json:"synopsis"` }
AgeRating describes an age rating according to various organizations. For more information visit: https://api-docs.igdb.com/#age-rating
type AgeRatingCategory ¶
type AgeRatingCategory int
AgeRatingCategory specifies a regulatory organization.
const ( AgeRatingESRB AgeRatingCategory = iota + 1 AgeRatingPEGI )
Expected AgeRatingCategory enums from the IGDB.
func (AgeRatingCategory) String ¶
func (i AgeRatingCategory) String() string
type AgeRatingContent ¶
type AgeRatingContent struct { ID int `json:"id"` Category AgeRatingContentCategory `json:"category"` Description string `json:"description"` }
AgeRatingContent is the organization behind a specific rating.
type AgeRatingContentCategory ¶
type AgeRatingContentCategory int
AgeRatingContentCategory specifies a regulatory organization.
const ( AgeRatingContentPEGI AgeRatingContentCategory = iota + 1 AgeRatingContentESRB )
Expected AgeRatingContentCategory enums from the IGDB.
func (AgeRatingContentCategory) String ¶
func (i AgeRatingContentCategory) String() string
type AgeRatingContentService ¶
type AgeRatingContentService service
AgeRatingContentService handles all the API calls for the IGDB AgeRatingContent endpoint.
func (*AgeRatingContentService) Count ¶
func (as *AgeRatingContentService) Count(opts ...Option) (int, error)
Count returns the number of AgeRatingContents available in the IGDB. Provide the SetFilter functional option if you need to filter which AgeRatingContents to count.
func (*AgeRatingContentService) Fields ¶
func (as *AgeRatingContentService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB AgeRatingContent object.
func (*AgeRatingContentService) Get ¶
func (as *AgeRatingContentService) Get(id int, opts ...Option) (*AgeRatingContent, error)
Get returns a single AgeRatingContent identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any AgeRatingContents, an error is returned.
func (*AgeRatingContentService) Index ¶
func (as *AgeRatingContentService) Index(opts ...Option) ([]*AgeRatingContent, error)
Index returns an index of AgeRatingContents based solely on the provided functional options used to sort, filter, and paginate the results. If no AgeRatingContents can be found using the provided options, an error is returned.
func (*AgeRatingContentService) List ¶
func (as *AgeRatingContentService) List(ids []int, opts ...Option) ([]*AgeRatingContent, error)
List returns a list of AgeRatingContents identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a AgeRatingContent is ignored. If none of the IDs match a AgeRatingContent, an error is returned.
type AgeRatingEnum ¶
type AgeRatingEnum int
AgeRatingEnum specifies a specific age rating.
const ( AgeRatingThree AgeRatingEnum = iota + 1 AgeRatingSeven AgeRatingTwelve AgeRatingSixteen AgeRatingEighteen AgeRatingRP AgeRatingEC AgeRatingE AgeRatingE10 AgeRatingT AgeRatingM AgeRatingAO )
Expected AgeRatingEnum enums from the IGDB.
func (AgeRatingEnum) String ¶
func (i AgeRatingEnum) String() string
type AgeRatingService ¶
type AgeRatingService service
AgeRatingService handles all the API calls for the IGDB AgeRating endpoint.
func (*AgeRatingService) Count ¶
func (as *AgeRatingService) Count(opts ...Option) (int, error)
Count returns the number of AgeRatings available in the IGDB. Provide the SetFilter functional option if you need to filter which AgeRatings to count.
func (*AgeRatingService) Fields ¶
func (as *AgeRatingService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB AgeRating object.
func (*AgeRatingService) Get ¶
func (as *AgeRatingService) Get(id int, opts ...Option) (*AgeRating, error)
Get returns a single AgeRating identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any AgeRatings, an error is returned.
func (*AgeRatingService) Index ¶
func (as *AgeRatingService) Index(opts ...Option) ([]*AgeRating, error)
Index returns an index of AgeRatings based solely on the provided functional options used to sort, filter, and paginate the results. If no AgeRatings can be found using the provided options, an error is returned.
func (*AgeRatingService) List ¶
func (as *AgeRatingService) List(ids []int, opts ...Option) ([]*AgeRating, error)
List returns a list of AgeRatings identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a AgeRating is ignored. If none of the IDs match a AgeRating, an error is returned.
type AlternativeName ¶
type AlternativeName struct { ID int `json:"id"` Comment string `json:"comment"` Game int `json:"game"` Name string `json:"name"` }
AlternativeName represents an alternative or international name for a particular video game. For more information visit: https://api-docs.igdb.com/#alternative-name
type AlternativeNameService ¶
type AlternativeNameService service
AlternativeNameService handles all the API calls for the IGDB AlternativeName endpoint.
func (*AlternativeNameService) Count ¶
func (as *AlternativeNameService) Count(opts ...Option) (int, error)
Count returns the number of AlternativeNames available in the IGDB. Provide the SetFilter functional option if you need to filter which AlternativeNames to count.
func (*AlternativeNameService) Fields ¶
func (as *AlternativeNameService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB AlternativeName object.
func (*AlternativeNameService) Get ¶
func (as *AlternativeNameService) Get(id int, opts ...Option) (*AlternativeName, error)
Get returns a single AlternativeName identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any AlternativeNames, an error is returned.
func (*AlternativeNameService) Index ¶
func (as *AlternativeNameService) Index(opts ...Option) ([]*AlternativeName, error)
Index returns an index of AlternativeNames based solely on the provided functional options used to sort, filter, and paginate the results. If no AlternativeNames can be found using the provided options, an error is returned.
func (*AlternativeNameService) List ¶
func (as *AlternativeNameService) List(ids []int, opts ...Option) ([]*AlternativeName, error)
List returns a list of AlternativeNames identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a AlternativeName is ignored. If none of the IDs match a AlternativeName, an error is returned.
type Artwork ¶
Artwork represents an official piece of artwork. Resolution and aspect ratio may vary. For more information visit: https://api-docs.igdb.com/#artwork
type ArtworkService ¶
type ArtworkService service
ArtworkService handles all the API calls for the IGDB Artwork endpoint.
func (*ArtworkService) Count ¶
func (as *ArtworkService) Count(opts ...Option) (int, error)
Count returns the number of Artworks available in the IGDB. Provide the SetFilter functional option if you need to filter which Artworks to count.
func (*ArtworkService) Fields ¶
func (as *ArtworkService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Artwork object.
func (*ArtworkService) Get ¶
func (as *ArtworkService) Get(id int, opts ...Option) (*Artwork, error)
Get returns a single Artwork identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Artworks, an error is returned.
func (*ArtworkService) Index ¶
func (as *ArtworkService) Index(opts ...Option) ([]*Artwork, error)
Index returns an index of Artworks based solely on the provided functional options used to sort, filter, and paginate the results. If no Artworks can be found using the provided options, an error is returned.
func (*ArtworkService) List ¶
func (as *ArtworkService) List(ids []int, opts ...Option) ([]*Artwork, error)
List returns a list of Artworks identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Artwork is ignored. If none of the IDs match a Artwork, an error is returned.
type Character ¶
type Character struct { ID int `json:"ID"` AKAS []string `json:"akas"` CountryName string `json:"country_name"` CreatedAt int `json:"created_at"` Description string `json:"description"` Games []int `json:"games"` Gender CharacterGender `json:"gender"` MugShot int `json:"mug_shot"` Name string `json:"name"` People []int `json:"people"` Slug string `json:"slug"` Species CharacterSpecies `json:"species"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
Character represents a video game character. For more information visit: https://api-docs.igdb.com/#character
type CharacterGender ¶
type CharacterGender int
CharacterGender specifies a specific gender.
const ( GenderMale CharacterGender = iota + 1 GenderFemale GenderOther )
Expected CharacterGender enums from the IGDB.
func (CharacterGender) String ¶
func (i CharacterGender) String() string
type CharacterMugshot ¶
CharacterMugshot represents an image depicting a game character. For more information visit: https://api-docs.igdb.com/#character-mug-shot
type CharacterMugshotService ¶
type CharacterMugshotService service
CharacterMugshotService handles all the API calls for the IGDB CharacterMugshot endpoint.
func (*CharacterMugshotService) Count ¶
func (cs *CharacterMugshotService) Count(opts ...Option) (int, error)
Count returns the number of CharacterMugshots available in the IGDB. Provide the SetFilter functional option if you need to filter which CharacterMugshots to count.
func (*CharacterMugshotService) Fields ¶
func (cs *CharacterMugshotService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB CharacterMugshot object.
func (*CharacterMugshotService) Get ¶
func (cs *CharacterMugshotService) Get(id int, opts ...Option) (*CharacterMugshot, error)
Get returns a single CharacterMugshot identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any CharacterMugshots, an error is returned.
func (*CharacterMugshotService) Index ¶
func (cs *CharacterMugshotService) Index(opts ...Option) ([]*CharacterMugshot, error)
Index returns an index of CharacterMugshots based solely on the provided functional options used to sort, filter, and paginate the results. If no CharacterMugshots can be found using the provided options, an error is returned.
func (*CharacterMugshotService) List ¶
func (cs *CharacterMugshotService) List(ids []int, opts ...Option) ([]*CharacterMugshot, error)
List returns a list of CharacterMugshots identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a CharacterMugshot is ignored. If none of the IDs match a CharacterMugshot, an error is returned.
type CharacterService ¶
type CharacterService service
CharacterService handles all the API calls for the IGDB Character endpoint.
func (*CharacterService) Count ¶
func (cs *CharacterService) Count(opts ...Option) (int, error)
Count returns the number of Characters available in the IGDB. Provide the SetFilter functional option if you need to filter which Characters to count.
func (*CharacterService) Fields ¶
func (cs *CharacterService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Character object.
func (*CharacterService) Get ¶
func (cs *CharacterService) Get(id int, opts ...Option) (*Character, error)
Get returns a single Character identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Characters, an error is returned.
func (*CharacterService) Index ¶
func (cs *CharacterService) Index(opts ...Option) ([]*Character, error)
Index returns an index of Characters based solely on the provided functional options used to sort, filter, and paginate the results. If no Characters can be found using the provided options, an error is returned.
func (*CharacterService) List ¶
func (cs *CharacterService) List(ids []int, opts ...Option) ([]*Character, error)
List returns a list of Characters identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Character is ignored. If none of the IDs match a Character, an error is returned.
func (*CharacterService) Search ¶
func (cs *CharacterService) Search(qry string, opts ...Option) ([]*Character, error)
Search returns a list of Characters found by searching the IGDB using the provided query. Provide functional options to sort, filter, and paginate the results. If no Characters are found using the provided query, an error is returned.
type CharacterSpecies ¶
type CharacterSpecies int
CharacterSpecies specifies a specific species.
const ( SpeciesHuman CharacterSpecies = iota + 1 SpeciesAlien SpeciesAnimal SpeciesAndroid SpeciesUnknown )
Expected CharacterSpecies enums from the IGDB.
func (CharacterSpecies) String ¶
func (i CharacterSpecies) String() string
type Client ¶
type Client struct { // Services AgeRatings *AgeRatingService AgeRatingContents *AgeRatingContentService AlternativeNames *AlternativeNameService Artworks *ArtworkService Characters *CharacterService CharacterMugshots *CharacterMugshotService Collections *CollectionService Companies *CompanyService CompanyLogos *CompanyLogoService CompanyWebsites *CompanyWebsiteService Covers *CoverService ExternalGames *ExternalGameService Franchises *FranchiseService Games *GameService GameEngines *GameEngineService GameEngineLogos *GameEngineLogoService GameModes *GameModeService GameVersions *GameVersionService GameVersionFeatures *GameVersionFeatureService GameVersionFeatureValues *GameVersionFeatureValueService GameVideos *GameVideoService Genres *GenreService InvolvedCompanies *InvolvedCompanyService Keywords *KeywordService MultiplayerModes *MultiplayerModeService Platforms *PlatformService PlatformLogos *PlatformLogoService PlatformVersions *PlatformVersionService PlatformVersionCompanies *PlatformVersionCompanyService PlatformVersionReleaseDates *PlatformVersionReleaseDateService PlatformWebsites *PlatformWebsiteService PlayerPerspectives *PlayerPerspectiveService PlatformFamilies *PlatformFamilyService ReleaseDates *ReleaseDateService Screenshots *ScreenshotService Themes *ThemeService Websites *WebsiteService // contains filtered or unexported fields }
Client wraps an HTTP Client used to communicate with the IGDB, the root URL of the IGDB, and the user's IGDB API key. Client also initializes all the separate services to communicate with each individual IGDB API endpoint.
func NewClient ¶
NewClient returns a new Client configured to communicate with the IGDB. The provided clientID and appAccessToken will be used to make requests on your behalf. The provided HTTP Client will be the client making requests to the IGDB. If no HTTP Client is provided, a default HTTP client is used instead.
If you need an IGDB/Twitch API keys, please visit: https://api-docs.igdb.com/#account-creation
func (*Client) Search ¶
func (c *Client) Search(qry string, opts ...Option) ([]*SearchResult, error)
Search returns a list of SearchResults using the provided query. Provide functional options to sort, filter, and paginate the results. If no results are found, an error is returned. Search can only search through Characters, Collections, Games, People, Platforms, and Themes.
type Collection ¶
type Collection struct { ID int `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
Collection represents a video game series. For more information visit: https://api-docs.igdb.com/#collection
type CollectionService ¶
type CollectionService service
CollectionService handles all the API calls for the IGDB Collection endpoint.
func (*CollectionService) Count ¶
func (cs *CollectionService) Count(opts ...Option) (int, error)
Count returns the number of Collections available in the IGDB. Provide the SetFilter functional option if you need to filter which Collections to count.
func (*CollectionService) Fields ¶
func (cs *CollectionService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Collection object.
func (*CollectionService) Get ¶
func (cs *CollectionService) Get(id int, opts ...Option) (*Collection, error)
Get returns a single Collection identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Collections, an error is returned.
func (*CollectionService) Index ¶
func (cs *CollectionService) Index(opts ...Option) ([]*Collection, error)
Index returns an index of Collections based solely on the provided functional options used to sort, filter, and paginate the results. If no Collections can be found using the provided options, an error is returned.
func (*CollectionService) List ¶
func (cs *CollectionService) List(ids []int, opts ...Option) ([]*Collection, error)
List returns a list of Collections identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Collection is ignored. If none of the IDs match a Collection, an error is returned.
func (*CollectionService) Search ¶
func (cs *CollectionService) Search(qry string, opts ...Option) ([]*Collection, error)
Search returns a list of Collections found by searching the IGDB using the provided query. Provide functional options to sort, filter, and paginate the results. If no Collections are found using the provided query, an error is returned.
type Company ¶
type Company struct { ID int `json:"id"` ChangeDate int `json:"change_date"` ChangeDateCategory DateCategory `json:"change_date_category"` ChangedCompanyID int `json:"changed_company_id"` Country int `json:"country"` CreatedAt int `json:"created_at"` Description string `json:"description"` Developed []int `json:"developed"` Logo int `json:"logo"` Name string `json:"name"` Parent int `json:"parent"` Published []int `json:"published"` Slug string `json:"slug"` StartDate int `json:"start_date"` StartDateCategory DateCategory `json:"start_date_category"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` Websites []int `json:"websites"` }
Company represents a video game company. This includes both publishers and developers. For more information visit: https://api-docs.igdb.com/#company
type CompanyLogo ¶
CompanyLogo represents the logo of a developer or publisher. For more information visit: https://api-docs.igdb.com/#company-logo
type CompanyLogoService ¶
type CompanyLogoService service
CompanyLogoService handles all the API calls for the IGDB CompanyLogo endpoint.
func (*CompanyLogoService) Count ¶
func (cs *CompanyLogoService) Count(opts ...Option) (int, error)
Count returns the number of CompanyLogos available in the IGDB. Provide the SetFilter functional option if you need to filter which CompanyLogos to count.
func (*CompanyLogoService) Fields ¶
func (cs *CompanyLogoService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB CompanyLogo object.
func (*CompanyLogoService) Get ¶
func (cs *CompanyLogoService) Get(id int, opts ...Option) (*CompanyLogo, error)
Get returns a single CompanyLogo identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any CompanyLogos, an error is returned.
func (*CompanyLogoService) Index ¶
func (cs *CompanyLogoService) Index(opts ...Option) ([]*CompanyLogo, error)
Index returns an index of CompanyLogos based solely on the provided functional options used to sort, filter, and paginate the results. If no CompanyLogos can be found using the provided options, an error is returned.
func (*CompanyLogoService) List ¶
func (cs *CompanyLogoService) List(ids []int, opts ...Option) ([]*CompanyLogo, error)
List returns a list of CompanyLogos identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a CompanyLogo is ignored. If none of the IDs match a CompanyLogo, an error is returned.
type CompanyService ¶
type CompanyService service
CompanyService handles all the API calls for the IGDB Company endpoint.
func (*CompanyService) Count ¶
func (cs *CompanyService) Count(opts ...Option) (int, error)
Count returns the number of Companies available in the IGDB. Provide the SetFilter functional option if you need to filter which Companies to count.
func (*CompanyService) Fields ¶
func (cs *CompanyService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Company object.
func (*CompanyService) Get ¶
func (cs *CompanyService) Get(id int, opts ...Option) (*Company, error)
Get returns a single Company identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Companies, an error is returned.
func (*CompanyService) Index ¶
func (cs *CompanyService) Index(opts ...Option) ([]*Company, error)
Index returns an index of Companies based solely on the provided functional options used to sort, filter, and paginate the results. If no Companies can be found using the provided options, an error is returned.
func (*CompanyService) List ¶
func (cs *CompanyService) List(ids []int, opts ...Option) ([]*Company, error)
List returns a list of Companies identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Company is ignored. If none of the IDs match a Company, an error is returned.
type CompanyWebsite ¶
type CompanyWebsite struct { ID int `json:"id"` Category WebsiteCategory `json:"category"` Trusted bool `json:"trusted"` URL string `json:"url"` }
CompanyWebsite represents a website for a specific company. For more information visit: https://api-docs.igdb.com/#company-website
type CompanyWebsiteService ¶
type CompanyWebsiteService service
CompanyWebsiteService handles all the API calls for the IGDB CompanyWebsite endpoint.
func (*CompanyWebsiteService) Count ¶
func (zs *CompanyWebsiteService) Count(opts ...Option) (int, error)
Count returns the number of CompanyWebsites available in the IGDB. Provide the SetFilter functional option if you need to filter which CompanyWebsites to count.
func (*CompanyWebsiteService) Fields ¶
func (zs *CompanyWebsiteService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB CompanyWebsite object.
func (*CompanyWebsiteService) Get ¶
func (zs *CompanyWebsiteService) Get(id int, opts ...Option) (*CompanyWebsite, error)
Get returns a single CompanyWebsite identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any CompanyWebsites, an error is returned.
func (*CompanyWebsiteService) Index ¶
func (zs *CompanyWebsiteService) Index(opts ...Option) ([]*CompanyWebsite, error)
Index returns an index of CompanyWebsites based solely on the provided functional options used to sort, filter, and paginate the results. If no CompanyWebsites can be found using the provided options, an error is returned.
func (*CompanyWebsiteService) List ¶
func (zs *CompanyWebsiteService) List(ids []int, opts ...Option) ([]*CompanyWebsite, error)
List returns a list of CompanyWebsites identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a CompanyWebsite is ignored. If none of the IDs match a CompanyWebsite, an error is returned.
type Count ¶
type Count struct {
Count int `json:"count"`
}
Count contains the number of objects of a certain type counted in the IGDB.
type Cover ¶
Cover represents the cover art for a specific video game. For more information visit: https://api-docs.igdb.com/#cover
type CoverService ¶
type CoverService service
CoverService handles all the API calls for the IGDB Cover endpoint.
func (*CoverService) Count ¶
func (cs *CoverService) Count(opts ...Option) (int, error)
Count returns the number of Covers available in the IGDB. Provide the SetFilter functional option if you need to filter which Covers to count.
func (*CoverService) Fields ¶
func (cs *CoverService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Cover object.
func (*CoverService) Get ¶
func (cs *CoverService) Get(id int, opts ...Option) (*Cover, error)
Get returns a single Cover identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Covers, an error is returned.
func (*CoverService) Index ¶
func (cs *CoverService) Index(opts ...Option) ([]*Cover, error)
Index returns an index of Covers based solely on the provided functional options used to sort, filter, and paginate the results. If no Covers can be found using the provided options, an error is returned.
func (*CoverService) List ¶
func (cs *CoverService) List(ids []int, opts ...Option) ([]*Cover, error)
List returns a list of Covers identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Cover is ignored. If none of the IDs match a Cover, an error is returned.
type DateCategory ¶
type DateCategory int
DateCategory specifies the format of a release date.
const ( DateYYYYMMMMDD DateCategory = iota DateYYYYMMMM DateYYYY DateYYYYQ1 DateYYYYQ2 DateYYYYQ3 DateYYYYQ4 DateTBD )
Expected DateCategory enums from the IGDB.
func (DateCategory) String ¶
func (i DateCategory) String() string
type ExternalGame ¶
type ExternalGame struct { ID int `json:"id"` Category ExternalGameCategory `json:"category"` CreatedAt int `json:"created_at"` Game int `json:"game"` Name string `json:"name"` UID string `json:"uid"` UpdatedAt int `json:"updated_at"` Url string `json:"url"` Year int `json:"year"` }
ExternalGame contains the ID and other metadata for a game on a third party service. For more information visit: https://api-docs.igdb.com/#external-game
type ExternalGameCategory ¶
type ExternalGameCategory int
ExternalGameCategory speficies an external game, platform, or media service.
const ( ExternalSteam ExternalGameCategory = iota + 1 ExternalGOG ExternalYoutube ExternalMicrosoft ExternalApple ExternalTwitch ExternalAndroid )
Expected ExternalGameCategory enums from the IGDB.
func (ExternalGameCategory) String ¶
func (i ExternalGameCategory) String() string
type ExternalGameService ¶
type ExternalGameService service
ExternalGameService handles all the API calls for the IGDB ExternalGame endpoint.
func (*ExternalGameService) Count ¶
func (es *ExternalGameService) Count(opts ...Option) (int, error)
Count returns the number of ExternalGames available in the IGDB. Provide the SetFilter functional option if you need to filter which ExternalGames to count.
func (*ExternalGameService) Fields ¶
func (es *ExternalGameService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB ExternalGame object.
func (*ExternalGameService) Get ¶
func (es *ExternalGameService) Get(id int, opts ...Option) (*ExternalGame, error)
Get returns a single ExternalGame identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any ExternalGames, an error is returned.
func (*ExternalGameService) Index ¶
func (es *ExternalGameService) Index(opts ...Option) ([]*ExternalGame, error)
Index returns an index of ExternalGames based solely on the provided functional options used to sort, filter, and paginate the results. If no ExternalGames can be found using the provided options, an error is returned.
func (*ExternalGameService) List ¶
func (es *ExternalGameService) List(ids []int, opts ...Option) ([]*ExternalGame, error)
List returns a list of ExternalGames identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a ExternalGame is ignored. If none of the IDs match a ExternalGame, an error is returned.
type Franchise ¶
type Franchise struct { ID int `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` Url string `json:"url"` }
Franchise is a list of video game franchises such as Star Wars. For more information visit: https://api-docs.igdb.com/#franchise
type FranchiseService ¶
type FranchiseService service
FranchiseService handles all the API calls for the IGDB Franchise endpoint.
func (*FranchiseService) Count ¶
func (fs *FranchiseService) Count(opts ...Option) (int, error)
Count returns the number of Franchises available in the IGDB. Provide the SetFilter functional option if you need to filter which Franchises to count.
func (*FranchiseService) Fields ¶
func (fs *FranchiseService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Franchise object.
func (*FranchiseService) Get ¶
func (fs *FranchiseService) Get(id int, opts ...Option) (*Franchise, error)
Get returns a single Franchise identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Franchises, an error is returned.
func (*FranchiseService) Index ¶
func (fs *FranchiseService) Index(opts ...Option) ([]*Franchise, error)
Index returns an index of Franchises based solely on the provided functional options used to sort, filter, and paginate the results. If no Franchises can be found using the provided options, an error is returned.
func (*FranchiseService) List ¶
func (fs *FranchiseService) List(ids []int, opts ...Option) ([]*Franchise, error)
List returns a list of Franchises identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Franchise is ignored. If none of the IDs match a Franchise, an error is returned.
type Game ¶
type Game struct { ID int `json:"id"` AgeRatings []int `json:"age_ratings"` AggregatedRating float64 `json:"aggregated_rating"` AggregatedRatingCount int `json:"aggregated_rating_count"` AlternativeNames []int `json:"alternative_names"` Artworks []int `json:"artworks"` Bundles []int `json:"bundles"` Category GameCategory `json:"category"` Collection int `json:"collection"` Cover int `json:"cover"` CreatedAt int `json:"created_at"` DLCS []int `json:"dlcs"` Expansions []int `json:"expansions"` ExternalGames []int `json:"external_games"` FirstReleaseDate int `json:"first_release_date"` Follows int `json:"follows"` Franchise int `json:"franchise"` Franchises []int `json:"franchises"` GameEngines []int `json:"game_engines"` GameModes []int `json:"game_modes"` Genres []int `json:"genres"` Hypes int `json:"hypes"` InvolvedCompanies []int `json:"involved_companies"` Keywords []int `json:"keywords"` MultiplayerModes []int `json:"multiplayer_modes"` Name string `json:"name"` ParentGame int `json:"parent_game"` Platforms []int `json:"platforms"` PlayerPerspectives []int `json:"player_perspectives"` Rating float64 `json:"rating"` RatingCount int `json:"rating_count"` ReleaseDates []int `json:"release_dates"` Screenshots []int `json:"screenshots"` SimilarGames []int `json:"similar_games"` Slug string `json:"slug"` StandaloneExpansions []int `json:"standalone_expansions"` Status GameStatus `json:"status"` Storyline string `json:"storyline"` Summary string `json:"summary"` Tags []Tag `json:"tags"` Themes []int `json:"themes"` TotalRating float64 `json:"total_rating"` TotalRatingCount int `json:"total_rating_count"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` VersionParent int `json:"version_parent"` VersionTitle string `json:"version_title"` Videos []int `json:"videos"` Websites []int `json:"websites"` }
Game contains information on an IGDB entry for a particular video game. For more information visit: https://api-docs.igdb.com/#game
type GameCategory ¶
type GameCategory int
GameCategory specifies a type of game content.
const ( MainGame GameCategory = iota DLCAddon Expansion Bundle StandaloneExpansion Mod Episode Season Remake Remaster ExpandedGame Port Fork Pack Update )
Expected GameCategory enums from the IGDB.
func (GameCategory) String ¶
func (i GameCategory) String() string
type GameEngine ¶
type GameEngine struct { ID int `json:"id"` Companies []int `json:"companies"` CreatedAt int `json:"created_at"` Description string `json:"description"` Logo int `json:"logo"` Name string `json:"name"` Platforms []int `json:"platforms"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
GameEngine represents a video game engine such as Unreal Engine. For more information visit: https://api-docs.igdb.com/#game-engine
type GameEngineLogo ¶
GameEngineLogo represents the logo of a particular game engine. For more information visit: https://api-docs.igdb.com/#game-engine-logo
type GameEngineLogoService ¶
type GameEngineLogoService service
GameEngineLogoService handles all the API calls for the IGDB GameEngineLogo endpoint.
func (*GameEngineLogoService) Count ¶
func (gs *GameEngineLogoService) Count(opts ...Option) (int, error)
Count returns the number of GameEngineLogos available in the IGDB. Provide the SetFilter functional option if you need to filter which GameEngineLogos to count.
func (*GameEngineLogoService) Fields ¶
func (gs *GameEngineLogoService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameEngineLogo object.
func (*GameEngineLogoService) Get ¶
func (gs *GameEngineLogoService) Get(id int, opts ...Option) (*GameEngineLogo, error)
Get returns a single GameEngineLogo identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameEngineLogos, an error is returned.
func (*GameEngineLogoService) Index ¶
func (gs *GameEngineLogoService) Index(opts ...Option) ([]*GameEngineLogo, error)
Index returns an index of GameEngineLogos based solely on the provided functional options used to sort, filter, and paginate the results. If no GameEngineLogos can be found using the provided options, an error is returned.
func (*GameEngineLogoService) List ¶
func (gs *GameEngineLogoService) List(ids []int, opts ...Option) ([]*GameEngineLogo, error)
List returns a list of GameEngineLogos identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameEngineLogo is ignored. If none of the IDs match a GameEngineLogo, an error is returned.
type GameEngineService ¶
type GameEngineService service
GameEngineService handles all the API calls for the IGDB GameEngine endpoint.
func (*GameEngineService) Count ¶
func (gs *GameEngineService) Count(opts ...Option) (int, error)
Count returns the number of GameEngines available in the IGDB. Provide the SetFilter functional option if you need to filter which GameEngines to count.
func (*GameEngineService) Fields ¶
func (gs *GameEngineService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameEngine object.
func (*GameEngineService) Get ¶
func (gs *GameEngineService) Get(id int, opts ...Option) (*GameEngine, error)
Get returns a single GameEngine identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameEngines, an error is returned.
func (*GameEngineService) Index ¶
func (gs *GameEngineService) Index(opts ...Option) ([]*GameEngine, error)
Index returns an index of GameEngines based solely on the provided functional options used to sort, filter, and paginate the results. If no GameEngines can be found using the provided options, an error is returned.
func (*GameEngineService) List ¶
func (gs *GameEngineService) List(ids []int, opts ...Option) ([]*GameEngine, error)
List returns a list of GameEngines identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameEngine is ignored. If none of the IDs match a GameEngine, an error is returned.
type GameMode ¶
type GameMode struct { CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
GameMode represents a video game mode such as single or multi player. For more information visit: https://api-docs.igdb.com/#game-mode
type GameModeService ¶
type GameModeService service
GameModeService handles all the API calls for the IGDB GameMode endpoint.
func (*GameModeService) Count ¶
func (gs *GameModeService) Count(opts ...Option) (int, error)
Count returns the number of GameModes available in the IGDB. Provide the SetFilter functional option if you need to filter which GameModes to count.
func (*GameModeService) Fields ¶
func (gs *GameModeService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameMode object.
func (*GameModeService) Get ¶
func (gs *GameModeService) Get(id int, opts ...Option) (*GameMode, error)
Get returns a single GameMode identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameModes, an error is returned.
func (*GameModeService) Index ¶
func (gs *GameModeService) Index(opts ...Option) ([]*GameMode, error)
Index returns an index of GameModes based solely on the provided functional options used to sort, filter, and paginate the results. If no GameModes can be found using the provided options, an error is returned.
func (*GameModeService) List ¶
func (gs *GameModeService) List(ids []int, opts ...Option) ([]*GameMode, error)
List returns a list of GameModes identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameMode is ignored. If none of the IDs match a GameMode, an error is returned.
type GameService ¶
type GameService service
GameService handles all the API calls for the IGDB Game endpoint.
func (*GameService) Count ¶
func (gs *GameService) Count(opts ...Option) (int, error)
Count returns the number of Games available in the IGDB. Provide the SetFilter functional option if you need to filter which Games to count.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) ct, err := c.Games.Count(SetFilter("created_at", OpGreaterThan, "1993-12-15")) if err != nil { fmt.Println(err) return } fmt.Println("Number of games created after December 15, 1993: ", ct)
Output:
func (*GameService) Fields ¶
func (gs *GameService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Game object.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) fl, err := c.Games.Fields() if err != nil { fmt.Println(err) return } fmt.Println("List of available fields for the IGDB Game object: ", fl)
Output:
func (*GameService) Get ¶
func (gs *GameService) Get(id int, opts ...Option) (*Game, error)
Get returns a single Game identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Games, an error is returned.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) g, err := c.Games.Get(7346, SetFields("name", "url", "summary", "storyline", "rating", "hypes", "cover")) if err != nil { fmt.Println(err) return } fmt.Println("IGDB entry for The Legend of Zelda: Breath of the Wild\n", *g)
Output:
func (*GameService) Index ¶
func (gs *GameService) Index(opts ...Option) ([]*Game, error)
Index returns an index of Games based solely on the provided functional options used to sort, filter, and paginate the results. If no Games can be found using the provided options, an error is returned.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) g, err := c.Games.Index( SetLimit(5), SetFilter("hypes", OpGreaterThan, "80"), ) if err != nil { fmt.Println(err) return } fmt.Println("IGDB entries for 5 Games with hypes above 80") for _, v := range g { fmt.Println(*v) }
Output:
func (*GameService) List ¶
func (gs *GameService) List(ids []int, opts ...Option) ([]*Game, error)
List returns a list of Games identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Game is ignored. If none of the IDs match a Game, an error is returned.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) g, err := c.Games.List([]int{1721, 2777, 1074}) if err != nil { fmt.Println(err) return } fmt.Println("IGDB entries for Megaman 8, Kirby Air Ride, and Super Mario 64") for _, v := range g { fmt.Println(*v) }
Output:
func (*GameService) Search ¶
func (gs *GameService) Search(qry string, opts ...Option) ([]*Game, error)
Search returns a list of Games found by searching the IGDB using the provided query. Provide functional options to sort, filter, and paginate the results. If no Games are found using the provided query, an error is returned.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) g, err := c.Games.Search( "mario", SetFields("*"), SetFilter("rating", OpGreaterThanEqual, "80"), SetOrder("rating", OrderDescending), SetLimit(3)) if err != nil { fmt.Println(err) return } fmt.Println("IGDB entries for Super Mario 64, Mario Kart 8, and Mario Party") for _, v := range g { fmt.Println(*v) }
Output:
type GameStatus ¶
type GameStatus int
GameStatus specifies the release status of a specific game.
const ( StatusReleased GameStatus = iota StatusAlpha StatusBeta StatusEarlyAccess StatusOffline StatusCancelled )
Expected GameStatus enums from the IGDB.
func (GameStatus) String ¶
func (i GameStatus) String() string
type GameVersion ¶
type GameVersion struct { CreatedAt int `json:"created_at"` Features []int `json:"features"` Game int `json:"game"` Games []int `json:"games"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
GameVersion provides details about game editions and versions. For more information visit: https://api-docs.igdb.com/#game-version
type GameVersionFeature ¶
type GameVersionFeature struct { ID int `json:"id"` Category VersionFeatureCategory `json:"category"` Description string `json:"description"` Position int `json:"position"` Title string `json:"title"` Values []int `json:"values"` }
GameVersionFeature represents features and descriptions of what makes each version/edition different from their main game. For more information visit: https://api-docs.igdb.com/#game-version-feature
type GameVersionFeatureService ¶
type GameVersionFeatureService service
GameVersionFeatureService handles all the API calls for the IGDB GameVersionFeature endpoint.
func (*GameVersionFeatureService) Count ¶
func (gs *GameVersionFeatureService) Count(opts ...Option) (int, error)
Count returns the number of GameVersionFeatures available in the IGDB. Provide the SetFilter functional option if you need to filter which GameVersionFeatures to count.
func (*GameVersionFeatureService) Fields ¶
func (gs *GameVersionFeatureService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameVersionFeature object.
func (*GameVersionFeatureService) Get ¶
func (gs *GameVersionFeatureService) Get(id int, opts ...Option) (*GameVersionFeature, error)
Get returns a single GameVersionFeature identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameVersionFeatures, an error is returned.
func (*GameVersionFeatureService) Index ¶
func (gs *GameVersionFeatureService) Index(opts ...Option) ([]*GameVersionFeature, error)
Index returns an index of GameVersionFeatures based solely on the provided functional options used to sort, filter, and paginate the results. If no GameVersionFeatures can be found using the provided options, an error is returned.
func (*GameVersionFeatureService) List ¶
func (gs *GameVersionFeatureService) List(ids []int, opts ...Option) ([]*GameVersionFeature, error)
List returns a list of GameVersionFeatures identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameVersionFeature is ignored. If none of the IDs match a GameVersionFeature, an error is returned.
type GameVersionFeatureValue ¶
type GameVersionFeatureValue struct { ID int `json:"id"` Game int `json:"game"` GameFeature int `json:"game_feature"` IncludedFeature VersionFeatureInclusion `json:"included_feature"` Note string `json:"note"` }
GameVersionFeatureValue represents the bool/text value of a particular feature. For more information visit: https://api-docs.igdb.com/#game-version-feature-value
type GameVersionFeatureValueService ¶
type GameVersionFeatureValueService service
GameVersionFeatureValueService handles all the API calls for the IGDB GameVersionFeatureValue endpoint.
func (*GameVersionFeatureValueService) Count ¶
func (gs *GameVersionFeatureValueService) Count(opts ...Option) (int, error)
Count returns the number of GameVersionFeatureValues available in the IGDB. Provide the SetFilter functional option if you need to filter which GameVersionFeatureValues to count.
func (*GameVersionFeatureValueService) Fields ¶
func (gs *GameVersionFeatureValueService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameVersionFeatureValue object.
func (*GameVersionFeatureValueService) Get ¶
func (gs *GameVersionFeatureValueService) Get(id int, opts ...Option) (*GameVersionFeatureValue, error)
Get returns a single GameVersionFeatureValue identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameVersionFeatureValues, an error is returned.
func (*GameVersionFeatureValueService) Index ¶
func (gs *GameVersionFeatureValueService) Index(opts ...Option) ([]*GameVersionFeatureValue, error)
Index returns an index of GameVersionFeatureValues based solely on the provided functional options used to sort, filter, and paginate the results. If no GameVersionFeatureValues can be found using the provided options, an error is returned.
func (*GameVersionFeatureValueService) List ¶
func (gs *GameVersionFeatureValueService) List(ids []int, opts ...Option) ([]*GameVersionFeatureValue, error)
List returns a list of GameVersionFeatureValues identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameVersionFeatureValue is ignored. If none of the IDs match a GameVersionFeatureValue, an error is returned.
type GameVersionService ¶
type GameVersionService service
GameVersionService handles all the API calls for the IGDB GameVersion endpoint.
func (*GameVersionService) Count ¶
func (gs *GameVersionService) Count(opts ...Option) (int, error)
Count returns the number of GameVersions available in the IGDB. Provide the SetFilter functional option if you need to filter which GameVersions to count.
func (*GameVersionService) Fields ¶
func (gs *GameVersionService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameVersion object.
func (*GameVersionService) Get ¶
func (gs *GameVersionService) Get(id int, opts ...Option) (*GameVersion, error)
Get returns a single GameVersion identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameVersions, an error is returned.
func (*GameVersionService) Index ¶
func (gs *GameVersionService) Index(opts ...Option) ([]*GameVersion, error)
Index returns an index of GameVersions based solely on the provided functional options used to sort, filter, and paginate the results. If no GameVersions can be found using the provided options, an error is returned.
func (*GameVersionService) List ¶
func (gs *GameVersionService) List(ids []int, opts ...Option) ([]*GameVersion, error)
List returns a list of GameVersions identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameVersion is ignored. If none of the IDs match a GameVersion, an error is returned.
type GameVideo ¶
type GameVideo struct { Game int `json:"game"` Name string `json:"name"` VideoID string `json:"video_id"` }
GameVideo represents a video associated with a particular game. For more information visit: https://api-docs.igdb.com/#game-video
type GameVideoService ¶
type GameVideoService service
GameVideoService handles all the API calls for the IGDB GameVideo endpoint.
func (*GameVideoService) Count ¶
func (gs *GameVideoService) Count(opts ...Option) (int, error)
Count returns the number of GameVideos available in the IGDB. Provide the SetFilter functional option if you need to filter which GameVideos to count.
func (*GameVideoService) Fields ¶
func (gs *GameVideoService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB GameVideo object.
func (*GameVideoService) Get ¶
func (gs *GameVideoService) Get(id int, opts ...Option) (*GameVideo, error)
Get returns a single GameVideo identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any GameVideos, an error is returned.
func (*GameVideoService) Index ¶
func (gs *GameVideoService) Index(opts ...Option) ([]*GameVideo, error)
Index returns an index of GameVideos based solely on the provided functional options used to sort, filter, and paginate the results. If no GameVideos can be found using the provided options, an error is returned.
func (*GameVideoService) List ¶
func (gs *GameVideoService) List(ids []int, opts ...Option) ([]*GameVideo, error)
List returns a list of GameVideos identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a GameVideo is ignored. If none of the IDs match a GameVideo, an error is returned.
type Genre ¶
type Genre struct { ID int `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
Genre represents the genre of a particular video game. For more information visit: https://api-docs.igdb.com/#genre
type GenreService ¶
type GenreService service
GenreService handles all the API calls for the IGDB Genre endpoint.
func (*GenreService) Count ¶
func (gs *GenreService) Count(opts ...Option) (int, error)
Count returns the number of Genres available in the IGDB. Provide the SetFilter functional option if you need to filter which Genres to count.
func (*GenreService) Fields ¶
func (gs *GenreService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Genre object.
func (*GenreService) Get ¶
func (gs *GenreService) Get(id int, opts ...Option) (*Genre, error)
Get returns a single Genre identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Genres, an error is returned.
func (*GenreService) Index ¶
func (gs *GenreService) Index(opts ...Option) ([]*Genre, error)
Index returns an index of Genres based solely on the provided functional options used to sort, filter, and paginate the results. If no Genres can be found using the provided options, an error is returned.
func (*GenreService) List ¶
func (gs *GenreService) List(ids []int, opts ...Option) ([]*Genre, error)
List returns a list of Genres identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Genre is ignored. If none of the IDs match a Genre, an error is returned.
type Image ¶
type Image struct { AlphaChannel bool `json:"alpha_channel"` Animated bool `json:"animated"` Height int `json:"height"` ImageID string `json:"image_id"` URL string `json:"url"` Width int `json:"width"` }
Image contains the URL, dimensions, and ID of a particular image. For more information visit: https://api-docs.igdb.com/#images
type InvolvedCompany ¶
type InvolvedCompany struct { ID int `json:"id"` Company int `json:"company"` CreatedAt int `json:"created_at"` Developer bool `json:"developer"` Game int `json:"game"` Porting bool `json:"porting"` Publisher bool `json:"publisher"` Supporting bool `json:"supporting"` UpdatedAt int `json:"updated_at"` }
InvolvedCompany represents a company involved in the development of a particular video game. For more information visit: https://api-docs.igdb.com/#involved-company
type InvolvedCompanyService ¶
type InvolvedCompanyService service
InvolvedCompanyService handles all the API calls for the IGDB InvolvedCompany endpoint.
func (*InvolvedCompanyService) Count ¶
func (is *InvolvedCompanyService) Count(opts ...Option) (int, error)
Count returns the number of InvolvedCompanies available in the IGDB. Provide the SetFilter functional option if you need to filter which InvolvedCompanies to count.
func (*InvolvedCompanyService) Fields ¶
func (is *InvolvedCompanyService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB InvolvedCompany object.
func (*InvolvedCompanyService) Get ¶
func (is *InvolvedCompanyService) Get(id int, opts ...Option) (*InvolvedCompany, error)
Get returns a single InvolvedCompany identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any InvolvedCompanies, an error is returned.
func (*InvolvedCompanyService) Index ¶
func (is *InvolvedCompanyService) Index(opts ...Option) ([]*InvolvedCompany, error)
Index returns an index of InvolvedCompanies based solely on the provided functional options used to sort, filter, and paginate the results. If no InvolvedCompanies can be found using the provided options, an error is returned.
func (*InvolvedCompanyService) List ¶
func (is *InvolvedCompanyService) List(ids []int, opts ...Option) ([]*InvolvedCompany, error)
List returns a list of InvolvedCompanies identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a InvolvedCompany is ignored. If none of the IDs match a InvolvedCompany, an error is returned.
type Keyword ¶
type Keyword struct { CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` Url string `json:"url"` }
Keyword represents a word or phrase that get tagged to a game such as "World War 2" or "Steampunk". For more information visit: https://api-docs.igdb.com/#keyword
type KeywordService ¶
type KeywordService service
KeywordService handles all the API calls for the IGDB Keyword endpoint.
func (*KeywordService) Count ¶
func (ks *KeywordService) Count(opts ...Option) (int, error)
Count returns the number of Keywords available in the IGDB. Provide the SetFilter functional option if you need to filter which Keywords to count.
func (*KeywordService) Fields ¶
func (ks *KeywordService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Keyword object.
func (*KeywordService) Get ¶
func (ks *KeywordService) Get(id int, opts ...Option) (*Keyword, error)
Get returns a single Keyword identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Keywords, an error is returned.
func (*KeywordService) Index ¶
func (ks *KeywordService) Index(opts ...Option) ([]*Keyword, error)
Index returns an index of Keywords based solely on the provided functional options used to sort, filter, and paginate the results. If no Keywords can be found using the provided options, an error is returned.
func (*KeywordService) List ¶
func (ks *KeywordService) List(ids []int, opts ...Option) ([]*Keyword, error)
List returns a list of Keywords identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Keyword is ignored. If none of the IDs match a Keyword, an error is returned.
type MultiplayerMode ¶
type MultiplayerMode struct { Campaigncoop bool `json:"campaigncoop"` Dropin bool `json:"dropin"` Lancoop bool `json:"lancoop"` Offlinecoop bool `json:"offlinecoop"` Offlinecoopmax int `json:"offlinecoopmax"` Offlinemax int `json:"offlinemax"` Onlinecoop bool `json:"onlinecoop"` Onlinecoopmax int `json:"onlinecoopmax"` Onlinemax int `json:"onlinemax"` Platform int `json:"platform"` Splitscreen bool `json:"splitscreen"` Splitscreenonline bool `json:"splitscreenonline"` }
MultiplayerMode contains data about the supported multiplayer types. For more information visit: https://api-docs.igdb.com/#multiplayer-mode
type MultiplayerModeService ¶
type MultiplayerModeService service
MultiplayerModeService handles all the API calls for the IGDB MultiplayerMode endpoint.
func (*MultiplayerModeService) Count ¶
func (ms *MultiplayerModeService) Count(opts ...Option) (int, error)
Count returns the number of MultiplayerModes available in the IGDB. Provide the SetFilter functional option if you need to filter which MultiplayerModes to count.
func (*MultiplayerModeService) Fields ¶
func (ms *MultiplayerModeService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB MultiplayerMode object.
func (*MultiplayerModeService) Get ¶
func (ms *MultiplayerModeService) Get(id int, opts ...Option) (*MultiplayerMode, error)
Get returns a single MultiplayerMode identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any MultiplayerModes, an error is returned.
func (*MultiplayerModeService) Index ¶
func (ms *MultiplayerModeService) Index(opts ...Option) ([]*MultiplayerMode, error)
Index returns an index of MultiplayerModes based solely on the provided functional options used to sort, filter, and paginate the results. If no MultiplayerModes can be found using the provided options, an error is returned.
func (*MultiplayerModeService) List ¶
func (ms *MultiplayerModeService) List(ids []int, opts ...Option) ([]*MultiplayerMode, error)
List returns a list of MultiplayerModes identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a MultiplayerMode is ignored. If none of the IDs match a MultiplayerMode, an error is returned.
type Option ¶
type Option func() (apicalypse.Option, error)
Option functions are used to set the options for an API call. Option is the first-order function returned by the available functional options (e.g. SetLimit or SetFilter). This first-order function is then passed into a service's Get, List, Index, Search, or Count function.
func ComposeOptions ¶
ComposeOptions composes multiple functional options into a single Option. This is primarily used to create a single functional option that can be used repeatedly across multiple queries.
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Composing FuncOptions to filter for top 5 popular games composed := ComposeOptions( SetLimit(5), SetFields("name", "cover"), SetOrder("hypes", OrderDescending), SetFilter("category", OpEquals, "0"), ) // Using composed FuncOptions PS4, err := c.Games.Index( composed, SetFilter("platforms", OpEquals, "48"), // only PS4 games ) if err != nil { log.Fatal(err) } // Reusing composed FuncOptions XBOX, err := c.Games.Index( composed, SetFilter("platforms", OpEquals, "49"), // only XBOX games ) if err != nil { log.Fatal(err) } fmt.Println("Top 5 PS4 Games: ") for _, v := range PS4 { fmt.Println(*v) } fmt.Println("Top 5 Xbox Games: ") for _, v := range XBOX { fmt.Println(*v) }
Output:
func SetExclude ¶
SetExclude is a functional option used to specify which fields of the requested IGDB object you want the API to exclude. Note that the field string must match an IGDB object's JSON field tag exactly, not the Go struct name.
For more information, visit: https://api-docs.igdb.com/#exclude
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Exclude name field c.Characters.Search("mario", SetFields("name")) // Exclude gender field c.Characters.Search("mario", SetFields("gender")) // Exclude both name and gender field c.Characters.Search("mario", SetFields("name", "gender")) // Exclude whole mug_shot field c.Characters.Search("mario", SetFields("mug_shot")) // Exclude any number of fields c.Characters.Search("mario", SetFields("name", "gender", "url", "species", "games", "mug_shot")) // Exclude all available fields c.Characters.Search("mario", SetFields("*"))
Output:
func SetFields ¶
SetFields is a functional option used to specify which fields of the requested IGDB object you want the API to provide. Subfields are accessed with a dot operator (e.g. cover.url). To select all available fields at once, use an asterisk character (i.e. *). Note that the field string must match an IGDB object's JSON field tag exactly, not the Go struct field name.
For more information, visit: https://api-docs.igdb.com/#fields
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Retrieve name field c.Characters.Search("mario", SetFields("name")) // Retrieve gender field c.Characters.Search("mario", SetFields("gender")) // Retrieve both name and gender field c.Characters.Search("mario", SetFields("name", "gender")) // Retrieve whole mug_shot field c.Characters.Search("mario", SetFields("mug_shot")) // Retrieve any number of fields c.Characters.Search("mario", SetFields("name", "gender", "url", "species", "games", "mug_shot")) // Retrieve all available fields c.Characters.Search("mario", SetFields("*"))
Output:
func SetFilter ¶
SetFilter is a functional option used to filter the results from an API call. Filtering operations need three different arguments: an operator and 2 operands, the field and its value. The provided field and val string act as the operands for the provided operator. If multiple values are provided, they will be concatenated into a comma separated list. If no values are provided, an error is returned.
SetFilter is the only option allowed to be set multiple times in a single API call. By default, results are unfiltered.
Note that when filtering a field that consists of an enumerated type (e.g. Gender Code, Feed Category, Game Status, etc.), you must provide the number corresponding to the intended field value. For your convenience, you may also provide the enumerated constant.
For more information, visit: https://api-docs.igdb.com/#filters
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Retrieve unfiltered games - default c.Games.Index() // Retrieve games with popularity above 50 c.Games.Index(SetFilter("hypes", OpGreaterThan, "50")) // Retrieve games with cover art c.Games.Index(SetFilter("cover", OpNotEquals, "null")) // Retrieve games released on PS4 (platform ID of 48) c.Games.Index(SetFilter("platforms", OpEquals, "48")) // Retrieve games whose name does not match "Horizon: Zero Dawn" c.Games.Index(SetFilter("name", OpNotEquals, "Horizon: Zero Dawn")) // Retrieve games which have the Adventure genre (Genre ID of 31) c.Games.Index(SetFilter("genres", OpContainsAtLeast, "31")) // Retrieve games that meet all the previous requirements c.Games.Index( SetFilter("hypes", OpGreaterThan, "50"), SetFilter("cover", OpNotEquals, "null"), SetFilter("platforms", OpEquals, "48"), SetFilter("name", OpNotEquals, "Horizon: Zero Dawn"), SetFilter("genres", OpContainsAtLeast, "31"), )
Output:
func SetLimit ¶
SetLimit is a functional option used to limit the number of results from an API call. The default limit is 10. The maximum limit is 500.
For more information, visit: https://api-docs.igdb.com/#pagination
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Retrieve up to 10 results - default c.Characters.Search("snake") // Retrieve up to 50 results c.Characters.Search("snake", SetLimit(50)) // Retrieve up to 1 result c.Characters.Search("snake", SetLimit(1))
Output:
func SetOffset ¶
SetOffset is a functional option used to offset the results from an API call. The default offset is 0.
For more information, visit: https://api-docs.igdb.com/#pagination
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) batchLimit := SetLimit(50) // Retrieve first batch of results - default c.Games.Index(batchLimit) // Retrieve second batch of results c.Games.Index(batchLimit, SetOffset(50)) // Retrieve third batch of results c.Games.Index(batchLimit, SetOffset(100)) // Retrieve fourth batch of results c.Games.Index(batchLimit, SetOffset(150))
Output:
func SetOrder ¶
SetOrder is a functional option used to sort the results from an API call. The default order is by relevance.
For more information, visit: https://api-docs.igdb.com/#sorting
Example ¶
c := NewClient("YOUR_CLIENT_ID", "YOUR_APP_ACCESS_TOKEN", nil) // Retrieve most relevant games - default c.Games.Search("zelda") // Retrieve most hyped games c.Games.Search("zelda", SetOrder("hypes", OrderDescending)) // Retrieve least hyped games c.Games.Search("zelda", SetOrder("hypes", OrderAscending))
Output:
type Platform ¶
type Platform struct { ID int `json:"id"` Abbreviation string `json:"abbreviation"` AlternativeName string `json:"alternative_name"` Category PlatformCategory `json:"category"` CreatedAt int `json:"created_at"` Generation int `json:"generation"` Name string `json:"name"` PlatformLogo int `json:"platform_logo"` ProductFamily int `json:"product_family"` Slug string `json:"slug"` Summary string `json:"summary"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` Versions []int `json:"versions"` Websites []int `json:"websites"` }
Platform represents the hardware used to run the game or game delivery network. For more information visit: https://api-docs.igdb.com/#platform
type PlatformCategory ¶
type PlatformCategory int
PlatformCategory specifies a type of platform.
const ( PlatformConsole PlatformCategory = iota + 1 PlatformArcade PlatformPlatform PlatformOperatingSystem PlatformPortableConsole PlatformComputer )
Expected PlatformCategory enums from the IGDB.
func (PlatformCategory) String ¶
func (i PlatformCategory) String() string
type PlatformFamily ¶
type PlatformFamily struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` }
PlatformFamily represents a collection of closely related platforms. For more information visit: https://api-docs.igdb.com/#platform-family
type PlatformFamilyService ¶
type PlatformFamilyService service
PlatformFamilyService handles all the API calls for the IGDB PlatformFamily endpoint.
func (*PlatformFamilyService) Count ¶
func (ps *PlatformFamilyService) Count(opts ...Option) (int, error)
Count returns the number of PlatformFamilies available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformFamilies to count.
func (*PlatformFamilyService) Fields ¶
func (ps *PlatformFamilyService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformFamily object.
func (*PlatformFamilyService) Get ¶
func (ps *PlatformFamilyService) Get(id int, opts ...Option) (*PlatformFamily, error)
Get returns a single PlatformFamily identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformFamilies, an error is returned.
func (*PlatformFamilyService) Index ¶
func (ps *PlatformFamilyService) Index(opts ...Option) ([]*PlatformFamily, error)
Index returns an index of PlatformFamilies based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformFamilies can be found using the provided options, an error is returned.
func (*PlatformFamilyService) List ¶
func (ps *PlatformFamilyService) List(ids []int, opts ...Option) ([]*PlatformFamily, error)
List returns a list of PlatformFamilies identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformFamily is ignored. If none of the IDs match a PlatformFamily, an error is returned.
type PlatformLogo ¶
PlatformLogo represents a logo for a particular platform. For more information visit: https://api-docs.igdb.com/#platform-logo
type PlatformLogoService ¶
type PlatformLogoService service
PlatformLogoService handles all the API calls for the IGDB PlatformLogo endpoint.
func (*PlatformLogoService) Count ¶
func (ps *PlatformLogoService) Count(opts ...Option) (int, error)
Count returns the number of PlatformLogos available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformLogos to count.
func (*PlatformLogoService) Fields ¶
func (ps *PlatformLogoService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformLogo object.
func (*PlatformLogoService) Get ¶
func (ps *PlatformLogoService) Get(id int, opts ...Option) (*PlatformLogo, error)
Get returns a single PlatformLogo identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformLogos, an error is returned.
func (*PlatformLogoService) Index ¶
func (ps *PlatformLogoService) Index(opts ...Option) ([]*PlatformLogo, error)
Index returns an index of PlatformLogos based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformLogos can be found using the provided options, an error is returned.
func (*PlatformLogoService) List ¶
func (ps *PlatformLogoService) List(ids []int, opts ...Option) ([]*PlatformLogo, error)
List returns a list of PlatformLogos identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformLogo is ignored. If none of the IDs match a PlatformLogo, an error is returned.
type PlatformService ¶
type PlatformService service
PlatformService handles all the API calls for the IGDB Platform endpoint.
func (*PlatformService) Count ¶
func (ps *PlatformService) Count(opts ...Option) (int, error)
Count returns the number of Platforms available in the IGDB. Provide the SetFilter functional option if you need to filter which Platforms to count.
func (*PlatformService) Fields ¶
func (ps *PlatformService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Platform object.
func (*PlatformService) Get ¶
func (ps *PlatformService) Get(id int, opts ...Option) (*Platform, error)
Get returns a single Platform identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Platforms, an error is returned.
func (*PlatformService) Index ¶
func (ps *PlatformService) Index(opts ...Option) ([]*Platform, error)
Index returns an index of Platforms based solely on the provided functional options used to sort, filter, and paginate the results. If no Platforms can be found using the provided options, an error is returned.
func (*PlatformService) List ¶
func (ps *PlatformService) List(ids []int, opts ...Option) ([]*Platform, error)
List returns a list of Platforms identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Platform is ignored. If none of the IDs match a Platform, an error is returned.
func (*PlatformService) Search ¶
func (ps *PlatformService) Search(qry string, opts ...Option) ([]*Platform, error)
Search returns a list of Platforms found by searching the IGDB using the provided query. Provide functional options to sort, filter, and paginate the results. If no Platforms are found using the provided query, an error is returned.
type PlatformVersion ¶
type PlatformVersion struct { ID int `json:"id"` Companies []int `json:"companies"` Connectivity string `json:"connectivity"` CPU string `json:"cpu"` Graphics string `json:"graphics"` MainManufacturer int `json:"main_manufacturer"` Media string `json:"media"` Memory string `json:"memory"` Name string `json:"name"` OS string `json:"os"` Output string `json:"output"` PlatformLogo int `json:"platform_logo"` PlatformVersionReleaseDates []int `json:"platform_version_release_dates"` Resolutions string `json:"resolutions"` Slug string `json:"slug"` Sound string `json:"sound"` Storage string `json:"storage"` Summary string `json:"summary"` URL string `json:"url"` }
PlatformVersion represents a particular version of a platform. For more information visit: https://api-docs.igdb.com/#platform-version
type PlatformVersionCompany ¶
type PlatformVersionCompany struct { ID int `json:"id"` Comment string `json:"comment"` Company int `json:"company"` Developer bool `json:"developer"` Manufacturer bool `json:"manufacturer"` }
PlatformVersionCompany represents a platform developer. For more information visit: https://api-docs.igdb.com/#platform-version-company
type PlatformVersionCompanyService ¶
type PlatformVersionCompanyService service
PlatformVersionCompanyService handles all the API calls for the IGDB PlatformVersionCompany endpoint.
func (*PlatformVersionCompanyService) Count ¶
func (ps *PlatformVersionCompanyService) Count(opts ...Option) (int, error)
Count returns the number of PlatformVersionCompanies available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformVersionCompanies to count.
func (*PlatformVersionCompanyService) Fields ¶
func (ps *PlatformVersionCompanyService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformVersionCompany object.
func (*PlatformVersionCompanyService) Get ¶
func (ps *PlatformVersionCompanyService) Get(id int, opts ...Option) (*PlatformVersionCompany, error)
Get returns a single PlatformVersionCompany identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformVersionCompanies, an error is returned.
func (*PlatformVersionCompanyService) Index ¶
func (ps *PlatformVersionCompanyService) Index(opts ...Option) ([]*PlatformVersionCompany, error)
Index returns an index of PlatformVersionCompanies based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformVersionCompanies can be found using the provided options, an error is returned.
func (*PlatformVersionCompanyService) List ¶
func (ps *PlatformVersionCompanyService) List(ids []int, opts ...Option) ([]*PlatformVersionCompany, error)
List returns a list of PlatformVersionCompanies identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformVersionCompany is ignored. If none of the IDs match a PlatformVersionCompany, an error is returned.
type PlatformVersionReleaseDate ¶
type PlatformVersionReleaseDate struct { ID int `json:"id"` Category DateCategory `json:"category"` CreatedAt int `json:"created_at"` Date int `json:"date"` Human string `json:"human"` M int `json:"m"` PlatformVersion int `json:"platform_version"` Region RegionCategory `json:"region"` UpdatedAt int `json:"updated_at"` Y int `json:"y"` }
PlatformVersionReleaseDate describes a platform release date. Used to dig deeper into release dates, platforms, and versions. For more information visit: https://api-docs.igdb.com/#platform-version-release-date
type PlatformVersionReleaseDateService ¶
type PlatformVersionReleaseDateService service
PlatformVersionReleaseDateService handles all the API calls for the IGDB PlatformVersionReleaseDate endpoint.
func (*PlatformVersionReleaseDateService) Count ¶
func (ps *PlatformVersionReleaseDateService) Count(opts ...Option) (int, error)
Count returns the number of PlatformVersionReleaseDates available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformVersionReleaseDates to count.
func (*PlatformVersionReleaseDateService) Fields ¶
func (ps *PlatformVersionReleaseDateService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformVersionReleaseDate object.
func (*PlatformVersionReleaseDateService) Get ¶
func (ps *PlatformVersionReleaseDateService) Get(id int, opts ...Option) (*PlatformVersionReleaseDate, error)
Get returns a single PlatformVersionReleaseDate identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformVersionReleaseDates, an error is returned.
func (*PlatformVersionReleaseDateService) Index ¶
func (ps *PlatformVersionReleaseDateService) Index(opts ...Option) ([]*PlatformVersionReleaseDate, error)
Index returns an index of PlatformVersionReleaseDates based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformVersionReleaseDates can be found using the provided options, an error is returned.
func (*PlatformVersionReleaseDateService) List ¶
func (ps *PlatformVersionReleaseDateService) List(ids []int, opts ...Option) ([]*PlatformVersionReleaseDate, error)
List returns a list of PlatformVersionReleaseDates identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformVersionReleaseDate is ignored. If none of the IDs match a PlatformVersionReleaseDate, an error is returned.
type PlatformVersionService ¶
type PlatformVersionService service
PlatformVersionService handles all the API calls for the IGDB PlatformVersion endpoint.
func (*PlatformVersionService) Count ¶
func (ps *PlatformVersionService) Count(opts ...Option) (int, error)
Count returns the number of PlatformVersions available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformVersions to count.
func (*PlatformVersionService) Fields ¶
func (ps *PlatformVersionService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformVersion object.
func (*PlatformVersionService) Get ¶
func (ps *PlatformVersionService) Get(id int, opts ...Option) (*PlatformVersion, error)
Get returns a single PlatformVersion identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformVersions, an error is returned.
func (*PlatformVersionService) Index ¶
func (ps *PlatformVersionService) Index(opts ...Option) ([]*PlatformVersion, error)
Index returns an index of PlatformVersions based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformVersions can be found using the provided options, an error is returned.
func (*PlatformVersionService) List ¶
func (ps *PlatformVersionService) List(ids []int, opts ...Option) ([]*PlatformVersion, error)
List returns a list of PlatformVersions identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformVersion is ignored. If none of the IDs match a PlatformVersion, an error is returned.
type PlatformWebsite ¶
type PlatformWebsite struct { ID int `json:"id"` Category WebsiteCategory `json:"category"` Trusted bool `json:"trusted"` URL string `json:"url"` }
PlatformWebsite represents the main website for a particular platform. For more information visit: https://api-docs.igdb.com/#platform-website
type PlatformWebsiteService ¶
type PlatformWebsiteService service
PlatformWebsiteService handles all the API calls for the IGDB PlatformWebsite endpoint.
func (*PlatformWebsiteService) Count ¶
func (ps *PlatformWebsiteService) Count(opts ...Option) (int, error)
Count returns the number of PlatformWebsites available in the IGDB. Provide the SetFilter functional option if you need to filter which PlatformWebsites to count.
func (*PlatformWebsiteService) Fields ¶
func (ps *PlatformWebsiteService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlatformWebsite object.
func (*PlatformWebsiteService) Get ¶
func (ps *PlatformWebsiteService) Get(id int, opts ...Option) (*PlatformWebsite, error)
Get returns a single PlatformWebsite identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlatformWebsites, an error is returned.
func (*PlatformWebsiteService) Index ¶
func (ps *PlatformWebsiteService) Index(opts ...Option) ([]*PlatformWebsite, error)
Index returns an index of PlatformWebsites based solely on the provided functional options used to sort, filter, and paginate the results. If no PlatformWebsites can be found using the provided options, an error is returned.
func (*PlatformWebsiteService) List ¶
func (ps *PlatformWebsiteService) List(ids []int, opts ...Option) ([]*PlatformWebsite, error)
List returns a list of PlatformWebsites identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlatformWebsite is ignored. If none of the IDs match a PlatformWebsite, an error is returned.
type PlayerPerspective ¶
type PlayerPerspective struct { ID int `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
PlayerPerspective describes the view or perspective of the player in a video game. For more information visit: https://api-docs.igdb.com/#player-perspective
type PlayerPerspectiveService ¶
type PlayerPerspectiveService service
PlayerPerspectiveService handles all the API calls for the IGDB PlayerPerspective endpoint.
func (*PlayerPerspectiveService) Count ¶
func (ps *PlayerPerspectiveService) Count(opts ...Option) (int, error)
Count returns the number of PlayerPerspectives available in the IGDB. Provide the SetFilter functional option if you need to filter which PlayerPerspectives to count.
func (*PlayerPerspectiveService) Fields ¶
func (ps *PlayerPerspectiveService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB PlayerPerspective object.
func (*PlayerPerspectiveService) Get ¶
func (ps *PlayerPerspectiveService) Get(id int, opts ...Option) (*PlayerPerspective, error)
Get returns a single PlayerPerspective identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any PlayerPerspectives, an error is returned.
func (*PlayerPerspectiveService) Index ¶
func (ps *PlayerPerspectiveService) Index(opts ...Option) ([]*PlayerPerspective, error)
Index returns an index of PlayerPerspectives based solely on the provided functional options used to sort, filter, and paginate the results. If no PlayerPerspectives can be found using the provided options, an error is returned.
func (*PlayerPerspectiveService) List ¶
func (ps *PlayerPerspectiveService) List(ids []int, opts ...Option) ([]*PlayerPerspective, error)
List returns a list of PlayerPerspectives identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a PlayerPerspective is ignored. If none of the IDs match a PlayerPerspective, an error is returned.
type RegionCategory ¶
type RegionCategory int
RegionCategory specifies a specific geographic region.
const ( RegionEurope RegionCategory = iota + 1 RegionNorthAmerica RegionAustralia RegionNewZealand RegionJapan RegionChina RegionAsia RegionWorldwide )
Expected RegionCategory enums from the IGDB.
func (RegionCategory) String ¶
func (i RegionCategory) String() string
type ReleaseDate ¶
type ReleaseDate struct { ID int `json:"id"` Category DateCategory `json:"category"` CreatedAt int `json:"created_at"` Date int `json:"date"` Game int `json:"game"` Human string `json:"human"` M int `json:"m"` Platform int `json:"platform"` Region RegionCategory `json:"region"` UpdatedAt int `json:"updated_at"` Y int `json:"y"` }
ReleaseDate represents the release date for a particular game. Used to dig deeper into release dates, platforms, and versions. For more information visit: https://api-docs.igdb.com/#release-date
type ReleaseDateService ¶
type ReleaseDateService service
ReleaseDateService handles all the API calls for the IGDB ReleaseDate endpoint.
func (*ReleaseDateService) Count ¶
func (rs *ReleaseDateService) Count(opts ...Option) (int, error)
Count returns the number of ReleaseDates available in the IGDB. Provide the SetFilter functional option if you need to filter which ReleaseDates to count.
func (*ReleaseDateService) Fields ¶
func (rs *ReleaseDateService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB ReleaseDate object.
func (*ReleaseDateService) Get ¶
func (rs *ReleaseDateService) Get(id int, opts ...Option) (*ReleaseDate, error)
Get returns a single ReleaseDate identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any ReleaseDates, an error is returned.
func (*ReleaseDateService) Index ¶
func (rs *ReleaseDateService) Index(opts ...Option) ([]*ReleaseDate, error)
Index returns an index of ReleaseDates based solely on the provided functional options used to sort, filter, and paginate the results. If no ReleaseDates can be found using the provided options, an error is returned.
func (*ReleaseDateService) List ¶
func (rs *ReleaseDateService) List(ids []int, opts ...Option) ([]*ReleaseDate, error)
List returns a list of ReleaseDates identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a ReleaseDate is ignored. If none of the IDs match a ReleaseDate, an error is returned.
type Screenshot ¶
Screenshot represents a screenshot of a particular game. For more information visit: https://api-docs.igdb.com/#screenshot
type ScreenshotService ¶
type ScreenshotService service
ScreenshotService handles all the API calls for the IGDB Screenshot endpoint.
func (*ScreenshotService) Count ¶
func (ss *ScreenshotService) Count(opts ...Option) (int, error)
Count returns the number of Screenshots available in the IGDB. Provide the SetFilter functional option if you need to filter which Screenshots to count.
func (*ScreenshotService) Fields ¶
func (ss *ScreenshotService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Screenshot object.
func (*ScreenshotService) Get ¶
func (ss *ScreenshotService) Get(id int, opts ...Option) (*Screenshot, error)
Get returns a single Screenshot identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Screenshots, an error is returned.
func (*ScreenshotService) Index ¶
func (ss *ScreenshotService) Index(opts ...Option) ([]*Screenshot, error)
Index returns an index of Screenshots based solely on the provided functional options used to sort, filter, and paginate the results. If no Screenshots can be found using the provided options, an error is returned.
func (*ScreenshotService) List ¶
func (ss *ScreenshotService) List(ids []int, opts ...Option) ([]*Screenshot, error)
List returns a list of Screenshots identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Screenshot is ignored. If none of the IDs match a Screenshot, an error is returned.
type SearchResult ¶
type SearchResult struct { AlternativeName string `json:"alternative_name"` Character int `json:"character"` Collection int `json:"collection"` Company int `json:"company"` Description string `json:"description"` Game int `json:"game"` Name string `json:"name"` Person int `json:"person"` Platform int `json:"platform"` PublishedAt int `json:"published_at"` TestDummy int `json:"test_dummy"` Theme int `json:"theme"` }
SearchResult represents a result from searching the IGDB. It can contain: Characters, Collections Games, People, Platforms, and Themes.
type ServerError ¶
type ServerError struct { Status int `json:"status"` Msg string `json:"message"` Temp bool `json:"temporary"` }
ServerError contains information on an error returned from an IGDB API call.
func (ServerError) Error ¶
func (e ServerError) Error() string
Error formats the ServerError and fulfills the error interface.
func (ServerError) Temporary ¶
func (e ServerError) Temporary() bool
Temporary returns true if the error is temporary.
type Tag ¶
type Tag int
Tag is a generated number that represents a specific IGDB object. Tag provides a quick and compact way to do complex filtering on the IGDB API.
func GenerateTag ¶
GenerateTag uses the ID of an IGDB object type and the ID of an IGDB object to generate a Tag addressed to that object. Negative ID values are considered invalid.
type Theme ¶
type Theme struct { ID int `json:"id"` CreatedAt int `json:"created_at"` Name string `json:"name"` Slug string `json:"slug"` UpdatedAt int `json:"updated_at"` URL string `json:"url"` }
Theme represents a particular video game theme. For more information visit: https://api-docs.igdb.com/#theme
type ThemeService ¶
type ThemeService service
ThemeService handles all the API calls for the IGDB Theme endpoint.
func (*ThemeService) Count ¶
func (ts *ThemeService) Count(opts ...Option) (int, error)
Count returns the number of Themes available in the IGDB. Provide the SetFilter functional option if you need to filter which Themes to count.
func (*ThemeService) Fields ¶
func (ts *ThemeService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Theme object.
func (*ThemeService) Get ¶
func (ts *ThemeService) Get(id int, opts ...Option) (*Theme, error)
Get returns a single Theme identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Themes, an error is returned.
func (*ThemeService) Index ¶
func (ts *ThemeService) Index(opts ...Option) ([]*Theme, error)
Index returns an index of Themes based solely on the provided functional options used to sort, filter, and paginate the results. If no Themes can be found using the provided options, an error is returned.
func (*ThemeService) List ¶
func (ts *ThemeService) List(ids []int, opts ...Option) ([]*Theme, error)
List returns a list of Themes identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Theme is ignored. If none of the IDs match a Theme, an error is returned.
func (*ThemeService) Search ¶
func (ts *ThemeService) Search(qry string, opts ...Option) ([]*Theme, error)
Search returns a list of Themes found by searching the IGDB using the provided query. Provide functional options to sort, filter, and paginate the results. If no Themes are found using the provided query, an error is returned.
type VersionFeatureCategory ¶
type VersionFeatureCategory int
VersionFeatureCategory specifies the type of feature for a particular game.
const ( VersionFeatureBoolean VersionFeatureCategory = iota VersionFeatureDescription )
Expected VersionFeatureCategory enums from the IGDB.
func (VersionFeatureCategory) String ¶
func (i VersionFeatureCategory) String() string
type VersionFeatureInclusion ¶
type VersionFeatureInclusion int
VersionFeatureInclusion specifies whether a feature is included or not.
const ( VersionFeatureNotIncluded VersionFeatureInclusion = iota VersionFeatureIncluded VersionFeaturePreOrderOnly )
Expected VersionFeatureInclusion enums from the IGDB.
func (VersionFeatureInclusion) String ¶
func (i VersionFeatureInclusion) String() string
type Website ¶
type Website struct { ID int `json:"id"` Category WebsiteCategory `json:"category"` Trusted bool `json:"trusted"` URL string `json:"url"` }
Website represents a website and its URL; usually associated with a game. For more information visit: https://api-docs.igdb.com/#website
type WebsiteCategory ¶
type WebsiteCategory int
WebsiteCategory specifies a specific popular website.
const ( WebsiteOfficial WebsiteCategory = iota + 1 WebsiteWikia WebsiteWikipedia WebsiteFacebook WebsiteTwitter WebsiteTwitch WebsiteInstagram WebsiteYoutube WebsiteIphone WebsiteIpad WebsiteAndroid WebsiteSteam WebsiteReddit WebsiteDiscord WebsiteGooglePlus WebsiteTumblr WebsiteLinkedin WebsitePinterest WebsiteSoundcloud )
Expected WebsiteCategory enums from the IGDB.
type WebsiteService ¶
type WebsiteService service
WebsiteService handles all the API calls for the IGDB Website endpoint.
func (*WebsiteService) Count ¶
func (ws *WebsiteService) Count(opts ...Option) (int, error)
Count returns the number of Websites available in the IGDB. Provide the SetFilter functional option if you need to filter which Websites to count.
func (*WebsiteService) Fields ¶
func (ws *WebsiteService) Fields() ([]string, error)
Fields returns the up-to-date list of fields in an IGDB Website object.
func (*WebsiteService) Get ¶
func (ws *WebsiteService) Get(id int, opts ...Option) (*Website, error)
Get returns a single Website identified by the provided IGDB ID. Provide the SetFields functional option if you need to specify which fields to retrieve. If the ID does not match any Websites, an error is returned.
func (*WebsiteService) Index ¶
func (ws *WebsiteService) Index(opts ...Option) ([]*Website, error)
Index returns an index of Websites based solely on the provided functional options used to sort, filter, and paginate the results. If no Websites can be found using the provided options, an error is returned.
func (*WebsiteService) List ¶
func (ws *WebsiteService) List(ids []int, opts ...Option) ([]*Website, error)
List returns a list of Websites identified by the provided list of IGDB IDs. Provide functional options to sort, filter, and paginate the results. Any ID that does not match a Website is ignored. If none of the IDs match a Website, an error is returned.
Source Files ¶
- agerating.go
- ageratingcategory_string.go
- ageratingcontent.go
- ageratingcontentcategory_string.go
- alternativename.go
- artwork.go
- character.go
- charactergender_string.go
- charactermugshot.go
- collection.go
- company.go
- companylogo.go
- companywebsite.go
- cover.go
- datecategory_string.go
- endpoints.go
- error.go
- externalgame.go
- externalgamecategory_string.go
- franchise.go
- game.go
- gamecategory_string.go
- gameengine.go
- gameenginelogo.go
- gamemode.go
- gameversion.go
- gameversionfeature.go
- gameversionfeaturevalue.go
- gamevideo.go
- genre.go
- igdb.go
- image.go
- involvedcompany.go
- keyword.go
- multiplayermode.go
- options.go
- platform.go
- platformcategory_string.go
- platformfamily.go
- platformlogo.go
- platformversion.go
- platformversioncompany.go
- platformversionreleasedate.go
- platformwebsite.go
- playerperspective.go
- releasedate.go
- screenshot.go
- search.go
- tag.go
- testing.go
- theme.go
- versionfeaturecategory_string.go
- versionfeatureinclusion_string.go
- website.go