igdbapi

package
v0.0.0-...-ea0be71 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

IGDB (Internet Game Database) API

Index

Constants

View Source
const (
	WebsiteOfficial  = 1
	WebsiteWikia     = 2
	WebsiteWikipedia = 3
	WebsiteFacebook  = 4
	WebsiteTwitter   = 5
	WebsiteTwitch    = 6
	WebsiteInstagram = 8
	WebsiteYoutube   = 9
	WebsiteIphone    = 10
	WebsiteIpad      = 11
	WebsiteAndroid   = 12
	WebsiteSteam     = 13
	WebsiteReddit    = 14
	WebsiteItch      = 15
	WebsiteEpicgames = 16
	WebsiteGog       = 17
)

https://api-docs.igdb.com/#website-enums

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(apiKey string) *Client

func (*Client) ExternalIdsByGameId

func (c *Client) ExternalIdsByGameId(ctx context.Context, id string) (*ExternalIds, error)

this game's ID is: - "com.frogmind.badland" on Google Play - "269670" on Steam - etc.

func (*Client) GameById

func (c *Client) GameById(ctx context.Context, id string) (*Game, error)

func (*Client) GameCoverUrls

func (c *Client) GameCoverUrls(ctx context.Context, id string) ([]string, error)

func (*Client) GameScreenshotUrls

func (c *Client) GameScreenshotUrls(ctx context.Context, id string) ([]string, error)

func (*Client) GameYoutubeVideoIds

func (c *Client) GameYoutubeVideoIds(ctx context.Context, id string) ([]string, error)

func (*Client) SearchGames

func (c *Client) SearchGames(ctx context.Context, name string) ([]Game, error)

func (*Client) WebsitesByGameId

func (c *Client) WebsitesByGameId(ctx context.Context, id string) ([]Website, error)

type ExternalIds

type ExternalIds struct {
	Official             *string // official website, "homepage"
	SteamId              *string
	GogSlug              *string
	EnglishWikipediaSlug *string
	RedditSlug           *string
	GooglePlayAppId      *string
	AppleAppStoreAppId   *string
}

type Game

type Game struct {
	ID               int       `json:"id"`
	Name             string    `json:"name"`
	Summary          string    `json:"summary"`
	FirstReleaseDate *UnixTime `json:"first_release_date"`
	Url              string    `json:"url"`
}

type UnixTime

type UnixTime time.Time

func (UnixTime) MarshalJSON

func (t UnixTime) MarshalJSON() ([]byte, error)

func (*UnixTime) UnmarshalJSON

func (t *UnixTime) UnmarshalJSON(s []byte) (err error)

type Website

type Website struct {
	Category int    `json:"category"`
	Url      string `json:"url"`
}

Jump to

Keyboard shortcuts

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