Documentation ¶
Index ¶
- type Achievement
- type AddedByStatus
- type Client
- func (api *Client) GetCreator(id int) (*CreatorDetailed, error)
- func (api *Client) GetCreatorRoles(page int, pageSize int) ([]*Role, int, error)
- func (api *Client) GetCreators(page int, pageSize int) ([]*Creator, int, error)
- func (api *Client) GetDeveloper(id int) (*DeveloperDetailed, error)
- func (api *Client) GetDevelopers(page int, pageSize int) ([]*Developer, int, error)
- func (api *Client) GetGame(id int) (*GameDetailed, error)
- func (api *Client) GetGameAchievements(id int) ([]*Achievement, error)
- func (api *Client) GetGameAdditions(gameID int, page int, pageSize int) ([]*Game, int, error)
- func (api *Client) GetGameDevelopmentTeam(gameID int, page int, pageSize int, ordering string) ([]*GameDeveloper, int, error)
- func (api *Client) GetGameMovies(id int) ([]*Movie, error)
- func (api *Client) GetGameReddit(id int) ([]*Reddit, error)
- func (api *Client) GetGameScreenshots(gameID int, page int, pageSize int) ([]*Screenshot, int, error)
- func (api *Client) GetGameSeries(gameID int, page int, pageSize int) ([]*Game, int, error)
- func (api *Client) GetGameStores(gameID int, page int, pageSize int) ([]*GameStore, int, error)
- func (api *Client) GetGameSuggested(id int) ([]*Game, error)
- func (api *Client) GetGameTwitch(id int) ([]*Twitch, error)
- func (api *Client) GetGameYoutube(id int) ([]*Youtube, error)
- func (api *Client) GetGames(filter *GamesFilter) ([]*Game, int, error)
- func (api *Client) GetGenre(id int) (*GenreDetailed, error)
- func (api *Client) GetGenres(page int, pageSize int, ordering string) ([]*Genre, int, error)
- func (api *Client) GetParentGames(gameID int, page int, pageSize int) ([]*Game, int, error)
- func (api *Client) GetParentsPlatforms(page int, pageSize int, ordering string) ([]*Platform, int, error)
- func (api *Client) GetPlatform(id int) (*PlatformDetailed, error)
- func (api *Client) GetPlatforms(page int, pageSize int, ordering string) ([]*Platform, int, error)
- func (api *Client) GetPublisher(id int) (*PublisherDetailed, error)
- func (api *Client) GetPublishers(page int, pageSize int) ([]*Publisher, int, error)
- func (api *Client) GetStore(id int) (*StoreDetailed, error)
- func (api *Client) GetStores(page int, pageSize int, ordering string) ([]*Store, int, error)
- func (api *Client) GetTag(id int) (*TagDetailed, error)
- func (api *Client) GetTags(page int, pageSize int) ([]*Tag, int, error)
- type Clip
- type Config
- type Creator
- type CreatorDetailed
- type DateRange
- type DateTime
- type Developer
- type DeveloperDetailed
- type EsrbRating
- type Game
- type GameDetailed
- type GameDeveloper
- type GameStore
- type GamesFilter
- func (filter *GamesFilter) ExcludeCollection(collection int) *GamesFilter
- func (filter *GamesFilter) GetParams() map[string]interface{}
- func (filter *GamesFilter) SetCreators(creators ...interface{}) *GamesFilter
- func (filter *GamesFilter) SetDates(ranges ...*DateRange) *GamesFilter
- func (filter *GamesFilter) SetDevelopers(developers ...interface{}) *GamesFilter
- func (filter *GamesFilter) SetGenres(genres ...interface{}) *GamesFilter
- func (filter *GamesFilter) SetOrdering(ordering string) *GamesFilter
- func (filter *GamesFilter) SetPage(page int) *GamesFilter
- func (filter *GamesFilter) SetPageSize(pageSize int) *GamesFilter
- func (filter *GamesFilter) SetParentPlatforms(parentPlatforms ...int) *GamesFilter
- func (filter *GamesFilter) SetPlatforms(platforms ...int) *GamesFilter
- func (filter *GamesFilter) SetPlatformsCount(count int) *GamesFilter
- func (filter *GamesFilter) SetPublishers(publishers ...interface{}) *GamesFilter
- func (filter *GamesFilter) SetSearch(search string) *GamesFilter
- func (filter *GamesFilter) SetStores(stores ...int) *GamesFilter
- func (filter *GamesFilter) SetTags(tags ...interface{}) *GamesFilter
- func (filter *GamesFilter) WithoutAdditions() *GamesFilter
- func (filter *GamesFilter) WithoutGameSeries() *GamesFilter
- func (filter *GamesFilter) WithoutParents() *GamesFilter
- type Genre
- type GenreDetailed
- type MetacriticPlatform
- type Movie
- type ParentPlatform
- type Platform
- type PlatformDetailed
- type Position
- type Publisher
- type PublisherDetailed
- type Rating
- type RawgError
- type Reddit
- type Requirement
- type Role
- type Screenshot
- type Store
- type StoreDetailed
- type Tag
- type TagDetailed
- type Twitch
- type Youtube
- type YoutubeThumbnail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Achievement ¶
type Achievement struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Image string `json:"image"` Percent float32 `json:"percent,string"` }
Achievement (a meta-goal defined outside a game's parameters)
type AddedByStatus ¶
type AddedByStatus struct { Yet int `json:"yet"` Owned int `json:"owned"` Beaten int `json:"beaten"` Toplay int `json:"toplay"` Dropped int `json:"dropped"` Playing int `json:"playing"` }
AddedByStatus represents number of games added by status
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to interract with RAWG API
func (*Client) GetCreator ¶
func (api *Client) GetCreator(id int) (*CreatorDetailed, error)
GetCreator returns details of the creator
func (*Client) GetCreatorRoles ¶
GetCreatorRoles returns a list of creator positions (jobs)
func (*Client) GetCreators ¶
GetCreators returns a list of game creators
func (*Client) GetDeveloper ¶
func (api *Client) GetDeveloper(id int) (*DeveloperDetailed, error)
GetDeveloper returns details of the developer
func (*Client) GetDevelopers ¶
GetDevelopers returns a list of game developers
func (*Client) GetGame ¶
func (api *Client) GetGame(id int) (*GameDetailed, error)
GetGame returns details of the game
func (*Client) GetGameAchievements ¶
func (api *Client) GetGameAchievements(id int) ([]*Achievement, error)
GetGameAchievements returns a list of game achievements
func (*Client) GetGameAdditions ¶
GetGameAdditions returns a list of DLC's for the game, GOTY and other editions, companion apps, etc
func (*Client) GetGameDevelopmentTeam ¶
func (api *Client) GetGameDevelopmentTeam(gameID int, page int, pageSize int, ordering string) ([]*GameDeveloper, int, error)
GetGameDevelopmentTeam returns a list of individual creators that were part of the development team
func (*Client) GetGameMovies ¶
GetGameMovies returns a list of game trailers
func (*Client) GetGameReddit ¶
GetGameReddit returns a list of most recent posts from the game's subreddit
func (*Client) GetGameScreenshots ¶
func (api *Client) GetGameScreenshots(gameID int, page int, pageSize int) ([]*Screenshot, int, error)
GetGameScreenshots returns a screenshots list for the game
func (*Client) GetGameSeries ¶
GetGameSeries returns a list of games that are part of same series
func (*Client) GetGameStores ¶
GetGameStores returns links to the stores that sell the game
func (*Client) GetGameSuggested ¶
GetGameSuggested returns a list of visually similar games
func (*Client) GetGameTwitch ¶
GetGameTwitch returns streams on Twitch associated with the game
func (*Client) GetGameYoutube ¶
GetGameYoutube returns videos from YouTube associated with the game
func (*Client) GetGames ¶
func (api *Client) GetGames(filter *GamesFilter) ([]*Game, int, error)
GetGames returns a list of games
func (*Client) GetGenre ¶
func (api *Client) GetGenre(id int) (*GenreDetailed, error)
GetGenre returns details of the genre
func (*Client) GetParentGames ¶
GetParentGames returns a list of parent games for DLC's and editions
func (*Client) GetParentsPlatforms ¶
func (api *Client) GetParentsPlatforms(page int, pageSize int, ordering string) ([]*Platform, int, error)
GetParentsPlatforms returns a list of parent platforms
func (*Client) GetPlatform ¶
func (api *Client) GetPlatform(id int) (*PlatformDetailed, error)
GetPlatform returns details of the platform
func (*Client) GetPlatforms ¶
GetPlatforms returns a list of video game platforms
func (*Client) GetPublisher ¶
func (api *Client) GetPublisher(id int) (*PublisherDetailed, error)
GetPublisher returns details of the publisher
func (*Client) GetPublishers ¶
GetPublishers returns a list of video game publishers
func (*Client) GetStore ¶
func (api *Client) GetStore(id int) (*StoreDetailed, error)
GetStore returns details of the store
type Clip ¶
type Clip struct { Clip string `json:"clip"` Clips map[string]string `json:"clips"` Video string `json:"video"` Preview string `json:"preview"` }
Clip (Trailer) of the game
type Config ¶
type Config struct { ApiKey string // Your personal API key Language string // Language name (ISO 639-1) Rps int // Max allowed count of requests per second (default: 5) }
Config represents a configuration of RAWG client
type Creator ¶
type Creator struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Image string `json:"results"` ImageBackground string `json:"image_background"` GamesCount int `json:"games_count"` }
Creator represents main information about creator
type CreatorDetailed ¶
type CreatorDetailed struct { Creator Description string `json:"description"` ReviewsCount int `json:"reviews_count"` Rating string `json:"rating"` RatingTop int `json:"rating_top"` Updated DateTime `json:"updated"` }
CreatorDetailed represents detailed information about creator
type DateTime ¶
DateTime is a special type to unmarshal dates from any formats
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON converts json to time.Time
type Developer ¶
type Developer struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` }
Developer represents main information about video game developer
type DeveloperDetailed ¶
DeveloperDetailed represents detailed information about video game developer
type EsrbRating ¶
EsrbRating is an Entertainment Software Rating Board
type Game ¶
type Game struct { ID int `json:"id"` Slug string `json:"slug"` Name string `json:"name"` Released DateTime `json:"released"` Tba bool `json:"tba"` ImageBackground string `json:"background_image"` Rating float32 `json:"rating"` RatingTop int `json:"rating_top"` Ratings []*Rating `json:"ratings"` RatingsCount int `json:"ratings_count"` ReviewsTextCount int `json:"reviews_text_count"` Added int `json:"added"` AddedByStatus *AddedByStatus `json:"added_by_status"` Metacritic int `json:"metacritic"` Playtime int `json:"playtime"` SuggestionsCount int `json:"suggestions_count"` ReviewsCount int `json:"reviews_count"` SaturatedColor string `json:"saturated_color"` DominantColor string `json:"dominant_color"` Platforms []*struct { Platform *Platform `json:"platform"` ReleasedAt DateTime `json:"released_at"` RequirementsEn *Requirement `json:"requirements_en"` RequirementsRu *Requirement `json:"requirements_ru"` } `json:"platforms"` ParentPlatforms []*struct { Platform struct { ID int `json:"id"` Slug string `json:"slug"` Name string `json:"name"` } } `json:"parent_platforms"` Genres []*Genre `json:"genres"` Stores []*struct { ID int `json:"id"` Store *Store `json:"store"` UrlEn string `json:"url_en"` UrlRu string `json:"url_ru"` } `json:"stores"` Clip *Clip `json:"clip"` Tags []*Tag `json:"tags"` ShortScreenshots []*struct { ID int `json:"id"` Name string `json:"name"` } `json:"short_screenshots"` }
Game represents main information of the game
type GameDetailed ¶
type GameDetailed struct { ID int `json:"id"` Slug string `json:"slug"` Name string `json:"name"` NameOriginal string `json:"name_original"` Description string `json:"description"` Metacritic int `json:"metacritic"` MetacriticPlatforms []*MetacriticPlatform `json:"metacritic_platforms"` Released DateTime `json:"released"` Tba bool `json:"tba"` Updated DateTime `json:"updated"` ImageBackground string `json:"background_image"` ImageBackgroundAdditional string `json:"background_image_additional"` Website string `json:"website"` Rating float32 `json:"rating"` RatingTop int `json:"rating_top"` Ratings []*Rating `json:"ratings"` Reactions map[string]int `json:"reactions"` Added int `json:"added"` AddedByStatus *AddedByStatus `json:"added_by_status"` Playtime int `json:"playtime"` ScreenshotsCount int `json:"screenshots_count"` MoviesCount int `json:"movies_count"` CreatorsCount int `json:"creators_count"` AchievementsCount int `json:"achievements_count"` ParentAchievementsCount int `json:"parent_achievements_count"` RedditUrl string `json:"reddit_url"` RedditName string `json:"reddit_name"` RedditDescription string `json:"reddit_description"` RedditLogo string `json:"reddit_logo"` RedditCount int `json:"reddit_count"` TwitchCount int `json:"twitch_count"` YoutubeCount int `json:"youtube_count"` ReviewsTextCount int `json:"reviews_text_count"` RatingsCount int `json:"ratings_count"` SuggestionsCount int `json:"suggestions_count"` AlternativeNames []string `json:"alternative_names"` MetacriticUrl string `json:"metacritic_url"` ParentsCount int `json:"parents_count"` AdditionsCount int `json:"additions_count"` GameSeriesCountCount int `json:"game_series_count"` ReviewsCount int `json:"reviews_count"` SaturatedColor string `json:"saturated_color"` DominantColor string `json:"dominant_color"` ParentPlatforms []*struct { Platform struct { ID int `json:"id"` Slug string `json:"slug"` Name string `json:"name"` } } `json:"parent_platforms"` Platforms []*struct { Platform *Platform `json:"platform"` ReleasedAt DateTime `json:"released_at"` Requirements *Requirement `json:"requirements"` } `json:"platforms"` Stores []*struct { ID int `json:"id"` Url string `json:"url"` Store *Store `json:"store"` } `json:"stores"` Developers []*Developer `json:"developers"` Genres []*Genre `json:"genres"` Tags []*Tag `json:"tags"` Publishers []*Publisher `json:"publishers"` EsrbRating *EsrbRating `json:"esrb_rating"` Clip *Clip `json:"clip"` DescriptionRaw string `json:"description_raw"` }
GameDetailed represents detailed information of the game
type GameDeveloper ¶
type GameDeveloper struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` Image string `json:"image"` ImageBackground string `json:"image_background"` GamesCount int `json:"games_count"` Games []*Game `json:"games"` Positions []*Position `json:"positions"` }
GameDeveloper represents detailed information of game developer (with games list)
type GameStore ¶
type GameStore struct { ID int `json:"id"` GameID int `json:"game_id"` StoreID int `json:"store_id"` Url string `json:"url"` }
GameStore represents "Video game - storefront" relation
type GamesFilter ¶
type GamesFilter struct {
// contains filtered or unexported fields
}
GamesFilter is a filter to search games in RAWG
func (*GamesFilter) ExcludeCollection ¶
func (filter *GamesFilter) ExcludeCollection(collection int) *GamesFilter
ExcludeCollection sets "exclude_collection" parameter
func (*GamesFilter) GetParams ¶
func (filter *GamesFilter) GetParams() map[string]interface{}
GetParams returns filter parameters as Map
func (*GamesFilter) SetCreators ¶
func (filter *GamesFilter) SetCreators(creators ...interface{}) *GamesFilter
SetCreators sets "creators" parameter
func (*GamesFilter) SetDates ¶
func (filter *GamesFilter) SetDates(ranges ...*DateRange) *GamesFilter
SetDates sets "dates" parameter
func (*GamesFilter) SetDevelopers ¶
func (filter *GamesFilter) SetDevelopers(developers ...interface{}) *GamesFilter
SetDevelopers sets "developers" parameter
func (*GamesFilter) SetGenres ¶
func (filter *GamesFilter) SetGenres(genres ...interface{}) *GamesFilter
SetGenres sets "genres" parameter
func (*GamesFilter) SetOrdering ¶
func (filter *GamesFilter) SetOrdering(ordering string) *GamesFilter
SetOrdering sets results ordering
func (*GamesFilter) SetPage ¶
func (filter *GamesFilter) SetPage(page int) *GamesFilter
SetPage sets "page" parameter
func (*GamesFilter) SetPageSize ¶
func (filter *GamesFilter) SetPageSize(pageSize int) *GamesFilter
SetPageSize sets "page_size" parameter
func (*GamesFilter) SetParentPlatforms ¶
func (filter *GamesFilter) SetParentPlatforms(parentPlatforms ...int) *GamesFilter
SetParentPlatforms sets "parent_platforms" parameter
func (*GamesFilter) SetPlatforms ¶
func (filter *GamesFilter) SetPlatforms(platforms ...int) *GamesFilter
SetPlatforms sets "platforms" parameter
func (*GamesFilter) SetPlatformsCount ¶
func (filter *GamesFilter) SetPlatformsCount(count int) *GamesFilter
SetPlatformsCount sets "platforms_count" parameter
func (*GamesFilter) SetPublishers ¶
func (filter *GamesFilter) SetPublishers(publishers ...interface{}) *GamesFilter
SetPublishers sets "publishers" parameter
func (*GamesFilter) SetSearch ¶
func (filter *GamesFilter) SetSearch(search string) *GamesFilter
SetSearch sets "search" parameter
func (*GamesFilter) SetStores ¶
func (filter *GamesFilter) SetStores(stores ...int) *GamesFilter
SetStores sets "stores" parameter
func (*GamesFilter) SetTags ¶
func (filter *GamesFilter) SetTags(tags ...interface{}) *GamesFilter
SetTags sets "tags" parameter
func (*GamesFilter) WithoutAdditions ¶
func (filter *GamesFilter) WithoutAdditions() *GamesFilter
WithoutAdditions sets "exclude_additions" parameter
func (*GamesFilter) WithoutGameSeries ¶
func (filter *GamesFilter) WithoutGameSeries() *GamesFilter
WithoutGameSeries sets "exclude_game_series" parameter
func (*GamesFilter) WithoutParents ¶
func (filter *GamesFilter) WithoutParents() *GamesFilter
WithoutParents sets "exclude_parents" parameter
type Genre ¶
type Genre struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` }
Genre represents game genre
type GenreDetailed ¶
GenreDetailed represents detailed information of video game genre
type MetacriticPlatform ¶
type MetacriticPlatform struct { Metascore int `json:"metascore"` Url string `json:"url"` Platform *struct { Platform int `json:"platform"` Name string `json:"name"` Slug string `json:"slug"` } `json:"platform"` }
MetacriticPlatform represents metascore - metacritic rating of the game
type Movie ¶
type Movie struct { ID int `json:"id"` Name string `json:"name"` Preview string `json:"preview"` Data map[string]string `json:"data"` }
Movie of the game
type ParentPlatform ¶
type ParentPlatform struct { Platform struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` } `json:"platform"` }
ParentPlatform is a parent video game platform. For instance, for PS2 and PS4 the “parent platform” is PlayStation.
type Platform ¶
type Platform struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` Image string `json:"image"` YearStart int `json:"year_start"` YearEnd int `json:"year_end"` }
Platform represents game platform
type PlatformDetailed ¶
PlatformDetailed represents detailed information of video game platform
type Publisher ¶
type Publisher struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` }
Publisher represents main information about video game publisher
type PublisherDetailed ¶
PublisherDetailed represents detailed information about video game developer
type Rating ¶
type Rating struct { ID int `json:"id"` Title string `json:"title"` Count int `json:"count"` Percent float32 `json:"percent"` }
Rating of the game
type RawgError ¶
type RawgError struct { HttpCode int // HTTP status code (https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) Url string // URL of RAWG endpoint associated with callable function Body string // Raw body of response Message string // Any comment }
RawgError represents information about errors
type Reddit ¶
type Reddit struct { ID int `json:"id"` Name string `json:"name"` Text string `json:"text"` Image string `json:"image"` Url string `json:"url"` Username string `json:"username"` UsernameUrl string `json:"username_url"` Created DateTime `json:"created"` }
Reddit comment
type Requirement ¶
Requirement represents game requirements
type Screenshot ¶
type Screenshot struct { ID int `json:"id"` Image string `json:"image"` Width int `json:"width"` Height int `json:"height"` IsDeleted bool `json:"is_deleted"` }
Screenshot of the game
type Store ¶
type Store struct { ID int `json:"id"` Name string `json:"name"` Domain string `json:"domain"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` }
Store is a video game storefront
type StoreDetailed ¶
StoreDetailed represents video game storefront (detailed information)
type Tag ¶
type Tag struct { ID int `json:"id"` Name string `json:"name"` Slug string `json:"slug"` GamesCount int `json:"games_count"` ImageBackground string `json:"image_background"` Language string `json:"language"` }
Tag of the video game
type TagDetailed ¶
TagDetailed represents detailed information about tag of the video game
type Twitch ¶
type Twitch struct { ID int `json:"id"` ExternalID int `json:"external_id"` Name string `json:"name"` Description string `json:"description"` Created DateTime `json:"created"` Published DateTime `json:"published"` Thumbnail string `json:"thumbnail"` ViewCount int `json:"view_count"` Language string `json:"language"` }
Twitch stream
type Youtube ¶
type Youtube struct { ID int `json:"id"` ExternalID string `json:"external_id"` ChannelID string `json:"channel_id"` Name string `json:"name"` Description string `json:"description"` Created DateTime `json:"created"` ViewCount int `json:"view_count"` CommentsCount int `json:"comments_count"` LikeCount int `json:"like_count"` DislikeCount int `json:"dislike_count"` FavoriteCount int `json:"favorite_count"` Thumbnails *struct { High *YoutubeThumbnail Medium *YoutubeThumbnail Default *YoutubeThumbnail SdDefault *YoutubeThumbnail MaxResDefault *YoutubeThumbnail } }
Youtube video associated with the game
type YoutubeThumbnail ¶
type YoutubeThumbnail struct { Url string `json:"url"` Width int `json:"width"` Height int `json:"height"` }
YoutubeThumbnail represents thumbnail of the youtube video