Documentation
¶
Index ¶
Constants ¶
View Source
const BaseSteamAPIURLProduction = "https://api.steampowered.com"
BaseSteamAPIURLProduction is the steam url used to do requests in prod
View Source
const ISteamWebAPIUtilIface = "ISteamWebAPIUtil"
Variables ¶
View Source
var BaseSteamAPIURL = BaseSteamAPIURLProduction
BaseSteamAPIURL is the url used to do requests, defaulted to prod
View Source
var GetServerInfoMethod = NewMethod[*GetServerInfoResponse](ISteamWebAPIUtilIface, "GetServerInfo", 1)
View Source
var GlobalRate = ratecounter.NewRateCounter(time.Minute)
GlobalRate counts global API usage.
Functions ¶
func NewDefaultClient ¶
Types ¶
type CallConfig ¶ added in v0.3.0
type CallConfig struct {
// contains filtered or unexported fields
}
CallConfig represents optional arguments to Method.Call.
func NewCallConfig ¶ added in v0.3.0
func NewCallConfig() *CallConfig
func (*CallConfig) SetArgs ¶ added in v0.3.0
func (c *CallConfig) SetArgs(args url.Values) *CallConfig
func (*CallConfig) SetHeaders ¶ added in v0.3.0
func (c *CallConfig) SetHeaders(headers url.Values) *CallConfig
type GetServerInfoResponse ¶ added in v0.3.0
type Method ¶
type Method[T any] struct { // contains filtered or unexported fields }
A Method represents a Steam Web API method.
func (*Method[T]) Call ¶
func (m *Method[T]) Call(ctx context.Context, opts ...*CallConfig) (out T, err error)
Call makes a request to the Steam Web API with the given arguments and stores the result in the given out parameter.
May return an HTTPError error if the return status code was not 200. May return other errors from calling into resty.Request.Get.
func (*Method[T]) Rate ¶
func (m *Method[T]) Rate() *ratecounter.AvgRateCounter
Rate returns the average rate counter.
type RequestProvider ¶
var Client RequestProvider = NewDefaultClient()
Client is the http client that will be used for all API calls.
Click to show internal directories.
Click to hide internal directories.