psapi

package
v0.0.0-...-fc896f4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DELETE_JEWEL_QUERY = `
DELETE 
  FROM jewels 
  WHERE id = $1
  `
View Source
const MAX_BACKOFFS = 6
View Source
const MAX_RETRIES = 10
View Source
const POENINJA_POLL_RATE = 60 // Every 60 iterations (~30s)
View Source
const SELECT_JEWELS_QUERY = `
SELECT * 
  FROM jewels 
  WHERE stashId = any($1)
  `
View Source
const UPDATE_JEWEL_PRICE_QUERY = `` /* 136-byte string literal not displayed */
View Source
const UPSERT_JEWEL_QUERY = `` /* 318-byte string literal not displayed */

Variables

This section is empty.

Functions

func CalculateRiverDrift

func CalculateRiverDrift(head string, current string) (int, error)

func ConsumeRiver

func ConsumeRiver(f *CliFlags)

func GetLatestChangeIdGGG

func GetLatestChangeIdGGG(client *http.Client) (string, error)

Fetches the official latest change id from pathofexile.com. This doesn't work (in my experience) from a cloud-based IP, so the "unofficial" latest change id from poe.ninja is preferred

func IntPow

func IntPow(n, m int) int

func UpdateDb

func UpdateDb(ctx context.Context, dbHandle *pgxpool.Pool, stashes []StashSnapshot) error

Types

type CliFlags

type CliFlags struct {
	StartFromHead bool
}

type JewelEntry

type JewelEntry struct {
	Id    string
	Type  string
	Class string
	Node  string
	Price Price
}

func (JewelEntry) String

func (j JewelEntry) String() string

type Price

type Price struct {
	Count    float64
	Currency string
}

func FindPrice

func FindPrice(item *RawItem, s *RawStashTab) (Price, error)

func ParsePrice

func ParsePrice(str string) (Price, error)

type RawItem

type RawItem struct {
	Id           string            `json:"id"`
	Name         string            `json:"name"`
	X            int               `json:"x"`
	Y            int               `json:"y"`
	Note         string            `json:"note"`
	Requirements []RawItemProperty `json:"requirements"`
	ExplicitMods []string          `json:"explicitMods"`
}

type RawItemPropValue

type RawItemPropValue struct {
	Value   string
	Numeric int // unsure what this field is used for, but we don't use it other than to unmarshal the data
}

func (*RawItemPropValue) UnmarshalJSON

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

type RawItemProperty

type RawItemProperty struct {
	Name   string `json:"name"`
	Values []RawItemPropValue
}

type RawStashTab

type RawStashTab struct {
	Id          string    `json:"id"`
	AccountName string    `json:"accountName"`
	League      string    `json:"league,omitempty"`
	Items       []RawItem `json:"items"`
	Name        string    `json:"stash"`
}

type StashSnapshot

type StashSnapshot struct {
	Id         string
	League     string
	Items      []JewelEntry
	ChangeId   string
	RecordedAt time.Time
}

func FindFFJewels

func FindFFJewels(r io.ReadCloser, l *log.Logger, changeId string) ([]StashSnapshot, error)

Jump to

Keyboard shortcuts

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