Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) CachedDownload(url, path string) error
- func (c *Client) Download(url, path string) error
- func (c *Client) Get(path string) (*http.Response, error)
- func (c *Client) GetGrids(gameID string, filters ...FilterGrid) (*GridResponse, error)
- func (c *Client) GetHeroes(gameID string, filters ...FilterHeroes) (*HeroesResponse, error)
- func (c *Client) GetIcons(gameID string, filters ...FilterIcons) (*IconsResponse, error)
- func (c *Client) GetLogos(gameID string, filters ...FilterLogos) (*LogosResponse, error)
- func (c *Client) Search(term string) (*SearchResponse, error)
- type FilterGrid
- type FilterHeroes
- type FilterIcons
- type FilterLogos
- type GridResponse
- type GridResponseData
- type HeroesResponse
- type IconsResponse
- type ImageResponseData
- type LogosResponse
- type Response
- type SearchResponse
- type SearchResponseData
Constants ¶
const BASE_URL = "https://www.steamgriddb.com/api/v2"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a structure for querying the SteamGridDB API
func (*Client) CachedDownload ¶
CachedDownload will download only if the file does not already exist.
func (*Client) GetGrids ¶
func (c *Client) GetGrids(gameID string, filters ...FilterGrid) (*GridResponse, error)
GetGrids will return the results of the grids for a given game ID
func (*Client) GetHeroes ¶
func (c *Client) GetHeroes(gameID string, filters ...FilterHeroes) (*HeroesResponse, error)
GetHeroes will return the results of heroes for a given game ID
func (*Client) GetIcons ¶
func (c *Client) GetIcons(gameID string, filters ...FilterIcons) (*IconsResponse, error)
GetIcons will return the results of icons for a given game ID
func (*Client) GetLogos ¶
func (c *Client) GetLogos(gameID string, filters ...FilterLogos) (*LogosResponse, error)
GetLogos will return the results of logos for a given game ID
type FilterGrid ¶
type FilterGrid func(d *GridResponse) []GridResponseData
FilterGrid is a function signature for any function that will filter grid results.
func FilterGridHorizontal ¶
func FilterGridHorizontal() FilterGrid
FilterGridHorizontal will return a filter that will filter out all results that are not horizontal banner images.
func FilterGridStyle ¶
func FilterGridStyle(style string) FilterGrid
FilterGridStyle will return a filter that will filter out all results that don't match the given style.
func FilterGridVertical ¶
func FilterGridVertical() FilterGrid
FilterGridVertical will return a filter that will filter out all results that are not vertical poster images.
type FilterHeroes ¶
type FilterHeroes func(d *HeroesResponse) []ImageResponseData
func FilterHeroesStyle ¶
func FilterHeroesStyle(style string) FilterHeroes
type FilterIcons ¶
type FilterIcons func(d *IconsResponse) []ImageResponseData
func FilterIconsStyle ¶
func FilterIconsStyle(style string) FilterIcons
type FilterLogos ¶
type FilterLogos func(d *LogosResponse) []ImageResponseData
func FilterLogosStyle ¶
func FilterLogosStyle(style string) FilterLogos
type GridResponse ¶
type GridResponse struct { Response Data []GridResponseData `json:"data"` }
type GridResponseData ¶
type GridResponseData struct { ID int `json:"id"` Score int `json:"score"` Style string `json:"style"` Width int `json:"width"` Height int `json:"height"` Nsfw bool `json:"nsfw"` Humor bool `json:"humor"` Notes interface{} `json:"notes"` Mime string `json:"mime"` Language string `json:"language"` URL string `json:"url"` Thumb string `json:"thumb"` Lock bool `json:"lock"` Epilepsy bool `json:"epilepsy"` Upvotes int `json:"upvotes"` Downvotes int `json:"downvotes"` Author struct { Name string `json:"name"` Steam64 string `json:"steam64"` Avatar string `json:"avatar"` } `json:"author"` }
type HeroesResponse ¶
type HeroesResponse struct { Response Data []ImageResponseData `json:"data"` }
type IconsResponse ¶
type IconsResponse HeroesResponse
type ImageResponseData ¶
type ImageResponseData struct { ID int `json:"id"` Score int `json:"score"` Style string `json:"style"` URL string `json:"url"` Thumb string `json:"thumb"` Tags []string `json:"tags"` Author struct { Name string `json:"name"` Steam64 string `json:"steam64"` Avatar string `json:"avatar"` } `json:"author"` }
type LogosResponse ¶
type LogosResponse HeroesResponse
type SearchResponse ¶
type SearchResponse struct { Response Data []SearchResponseData `json:"data"` }
'https://www.steamgriddb.com/api/v2/search/autocomplete/{term}'