steam

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AchievementSchema

type AchievementSchema struct {
	Name         string `json:"name"`
	DefaultValue int    `json:"defaultvalue"`
	DisplayName  string `json:"displayName"`
	Description  string `json:"description"`
	Icon         string `json:"icon"`
	IconGray     string `json:"icongray"`
	Hidden       int    `json:"hidden"`
}

type AvailableGameStats

type AvailableGameStats struct {
	Achievements []AchievementSchema `json:"achievements"`
	Stats        []StatSchema        `json:"stats"`
}

type Client

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

Client is a Steam Web API client.

func NewClient

func NewClient(apiKey, steamID, cacheDir string, cacheExpiry time.Duration) *Client

NewClient creates a new Steam API client.

func (*Client) GetGameSchema

func (c *Client) GetGameSchema(appID int) (*GameSchemaResponse, error)

GetGameSchema retrieves the achievement schema for a game.

func (*Client) GetGameWithAchievements

func (c *Client) GetGameWithAchievements(game GameResponse) (*models.SteamGame, error)

GetGameWithAchievements retrieves a game with all achievement data.

func (*Client) GetOwnedGames

func (c *Client) GetOwnedGames(includeAppInfo, includePlayedFreeGames bool) ([]GameResponse, error)

GetOwnedGames retrieves the user's owned games.

func (*Client) GetPlayerAchievements

func (c *Client) GetPlayerAchievements(appID int) (*PlayerAchievementsResponse, error)

GetPlayerAchievements retrieves the player's achievements for a game.

type GameAbout

type GameAbout struct {
	ShortDescription string `json:"short_description"`
	Description      string `json:"description"`
}

type GameDeveloper

type GameDeveloper struct {
	Name string `json:"name"`
}

type GameInfo

type GameInfo struct {
	GameName           string              `json:"gameName"`
	GameVersion        string              `json:"gameVersion"`
	AvailableGameStats *AvailableGameStats `json:"availableGameStats"`
	About              *GameAbout          `json:"about"`
	Developers         []GameDeveloper     `json:"developers"`
	Publishers         []GamePublisher     `json:"publishers"`
}

type GamePublisher

type GamePublisher struct {
	Name string `json:"name"`
}

type GameResponse

type GameResponse struct {
	AppID                    int    `json:"appid"`
	Name                     string `json:"name"`
	PlaytimeForever          int    `json:"playtime_forever"`
	Playtime2Weeks           int    `json:"playtime_2weeks"`
	RtimeLastPlayed          *int64 `json:"rtime_last_played"`
	ImgIconURL               string `json:"img_icon_url"`
	ImgLogoURL               string `json:"img_logo_url"`
	HasCommunityVisibleStats bool   `json:"has_community_visible_stats"`
}

type GameSchemaResponse

type GameSchemaResponse struct {
	Game *GameInfo `json:"game"`
}

type OwnedGamesResponse

type OwnedGamesResponse struct {
	Response struct {
		GameCount int            `json:"game_count"`
		Games     []GameResponse `json:"games"`
	} `json:"response"`
}

type PlayerAchievement

type PlayerAchievement struct {
	APIName    string `json:"apiname"`
	Achieved   int    `json:"achieved"`
	UnlockTime *int64 `json:"unlocktime"`
}

type PlayerAchievementsResponse

type PlayerAchievementsResponse struct {
	PlayerStats struct {
		SteamID      string              `json:"steamID"`
		GameName     string              `json:"gameName"`
		Achievements []PlayerAchievement `json:"achievements"`
		Success      bool                `json:"success"`
	} `json:"playerstats"`
}

type StatSchema

type StatSchema struct {
	Name         string `json:"name"`
	DefaultValue int    `json:"defaultvalue"`
	DisplayName  string `json:"displayName"`
}

Jump to

Keyboard shortcuts

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