inventory

package
v0.0.0-...-0b43fd5 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Includes inventory types as used in the trade package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name string
	Link string
}

type AppInfo

type AppInfo struct {
	AppId uint32
	Name  string
	Icon  string
	Link  string
}

type Currencies

type Currencies map[string]*Currency

func (*Currencies) UnmarshalJSON

func (c *Currencies) UnmarshalJSON(data []byte) error

type Currency

type Currency struct {
	Id         economy.AssetId `json:",string"`
	ClassId    economy.ClassId `json:",string"`
	IsCurrency bool            `json:"is_currency"`
	Pos        uint32
}

type Description

type Description struct {
	AppId      uint32             `json:",string"`
	ClassId    economy.ClassId    `json:",string"`
	InstanceId economy.InstanceId `json:",string"`

	IconUrl     string `json:"icon_url"`
	IconDragUrl string `json:"icon_drag_url"`

	Name       string
	MarketName string `json:"market_name"`

	// Colors in hex, for example `B2B2B2`
	NameColor       string `json:"name_color"`
	BackgroundColor string `json:"background_color"`

	Type string

	Tradable   jsont.UintBool
	Marketable jsont.UintBool
	Commodity  jsont.UintBool

	Descriptions DescriptionLines
	Actions      []*Action
	// Application-specific data, like "def_index" and "quality" for TF2
	AppData map[string]string
}

type DescriptionLine

type DescriptionLine struct {
	Value string
	Type  *string // Is `html` for HTML descriptions
	Label *string
}

type DescriptionLines

type DescriptionLines []*DescriptionLine

func (*DescriptionLines) UnmarshalJSON

func (d *DescriptionLines) UnmarshalJSON(data []byte) error

type Descriptions

type Descriptions map[string]*Description

func (*Descriptions) UnmarshalJSON

func (d *Descriptions) UnmarshalJSON(data []byte) error

type Inventory

type Inventory struct {
	Items        Items        `json:"rgInventory"`
	Currencies   Currencies   `json:"rgCurrency"`
	Descriptions Descriptions `json:"rgDescriptions"`
	AppInfo      *AppInfo     `json:"rgAppInfo"`
}

func GetFullInventory

func GetFullInventory(getFirst func() (*PartialInventory, error), getNext func(start uint) (*PartialInventory, error)) (*Inventory, error)

func GetOwnInventory

func GetOwnInventory(client *http.Client, contextId uint64, appId uint32) (*Inventory, error)

func Merge

func Merge(p ...*Inventory) *Inventory

Merges the given Inventory into a single Inventory. The given slice must have at least one element. The first element of the slice is used and modified.

type Item

type Item struct {
	Id         economy.AssetId    `json:",string"`
	ClassId    economy.ClassId    `json:",string"`
	InstanceId economy.InstanceId `json:",string"`
	Amount     uint64             `json:",string"`
	Pos        uint32
}

type Items

type Items map[string]*Item

func (*Items) UnmarshalJSON

func (i *Items) UnmarshalJSON(data []byte) error

type MoreStart

type MoreStart uint

func (*MoreStart) UnmarshalJSON

func (m *MoreStart) UnmarshalJSON(data []byte) error

type PartialInventory

type PartialInventory struct {
	Success bool
	Error   string
	Inventory
	More      bool
	MoreStart MoreStart `json:"more_start"`
}

A partial inventory as sent by the Steam API.

func DoInventoryRequest

func DoInventoryRequest(client *http.Client, req *http.Request) (*PartialInventory, error)

func GetPartialOwnInventory

func GetPartialOwnInventory(client *http.Client, contextId uint64, appId uint32, start *uint) (*PartialInventory, error)

Jump to

Keyboard shortcuts

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