Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Get(host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
- func (c *Client) IPlayerService() *IPlayerService
- func (c *Client) IPublishedFileService() *ISteamPublishedFileService
- func (c *Client) ISteamApps() *ISteamApps
- func (c *Client) ISteamNews() *ISteamNews
- func (c *Client) ISteamUser() *ISteamUser
- func (c *Client) ISteamWebAPIUtil() *ISteamWebAPIUtil
- func (c *Client) NewRequest(method, host, url string, options ...RequestOption) *Request
- func (c *Client) Post(host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
- func (c *Client) SendRequest(method, host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
- func (c *Client) Unknown(method, host, url string, opts ...RequestOption) (steam.CommonResponse, error)
- type ClientCfg
- type ClientOption
- type IPlayerService
- func (i *IPlayerService) GetBadges(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *IPlayerService) GetCommunityBadgeProgress(steamId uint, badgeId int, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *IPlayerService) GetOwnedGames(ownGameOpt player.OwnedGamesQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *IPlayerService) GetRecentlyPlayedGames(steamId uint, count uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *IPlayerService) GetSingleGamePlayTime(steamId uint, appId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *IPlayerService) GetSteamLevel(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
- type ISteamApps
- func (i *ISteamApps) GetAppBeta(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) GetAppBuilds(buildsQueryOpt app.BuildsQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) GetAppDepotVersion(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) GetAppList(ops ...RequestOption) (app.PublicAppList, error)
- func (i *ISteamApps) GetPartnerAppListForWebAPIKey(filter app.PartnerAppQueryFilter, ops ...RequestOption) (app.PartnerAppList, error)
- func (i *ISteamApps) GetPlayersBanned(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) GetServerList(filter app.ServerListQueryFilter, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) GetServersAtAddress(addr string, ops ...RequestOption) (app.ServerAddressList, error)
- func (i *ISteamApps) SetAppBuildLive(updateOption app.BuildLiveUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamApps) UpToDateCheck(opt app.UpToDateCheckQueryOption, ops ...RequestOption) (app.UpToDateCheck, error)
- type ISteamNews
- type ISteamPublishedFileService
- func (i *ISteamPublishedFileService) QueryFiles(queryFileOption publishedfile.FileQueryOption, ops ...RequestOption) (publishedfile.FileList, error)
- func (i *ISteamPublishedFileService) SetDeveloperMetaData(devSetOpt publishedfile.DeveloperMetaSetOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamPublishedFileService) UpdateBanStatus(banStatusUpdateOpt publishedfile.BanStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamPublishedFileService) UpdateIncompatibleStatus(updateOpt publishedfile.IncompatibleStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamPublishedFileService) UpdateTags(tagUpdateOpt publishedfile.TagUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamPublishedFileService) UpdateUGCBan(banUpdateOpt publishedfile.BanStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
- type ISteamUser
- func (i *ISteamUser) CheckAppOwnership(ids steam.SteamAppId, ops ...RequestOption) (user.AppOwnershipList, error)
- func (i *ISteamUser) GetAppPriceInfo(steamId uint, appIds string, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamUser) GetDeletedSteamIds(rowVersion uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamUser) GetFriendList(relation user.FriendListQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamUser) GetPlayerBans(steamids string, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamUser) GetPlayerSummaries(steamids string, ops ...RequestOption) (user.PlayerSummaryList, error)
- func (i *ISteamUser) GetPublisherAppOwnership(steamId uint, ops ...RequestOption) (user.PublisherAppOwnershipList, error)
- func (i *ISteamUser) GetPublisherAppOwnershipChanges(chaneQueryOption user.PublisherAppOwnershipChangeQueryOption, ...) (user.AppOwnershipChanges, error)
- func (i *ISteamUser) GetUserGroupList(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
- func (i *ISteamUser) ResolveVanityURL(urlResolve user.ResolveVanityUrlQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
- type ISteamWebAPIUtil
- type Request
- type RequestOption
- func WithAPIKey(key string) RequestOption
- func WithBody(body any) RequestOption
- func WithHeader(header http.Header) RequestOption
- func WithHost(host string) RequestOption
- func WithLanguage(language string) RequestOption
- func WithMethod(method string) RequestOption
- func WithQueryForm(query any) RequestOption
- func WithQueryMap(query map[string]any) RequestOption
- func WithRequest(fn func(r *resty.Request)) RequestOption
- func WithURL(url string) RequestOption
Constants ¶
const ( NopKey = "nop-key" EmptyKey = "" QuerySteamApiKey = "key" QueryLanguage = "language" )
const ( // PublicHost is the public steam server, you can interact with you own normal key PublicHost = "api.steampowered.com" // PartnerHost is the partner steam server, you should take your publisher api key in query parameters in any case PartnerHost = "partner.steam-api.com" )
Variables ¶
var (
ApiKeyNotExistErr = errors.New("steam api key must be provided")
)
var (
PartnerEnforceHttpsErr = errors.New("partner.steam-api.com must be requested with https")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client steam api client, interact with steam api server
func New ¶
New func create a new Client only with api key which must be provided, if you just want to access some interface which does not need api key you can pass the NopKey
func NewWith ¶
func NewWith(options ...ClientOption) (*Client, error)
func (*Client) Get ¶
func (c *Client) Get(host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
func (*Client) IPlayerService ¶ added in v1.2.0
func (c *Client) IPlayerService() *IPlayerService
func (*Client) IPublishedFileService ¶ added in v1.2.0
func (c *Client) IPublishedFileService() *ISteamPublishedFileService
func (*Client) ISteamApps ¶ added in v1.2.0
func (c *Client) ISteamApps() *ISteamApps
func (*Client) ISteamNews ¶ added in v1.2.0
func (c *Client) ISteamNews() *ISteamNews
func (*Client) ISteamUser ¶ added in v1.2.0
func (c *Client) ISteamUser() *ISteamUser
ISteamUser see https://partner.steamgames.com/doc/webapi/ISteamUser
func (*Client) ISteamWebAPIUtil ¶ added in v1.2.0
func (c *Client) ISteamWebAPIUtil() *ISteamWebAPIUtil
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, host, url string, options ...RequestOption) *Request
NewRequest creates a new request, you can use options to customize request configuration
func (*Client) Post ¶
func (c *Client) Post(host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
func (*Client) SendRequest ¶ added in v1.2.0
func (c *Client) SendRequest(method, host, url string, resultPtr any, opts ...RequestOption) (*resty.Response, error)
SendRequest this is a helper func to send a request, resultPtr must be a pointer.
func (*Client) Unknown ¶ added in v1.2.0
func (c *Client) Unknown(method, host, url string, opts ...RequestOption) (steam.CommonResponse, error)
Unknown some interfaces response are unknown, so return steam.CommonResponse that is alias of map[string]any
type ClientCfg ¶ added in v1.2.0
type ClientCfg struct {
// contains filtered or unexported fields
}
type ClientOption ¶ added in v1.2.0
type ClientOption func(client *Client)
func WithClientKey ¶ added in v1.2.0
func WithClientKey(key string) ClientOption
func WithClientResty ¶ added in v1.2.0
func WithClientResty(client *resty.Client) ClientOption
func WithHttpsClient ¶ added in v1.2.0
func WithHttpsClient() ClientOption
type IPlayerService ¶ added in v1.2.0
type IPlayerService struct {
// contains filtered or unexported fields
}
IPlayerService see https://partner.steamgames.com/doc/webapi/IPlayerService
func (*IPlayerService) GetBadges ¶ added in v1.2.0
func (i *IPlayerService) GetBadges(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetBadges see https://partner.steamgames.com/doc/webapi/IPlayerService#GetBadges
func (*IPlayerService) GetCommunityBadgeProgress ¶ added in v1.2.0
func (i *IPlayerService) GetCommunityBadgeProgress(steamId uint, badgeId int, ops ...RequestOption) (steam.CommonResponse, error)
GetCommunityBadgeProgress see https://partner.steamgames.com/doc/webapi/IPlayerService#GetCommunityBadgeProgress
func (*IPlayerService) GetOwnedGames ¶ added in v1.2.0
func (i *IPlayerService) GetOwnedGames(ownGameOpt player.OwnedGamesQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
GetOwnedGames see https://partner.steamgames.com/doc/webapi/IPlayerService#GetOwnedGames
func (*IPlayerService) GetRecentlyPlayedGames ¶ added in v1.2.0
func (i *IPlayerService) GetRecentlyPlayedGames(steamId uint, count uint, ops ...RequestOption) (steam.CommonResponse, error)
GetRecentlyPlayedGames see https://partner.steamgames.com/doc/webapi/IPlayerService#GetRecentlyPlayedGames
func (*IPlayerService) GetSingleGamePlayTime ¶ added in v1.2.0
func (i *IPlayerService) GetSingleGamePlayTime(steamId uint, appId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetSingleGamePlayTime see https://partner.steamgames.com/doc/webapi/IPlayerService#GetSingleGamePlaytime
func (*IPlayerService) GetSteamLevel ¶ added in v1.2.0
func (i *IPlayerService) GetSteamLevel(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetSteamLevel see https://partner.steamgames.com/doc/webapi/IPlayerService#GetSteamLevel
type ISteamApps ¶ added in v1.2.0
type ISteamApps struct {
// contains filtered or unexported fields
}
ISteamApps see https://partner.steamgames.com/doc/webapi/ISteamApps
func (*ISteamApps) GetAppBeta ¶ added in v1.2.0
func (i *ISteamApps) GetAppBeta(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetAppBeta see https://partner.steamgames.com/doc/webapi/ISteamApps#GetAppBeta
func (*ISteamApps) GetAppBuilds ¶ added in v1.2.0
func (i *ISteamApps) GetAppBuilds(buildsQueryOpt app.BuildsQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
GetAppBuilds see https://partner.steamgames.com/doc/webapi/ISteamApps#GetAppBuilds
func (*ISteamApps) GetAppDepotVersion ¶ added in v1.2.0
func (i *ISteamApps) GetAppDepotVersion(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetAppDepotVersion see https://partner.steamgames.com/doc/webapi/ISteamApps#GetAppDepotVersion
func (*ISteamApps) GetAppList ¶ added in v1.2.0
func (i *ISteamApps) GetAppList(ops ...RequestOption) (app.PublicAppList, error)
GetAppList see https://partner.steamgames.com/doc/webapi/ISteamApps#GetAppList
func (*ISteamApps) GetPartnerAppListForWebAPIKey ¶ added in v1.2.0
func (i *ISteamApps) GetPartnerAppListForWebAPIKey(filter app.PartnerAppQueryFilter, ops ...RequestOption) (app.PartnerAppList, error)
GetPartnerAppListForWebAPIKey see https://partner.steamgames.com/doc/webapi/ISteamApps#GetPartnerAppListForWebAPIKey
func (*ISteamApps) GetPlayersBanned ¶ added in v1.2.0
func (i *ISteamApps) GetPlayersBanned(appId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetPlayersBanned see https://partner.steamgames.com/doc/webapi/ISteamApps#GetPlayersBanned
func (*ISteamApps) GetServerList ¶ added in v1.2.0
func (i *ISteamApps) GetServerList(filter app.ServerListQueryFilter, ops ...RequestOption) (steam.CommonResponse, error)
GetServerList see https://partner.steamgames.com/doc/webapi/ISteamApps#GetServerList
func (*ISteamApps) GetServersAtAddress ¶ added in v1.2.0
func (i *ISteamApps) GetServersAtAddress(addr string, ops ...RequestOption) (app.ServerAddressList, error)
GetServersAtAddress see https://partner.steamgames.com/doc/webapi/ISteamApps#GetServersAtAddress
func (*ISteamApps) SetAppBuildLive ¶ added in v1.2.0
func (i *ISteamApps) SetAppBuildLive(updateOption app.BuildLiveUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
SetAppBuildLive see https://partner.steamgames.com/doc/webapi/ISteamApps#SetAppBuildLive
func (*ISteamApps) UpToDateCheck ¶ added in v1.2.0
func (i *ISteamApps) UpToDateCheck(opt app.UpToDateCheckQueryOption, ops ...RequestOption) (app.UpToDateCheck, error)
UpToDateCheck see https://partner.steamgames.com/doc/webapi/ISteamApps#UpToDateCheck
type ISteamNews ¶ added in v1.2.0
type ISteamNews struct {
// contains filtered or unexported fields
}
func (*ISteamNews) GetNewsForApp ¶ added in v1.2.0
func (i *ISteamNews) GetNewsForApp(query news.AppNewsQueryOption, ops ...RequestOption) (news.AppNewsList, error)
GetNewsForApp see https://partner.steamgames.com/doc/webapi/ISteamNews#GetNewsForApp
func (*ISteamNews) GetNewsForAppAuthed ¶ added in v1.2.0
func (i *ISteamNews) GetNewsForAppAuthed(query news.AppNewsQueryOption, ops ...RequestOption) (news.AppNewsList, error)
GetNewsForAppAuthed see https://partner.steamgames.com/doc/webapi/ISteamNews#GetNewsForAppAuthed
type ISteamPublishedFileService ¶ added in v1.2.0
type ISteamPublishedFileService struct {
// contains filtered or unexported fields
}
func (*ISteamPublishedFileService) QueryFiles ¶ added in v1.2.0
func (i *ISteamPublishedFileService) QueryFiles(queryFileOption publishedfile.FileQueryOption, ops ...RequestOption) (publishedfile.FileList, error)
QueryFiles see https://partner.steamgames.com/doc/webapi/IPublishedFileService#QueryFiles
func (*ISteamPublishedFileService) SetDeveloperMetaData ¶ added in v1.2.0
func (i *ISteamPublishedFileService) SetDeveloperMetaData(devSetOpt publishedfile.DeveloperMetaSetOption, ops ...RequestOption) (steam.CommonResponse, error)
SetDeveloperMetaData see https://partner.steamgames.com/doc/webapi/IPublishedFileService#SetDeveloperMetadata
func (*ISteamPublishedFileService) UpdateBanStatus ¶ added in v1.2.0
func (i *ISteamPublishedFileService) UpdateBanStatus(banStatusUpdateOpt publishedfile.BanStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
UpdateBanStatus see https://partner.steamgames.com/doc/webapi/IPublishedFileService#UpdateBanStatus
func (*ISteamPublishedFileService) UpdateIncompatibleStatus ¶ added in v1.2.0
func (i *ISteamPublishedFileService) UpdateIncompatibleStatus(updateOpt publishedfile.IncompatibleStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
UpdateIncompatibleStatus see https://partner.steamgames.com/doc/webapi/IPublishedFileService#UpdateIncompatibleStatus
func (*ISteamPublishedFileService) UpdateTags ¶ added in v1.2.0
func (i *ISteamPublishedFileService) UpdateTags(tagUpdateOpt publishedfile.TagUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
UpdateTags see https://partner.steamgames.com/doc/webapi/IPublishedFileService#UpdateTags
func (*ISteamPublishedFileService) UpdateUGCBan ¶ added in v1.2.0
func (i *ISteamPublishedFileService) UpdateUGCBan(banUpdateOpt publishedfile.BanStatusUpdateOption, ops ...RequestOption) (steam.CommonResponse, error)
UpdateUGCBan see https://partner.steamgames.com/doc/webapi/IPublishedFileService#UpdateUGCBan
type ISteamUser ¶ added in v1.2.0
type ISteamUser struct {
// contains filtered or unexported fields
}
func (*ISteamUser) CheckAppOwnership ¶ added in v1.2.0
func (i *ISteamUser) CheckAppOwnership(ids steam.SteamAppId, ops ...RequestOption) (user.AppOwnershipList, error)
CheckAppOwnership see https://partner.steamgames.com/doc/webapi/ISteamUser#CheckAppOwnership
func (*ISteamUser) GetAppPriceInfo ¶ added in v1.2.0
func (i *ISteamUser) GetAppPriceInfo(steamId uint, appIds string, ops ...RequestOption) (steam.CommonResponse, error)
GetAppPriceInfo see https://partner.steamgames.com/doc/webapi/ISteamUser#GetAppPriceInfo
func (*ISteamUser) GetDeletedSteamIds ¶ added in v1.2.0
func (i *ISteamUser) GetDeletedSteamIds(rowVersion uint, ops ...RequestOption) (steam.CommonResponse, error)
GetDeletedSteamIds see https://partner.steamgames.com/doc/webapi/ISteamUser#GetDeletedSteamIds
func (*ISteamUser) GetFriendList ¶ added in v1.2.0
func (i *ISteamUser) GetFriendList(relation user.FriendListQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
GetFriendList see https://partner.steamgames.com/doc/webapi/ISteamUser#GetFriendList
func (*ISteamUser) GetPlayerBans ¶ added in v1.2.0
func (i *ISteamUser) GetPlayerBans(steamids string, ops ...RequestOption) (steam.CommonResponse, error)
GetPlayerBans see https://partner.steamgames.com/doc/webapi/ISteamUser#GetPlayerBans
func (*ISteamUser) GetPlayerSummaries ¶ added in v1.2.0
func (i *ISteamUser) GetPlayerSummaries(steamids string, ops ...RequestOption) (user.PlayerSummaryList, error)
GetPlayerSummaries see https://partner.steamgames.com/doc/webapi/ISteamUser#GetPlayerSummaries
func (*ISteamUser) GetPublisherAppOwnership ¶ added in v1.2.0
func (i *ISteamUser) GetPublisherAppOwnership(steamId uint, ops ...RequestOption) (user.PublisherAppOwnershipList, error)
GetPublisherAppOwnership see https://partner.steamgames.com/doc/webapi/ISteamUser#GetPublisherAppOwnership
func (*ISteamUser) GetPublisherAppOwnershipChanges ¶ added in v1.2.0
func (i *ISteamUser) GetPublisherAppOwnershipChanges(chaneQueryOption user.PublisherAppOwnershipChangeQueryOption, ops ...RequestOption) (user.AppOwnershipChanges, error)
GetPublisherAppOwnershipChanges see https://partner.steamgames.com/doc/webapi/ISteamUser#GetPublisherAppOwnershipChanges
func (*ISteamUser) GetUserGroupList ¶ added in v1.2.0
func (i *ISteamUser) GetUserGroupList(steamId uint, ops ...RequestOption) (steam.CommonResponse, error)
GetUserGroupList see https://partner.steamgames.com/doc/webapi/ISteamUser#GetUserGroupList
func (*ISteamUser) ResolveVanityURL ¶ added in v1.2.0
func (i *ISteamUser) ResolveVanityURL(urlResolve user.ResolveVanityUrlQueryOption, ops ...RequestOption) (steam.CommonResponse, error)
ResolveVanityURL see https://partner.steamgames.com/doc/webapi/ISteamUser#ResolveVanityURL
type ISteamWebAPIUtil ¶
type ISteamWebAPIUtil struct {
// contains filtered or unexported fields
}
func (*ISteamWebAPIUtil) GetServerInfo ¶
func (i *ISteamWebAPIUtil) GetServerInfo(ops ...RequestOption) (webapiutil.ServerInfo, error)
GetServerInfo see https://partner.steamgames.com/doc/webapi/ISteamWebAPIUtil#GetServerInfo
func (*ISteamWebAPIUtil) GetSupportedAPIList ¶
func (i *ISteamWebAPIUtil) GetSupportedAPIList(ops ...RequestOption) (webapiutil.SteamApiList, error)
GetSupportedAPIList see https://partner.steamgames.com/doc/webapi/ISteamWebAPIUtil#GetSupportedAPIList
type Request ¶
type Request struct { Host string Method string Url string QueryForm map[string]any Body any Header http.Header *resty.Request // contains filtered or unexported fields }
func (*Request) QueryFormEscaped ¶ added in v1.1.0
type RequestOption ¶ added in v1.2.0
type RequestOption func(request *Request)
RequestOption use options to override some request settings
func WithAPIKey ¶ added in v1.2.0
func WithAPIKey(key string) RequestOption
func WithBody ¶ added in v1.2.0
func WithBody(body any) RequestOption
func WithHeader ¶ added in v1.2.0
func WithHeader(header http.Header) RequestOption
func WithHost ¶ added in v1.2.0
func WithHost(host string) RequestOption
func WithLanguage ¶
func WithLanguage(language string) RequestOption
func WithMethod ¶ added in v1.2.0
func WithMethod(method string) RequestOption
func WithQueryForm ¶ added in v1.2.0
func WithQueryForm(query any) RequestOption
func WithQueryMap ¶ added in v1.2.0
func WithQueryMap(query map[string]any) RequestOption
func WithRequest ¶ added in v1.2.0
func WithRequest(fn func(r *resty.Request)) RequestOption
func WithURL ¶ added in v1.2.0
func WithURL(url string) RequestOption