api

package
v0.0.0-...-5d32165 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AndroidUnknownOsType    int = -500
	DefaultGamingDeviceType     = 528
)
View Source
const BaseURL = "https://api.steampowered.com"
View Source
const CacheNil = CacheAdaptorError("got nil from cache")
View Source
const FormContentType = "application/x-www-form-urlencoded"
View Source
const JsonContentType = "application/json"

Variables

This section is empty.

Functions

func ContextWithCachingTtl

func ContextWithCachingTtl(ctx context.Context, ttl time.Duration) context.Context

func MarshalSteamEncodedValues

func MarshalSteamEncodedValues(m proto.Message) (url.Values, error)

Types

type CacheAdaptor

type CacheAdaptor interface {
	Get(ctx context.Context, key string) (string, error)
	Set(ctx context.Context, key string, value string, ttl time.Duration) error
}

type CacheAdaptorError

type CacheAdaptorError string

func (CacheAdaptorError) Error

func (c CacheAdaptorError) Error() string

type DeviceDetails

type DeviceDetails struct {
	FriendlyName     string       `json:"device_friendly_name"`
	PlatformType     PlatformType `json:"platform_type"`
	OsType           int          `json:"os_type"`
	GamingDeviceType int          `json:"gaming_device_type"`
}

type GuardType

type GuardType int
const (
	UnknownGuardType GuardType = iota
	NoneGuardType
	EmailCodeGuardType
	DeviceCodeGuardType
	DeviceConfirmationGuardType
	EmailConfirmationGuardType
	MachineTokenGuardType
	LegacyMachineAuthGuardType
)

type HttpTransport

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

func NewTransport

func NewTransport(options HttpTransportOptions) *HttpTransport

func (HttpTransport) CookieJar

func (c HttpTransport) CookieJar() http.CookieJar

func (HttpTransport) HttpClient

func (c HttpTransport) HttpClient() *http.Client

func (HttpTransport) Send

func (c HttpTransport) Send(ctx context.Context, request Request, response any) error

Send sends a specialized HTTP Request to steam.

type HttpTransportOptions

type HttpTransportOptions struct {
	WebApiKey     string
	ResponseCache CacheAdaptor
	DumpRequests  bool
	DumpResponses bool
}

type Persistence

type Persistence int
const (
	InvalidSessionPersistence    Persistence = -1
	EphemeralSessionPersistence  Persistence = 0
	PersistentSessionPersistence Persistence = 1
)

type PlatformType

type PlatformType int
const (
	UnknownPlatformType PlatformType = iota
	SteamClientPlatformType
	WebBrowserPlatformType
	MobileAppPlatformType
)

type Request

type Request interface {
	Retryable() bool
	CacheTTL() time.Duration
	RequiresApiKey() bool
	Method() string
	Url() string
	OldValues() (url.Values, error)
	Values() (url.Values, error)
	Headers() (http.Header, error)
	EnsureResponseSuccess(httpResponse *http.Response) error
}

type TokenRenewalType

type TokenRenewalType int
const (
	NoneRenewalType TokenRenewalType = iota
	AllowRenewalType
)

type Transport

type Transport interface {
	CookieJar() http.CookieJar
	Send(ctx context.Context, request Request, response any) error
	HttpClient() *http.Client
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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