Documentation
¶
Overview ¶
Package steamspy exposes SteamSpy as a kit Domain driver. A multi-domain host (ant) enables it with a single blank import:
import _ "github.com/tamnd/steamspy-cli/steamspy"
The same Domain also builds the standalone steamspy binary (see cli/root.go), so the binary and a host share one source of truth.
Package steamspy is the library behind the steamspy command line: the HTTP client, request shaping, and the typed data models for SteamSpy (steamspy.com). No API key required.
The Client sets a real User-Agent, paces requests to stay polite, and retries transient failures (429 and 5xx).
Index ¶
- Constants
- type App
- type Client
- func (c *Client) App(ctx context.Context, appID int) (*App, error)
- func (c *Client) Genre(ctx context.Context, genre string, limit int) ([]App, error)
- func (c *Client) Search(ctx context.Context, term string, limit int) ([]App, error)
- func (c *Client) Top(ctx context.Context, limit int) ([]App, error)
- type Config
- type Domain
Constants ¶
const Host = "steamspy.com"
Host is the site this client talks to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶ added in v0.1.2
type App struct {
AppID int `kit:"id" json:"appid"`
Name string `json:"name"`
Developer string `json:"developer"`
Genre string `json:"genre"`
Owners string `json:"owners"`
Positive int `json:"positive"`
Negative int `json:"negative"`
Price string `json:"price"`
AvgHours string `json:"avg_hours"`
TopTags string `json:"top_tags"`
}
App is the output record for a Steam game.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to steamspy over HTTP.
func (*Client) Genre ¶ added in v0.1.1
Genre fetches games in the given genre, sorted by Positive desc, limited to limit.
type Config ¶ added in v0.1.1
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds all tunable parameters for the Client.
func DefaultConfig ¶ added in v0.1.1
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Domain ¶
type Domain struct{}
Domain is the steamspy driver.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.