Documentation
¶
Overview ¶
Package steamgriddb provides a client for the SteamGridDB API
Index ¶
- func ClearImageCache() error
- func GetCacheSize() (int64, error)
- func GetCachedImage(gameID int, imageURL string) ([]byte, string, error)
- func GetCachedImagePath(gameID int, imageURL string) (string, error)
- func GetGameCacheDir(gameID int) (string, error)
- func GetImageCacheDir() (string, error)
- func SaveImageToCache(gameID int, imageURL string, data []byte, contentType string) error
- type Client
- func (c *Client) GetGrids(gameID int, filters *ImageFilters, page int) ([]GridData, error)
- func (c *Client) GetHeroes(gameID int, filters *ImageFilters, page int) ([]ImageData, error)
- func (c *Client) GetIcons(gameID int, filters *ImageFilters, page int) ([]ImageData, error)
- func (c *Client) GetLogos(gameID int, filters *ImageFilters, page int) ([]ImageData, error)
- func (c *Client) Search(term string) ([]SearchResult, error)
- type GridData
- type ImageData
- type ImageFilters
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearImageCache ¶
func ClearImageCache() error
ClearImageCache clears the image cache (including all game subdirectories)
func GetCacheSize ¶
GetCacheSize returns the total size of the image cache (including subdirectories)
func GetCachedImage ¶
GetCachedImage returns the cached image data if it exists
func GetCachedImagePath ¶
GetCachedImagePath returns the file path of a cached image if it exists
func GetGameCacheDir ¶
GetGameCacheDir returns the cache directory for a specific game
func GetImageCacheDir ¶
GetImageCacheDir returns the path to the image cache directory
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a SteamGridDB API client
type GridData ¶
type GridData = ImageData
GridData is an alias for ImageData (grids share the same API schema).
type ImageData ¶
type ImageData 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"`
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"`
}
ImageData represents a SteamGridDB image (grid, hero, logo, or icon).
type ImageFilters ¶
type ImageFilters struct {
Style string `json:"style"`
MimeType string `json:"mimeType"`
ImageType string `json:"imageType"` // "static", "animated", or "" for all
Dimension string `json:"dimension"`
ShowNsfw bool `json:"showNsfw"`
ShowHumor bool `json:"showHumor"`
}
ImageFilters represents filters for image queries