Documentation ¶
Index ¶
- Constants
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func CleanResponse(response *Response) error
- func FetchAndSetStore() error
- func MatchTypeline(typeline string) (flavor, root string, ok bool)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type ChangeSet
- func (changes *ChangeSet) AddResponse(changeID string, comp CompressedResponse)
- func (z *ChangeSet) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *ChangeSet) EncodeMsg(en *msgp.Writer) (err error)
- func (changes *ChangeSet) GetCompByChangeID(changeID string) (*CompressedResponse, bool)
- func (changes *ChangeSet) GetFirstChange() (*CompressedResponse, error)
- func (z *ChangeSet) MarshalMsg(b []byte) (o []byte, err error)
- func (z *ChangeSet) Msgsize() (s int)
- func (changes *ChangeSet) Save(path string) error
- func (z *ChangeSet) UnmarshalMsg(bts []byte) (o []byte, err error)
- type CompressedResponse
- func (z *CompressedResponse) DecodeMsg(dc *msgp.Reader) (err error)
- func (comp CompressedResponse) Decompress() (*Response, error)
- func (z *CompressedResponse) EncodeMsg(en *msgp.Writer) (err error)
- func (z *CompressedResponse) MarshalMsg(b []byte) (o []byte, err error)
- func (z *CompressedResponse) Msgsize() (s int)
- func (z *CompressedResponse) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Item
- func (z *Item) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Item) EncodeMsg(en *msgp.Writer) (err error)
- func (item *Item) GetMods() []ItemMod
- func (v Item) MarshalEasyJSON(w *jwriter.Writer)
- func (v Item) MarshalJSON() ([]byte, error)
- func (z *Item) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Item) Msgsize() (s int)
- func (v *Item) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Item) UnmarshalJSON(data []byte) error
- func (z *Item) UnmarshalMsg(bts []byte) (o []byte, err error)
- type ItemMod
- func (z *ItemMod) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *ItemMod) EncodeMsg(en *msgp.Writer) (err error)
- func (m *ItemMod) MarshalJSON() ([]byte, error)
- func (z *ItemMod) MarshalMsg(b []byte) (o []byte, err error)
- func (z *ItemMod) Msgsize() (s int)
- func (m *ItemMod) UnmarshalJSON(b []byte) error
- func (z *ItemMod) UnmarshalMsg(bts []byte) (o []byte, err error)
- type PropertyValue
- func (z *PropertyValue) DecodeMsg(dc *msgp.Reader) (err error)
- func (z PropertyValue) EncodeMsg(en *msgp.Writer) (err error)
- func (v *PropertyValue) MarshalJSON() ([]byte, error)
- func (z PropertyValue) MarshalMsg(b []byte) (o []byte, err error)
- func (z PropertyValue) Msgsize() (s int)
- func (v *PropertyValue) UnmarshalJSON(b []byte) error
- func (z *PropertyValue) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Response
- func (z *Response) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Response) EncodeMsg(en *msgp.Writer) (err error)
- func (v Response) MarshalEasyJSON(w *jwriter.Writer)
- func (v Response) MarshalJSON() ([]byte, error)
- func (z *Response) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Response) Msgsize() (s int)
- func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Response) UnmarshalJSON(data []byte) error
- func (z *Response) UnmarshalMsg(bts []byte) (o []byte, err error)
- type Stash
- func (z *Stash) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Stash) EncodeMsg(en *msgp.Writer) (err error)
- func (v Stash) MarshalEasyJSON(w *jwriter.Writer)
- func (v Stash) MarshalJSON() ([]byte, error)
- func (z *Stash) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Stash) Msgsize() (s int)
- func (v *Stash) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Stash) UnmarshalJSON(data []byte) error
- func (z *Stash) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
const StashAPIBase string = "http://www.pathofexile.com/api/public-stash-tabs"
StashAPIBase is the URL the stash api is located at
const TestResponseLoc string = "StashResponse.json"
TestResponseLoc is where testing data is kept
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func CleanResponse ¶
CleanResponse adds on Type data as well as ensures the response will satisfy our expectations, as wildly unreasonable as they can be
func FetchAndSetStore ¶
func FetchAndSetStore() error
FetchAndSetStore grabs the latest stash tab api update and stores it in TestResponseLoc
func MatchTypeline ¶
MatchTypeline returns a flavor and root for a discovered base or ok is false.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type ChangeSet ¶
type ChangeSet struct { // Changes mapping from ID to position in Changes ChangeIDToIndex map[string]int // Changes as individually compressed Changes []CompressedResponse // Size as stored Size int }
ChangeSet represents the number
func NewChangeSet ¶
func NewChangeSet() ChangeSet
NewChangeSet returns an empty, initialized ChangeSet
func OpenChangeSet ¶
OpenChangeSet attempts to open a ChangeSet at the provided path
func (*ChangeSet) AddResponse ¶
func (changes *ChangeSet) AddResponse(changeID string, comp CompressedResponse)
AddResponse includes another CompressedResponse inside the Changes
func (*ChangeSet) GetCompByChangeID ¶
func (changes *ChangeSet) GetCompByChangeID(changeID string) (*CompressedResponse, bool)
GetCompByChangeID returns the CompressedResponse associated with a given changeID. Follows the _, ok pattern ala maps if not found
func (*ChangeSet) GetFirstChange ¶
func (changes *ChangeSet) GetFirstChange() (*CompressedResponse, error)
GetFirstChange returns the first Change in the set.
func (*ChangeSet) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*ChangeSet) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
type CompressedResponse ¶
CompressedResponse represents a Response compressed using this package
func NewCompressedResponse ¶
func NewCompressedResponse(resp *Response) (*CompressedResponse, error)
NewCompressedResponse compresses a Response into compact form and returns the result
func (*CompressedResponse) DecodeMsg ¶
func (z *CompressedResponse) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (CompressedResponse) Decompress ¶
func (comp CompressedResponse) Decompress() (*Response, error)
Decompress decompresses the CompressedResponse.
func (*CompressedResponse) EncodeMsg ¶
func (z *CompressedResponse) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*CompressedResponse) MarshalMsg ¶
func (z *CompressedResponse) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (*CompressedResponse) Msgsize ¶
func (z *CompressedResponse) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*CompressedResponse) UnmarshalMsg ¶
func (z *CompressedResponse) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Item ¶
type Item struct { Verified bool `json:"verified"` League string `json:"league"` ID string `json:"id"` Name string `json:"name"` TypeLine string `json:"typeLine"` Identified bool `json:"identified"` Corrupted bool `json:"corrupted"` ImplicitMods []ItemMod `json:"implicitMods,omitempty"` ExplicitMods []ItemMod `json:"explicitMods,omitempty"` Note string `json:"note,omitempty"` UtilityMods []string `json:"utilityMods,omitempty"` DescrText string `json:"descrText,omitempty"` // Additional data not present in response StashID string `json:"-"` RootType string `json:"-"` RootFlavor string `json:"-"` }
Item represents a single item found from the stash api
func (Item) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Item) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Item) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Item) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Item) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Item) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ItemMod ¶
ItemMod is a modifier an item can have
func (*ItemMod) MarshalJSON ¶
MarshalJSON implements custom serialization for this type
func (*ItemMod) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*ItemMod) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ItemMod) UnmarshalJSON ¶
UnmarshalJSON implements custom deserialization for this type
Typically, the GGG api will return string which we run through regexp for ease
type PropertyValue ¶
PropertyValue holds a string value alongside an associated PrintKey
func (*PropertyValue) DecodeMsg ¶
func (z *PropertyValue) DecodeMsg(dc *msgp.Reader) (err error)
DecodeMsg implements msgp.Decodable
func (PropertyValue) EncodeMsg ¶
func (z PropertyValue) EncodeMsg(en *msgp.Writer) (err error)
EncodeMsg implements msgp.Encodable
func (*PropertyValue) MarshalJSON ¶
func (v *PropertyValue) MarshalJSON() ([]byte, error)
MarshalJSON implements custom serialization for this type
func (PropertyValue) MarshalMsg ¶
func (z PropertyValue) MarshalMsg(b []byte) (o []byte, err error)
MarshalMsg implements msgp.Marshaler
func (PropertyValue) Msgsize ¶
func (z PropertyValue) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*PropertyValue) UnmarshalJSON ¶
func (v *PropertyValue) UnmarshalJSON(b []byte) error
UnmarshalJSON implements custom deserialization for this type
Typically, the GGG api will return [string, int] which is very unhelpful, so we take care of that right here
func (*PropertyValue) UnmarshalMsg ¶
func (z *PropertyValue) UnmarshalMsg(bts []byte) (o []byte, err error)
UnmarshalMsg implements msgp.Unmarshaler
type Response ¶
type Response struct { NextChangeID string `json:"next_change_id"` Stashes []Stash `json:"stashes"` }
Response represents expected structure of a stash api call
func FetchUpdate ¶
FetchUpdate grabs the update indicated by the changeID.
If empty changeID is provided, it grabs the default update.
func RespFromJSON ¶
RespFromJSON attempts to deserialize the provided data and return it as a StashResponse
func (Response) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Response) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Response) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Response) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Response) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Response) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Stash ¶
type Stash struct { AccountName string `json:"accountName"` LastCharacterName string `json:"lastCharacterName"` ID string `json:"id"` Stash string `json:"stash"` StashType string `json:"stashType"` Items []Item `json:"items"` Public bool `json:"public"` }
Stash represents a stash tab with items and associated metadata
func (Stash) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Stash) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Stash) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Stash) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Stash) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Stash) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface