steam

package
v0.0.0-...-3b30780 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIBase is the URL prefix for the Steamworks Web API
	APIBase = "https://api.steampowered.com/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Badge

type Badge struct {
	Badgeid        int32 `json:"badgeid"`
	Level          int   `json:"level"`
	CompletionTime int   `json:"completion_time"`
	Xp             int   `json:"xp"`
	Scarcity       int   `json:"scarcity"`
}

Badge defines the badge in GetBadgesResult.

type BadgeQuests

type BadgeQuests struct {
	Questid   int  `json:"questid"`
	Completed bool `json:"completed"`
}

BadgeQuests defines the quests of GetCommunityBadgeProgressResult.

type Client

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

Client defines the Steam Client.

func NewClient

func NewClient(apikey string, httpClient *http.Client) *Client

NewClient returns a new Client with the given API key.

type Game

type Game struct {
	Appid                    int    `json:"appid"`
	Name                     string `json:"name"`
	PlaytimeForever          int    `json:"playtime_forever"`
	PlayTime2Weeks           int    `json:"playtime_2weeks"`
	ImgIconURL               string `json:"img_icon_url"`
	ImgLogoURL               string `json:"img_logo_url"`
	HasCommunityVisibleStats bool   `json:"has_community_visible_stats"`
	PlaytimeWindowsForever   int    `json:"playtime_windows_forever"`
	PlaytimeMacForever       int    `json:"playtime_mac_forever"`
	PlaytimeLinuxForever     int    `json:"playtime_linux_forever"`
}

Game defines the game in GetOwnedGamesResult.

type GetBadgesParams

type GetBadgesParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
}

GetBadgesParams defines the parameters to GetRecentlyPlayedGames.

type GetBadgesResult

type GetBadgesResult struct {
	Badges                     []*Badge `json:"badges"`
	PlayerXp                   int      `json:"player_xp"`
	PlayerLevel                int      `json:"player_level"`
	PlayerXpNeededToLevelUp    int      `json:"player_xp_needed_to_level_up"`
	PlayerXpNeededCurrentLevel int      `json:"player_xp_needed_current_level"`
}

GetBadgesResult defines the result of GetRecentlyPlayedGames.

type GetCommunityBadgeProgressParams

type GetCommunityBadgeProgressParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
	// The badge we're asking about
	BadgeID int32 `json:"badgeid"`
}

GetCommunityBadgeProgressParams defines the parameters to GetCommunityBadgeProgress.

type GetCommunityBadgeProgressResult

type GetCommunityBadgeProgressResult struct {
	Quests []BadgeQuests `json:"quests"`
}

GetCommunityBadgeProgressResult defines the result of GetCommunityBadgeProgress.

type GetOwnedGamesParams

type GetOwnedGamesParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
	// true if we want additional details (name, icon) about each game
	IncludeAppInfo bool `json:"include_appinfo"`
	// Free games are excluded by default. If this is set, free games the user has played will be returned
	IncludePlayedFreeGames bool `json:"include_played_free_games"`
	// if set, restricts result set to the passed in apps,
	// actually it should passed like appids_filter[0]=8930&appids_filter[1]=500
	AppIDsFilter []uint32 `json:"appids_filter"`
}

GetOwnedGamesParams defines the parameters to GetRecentlyPlayedGames.

type GetOwnedGamesResult

type GetOwnedGamesResult struct {
	GameCount int     `json:"game_count"`
	Games     []*Game `json:"games"`
}

GetOwnedGamesResult defines the result of GetRecentlyPlayedGames.

type GetRecentlyPlayedGamesParams

type GetRecentlyPlayedGamesParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
	// The number of games to return (0/unset: all)
	Count uint32 `json:"count"`
}

GetRecentlyPlayedGamesParams defines the parameters to GetRecentlyPlayedGames.

type GetRecentlyPlayedGamesResult

type GetRecentlyPlayedGamesResult struct {
	// The number of games
	TotalCount int `json:"total_count"`
	//
	Games []*Game `json:"games"`
}

GetRecentlyPlayedGamesResult defines the result of GetRecentlyPlayedGames.

type GetSteamLevelParams

type GetSteamLevelParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
}

GetSteamLevelParams defines the parameters to GetRecentlyPlayedGames.

type GetSteamLevelResult

type GetSteamLevelResult struct {
	PlayerLevel uint64 `json:"player_level"`
}

GetSteamLevelResult defines the result of GetRecentlyPlayedGames.

type IPlayerService

type IPlayerService service

IPlayerService provides additional methods for interacting with Steam Users. See https://partner.steamgames.com/doc/webapi/IPlayerService for more information.

func (*IPlayerService) GetBadges

func (s *IPlayerService) GetBadges(ctx context.Context, params *GetBadgesParams) (*GetBadgesResult, error)

GetBadges gets badges that are owned by a specific user.

func (*IPlayerService) GetCommunityBadgeProgress

GetCommunityBadgeProgress gets all the quests needed to get the specified badge, and which are completed.

func (*IPlayerService) GetOwnedGames

func (s *IPlayerService) GetOwnedGames(ctx context.Context, params *GetOwnedGamesParams) (*GetOwnedGamesResult, error)

GetOwnedGames return a list of games owned by the player.

func (*IPlayerService) GetRecentlyPlayedGames

GetRecentlyPlayedGames gets information about a player's recently played games.

func (*IPlayerService) GetSteamLevel

func (s *IPlayerService) GetSteamLevel(ctx context.Context, params *GetSteamLevelParams) (*GetSteamLevelResult, error)

GetSteamLevel returns the Steam Level of a user.

func (*IPlayerService) IsPlayingSharedGame

func (s *IPlayerService) IsPlayingSharedGame(ctx context.Context, params *IsPlayingSharedGameParams) (
	*IsPlayingSharedGameResult, error)

IsPlayingSharedGame returns valid lender SteamID if game currently played is borrowed.

type IsPlayingSharedGameParams

type IsPlayingSharedGameParams struct {
	// The player we're asking about
	SteamID uint64 `json:"steamid"`
	// The game player is currently playing
	AppIDPlaying uint32 `json:"appid_playing"`
}

IsPlayingSharedGameParams defines the parameters to GetRecentlyPlayedGames.

type IsPlayingSharedGameResult

type IsPlayingSharedGameResult struct {
	LenderSteamID string `json:"lender_steamid"`
}

IsPlayingSharedGameResult defines the result of IsPlayingSharedGame.

type Query

type Query url.Values

Query defines from the url.Values.

func (*Query) Parse

func (q *Query) Parse(data interface{}) error

Parse parses the given data to a Query. Only parses the elements with query tag.

type Result

type Result struct {
	Response interface{} `json:"response"`
}

Result defines the common result of web API returned.

Jump to

Keyboard shortcuts

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