legacy

package
v0.0.0-...-2fa03ef Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MarketIDToName = map[int64]string{
	-1:       "universe",
	30000142: "jita",
	30002187: "amarr",
	30002659: "dodixie",
	30002510: "rens",
	30002053: "hek",
}

MarketIDToName maps the legacy market IDs with the new way of identifying each market

Functions

func ApplyPriceAndTypeInfo

func ApplyPriceAndTypeInfo(appraisal *evepraisal.Appraisal, item *evepraisal.AppraisalItem, priceMap map[int64]Prices, typeDB typedb.TypeDB)

ApplyPriceAndTypeInfo will add type and price information to the given item. This works by side-effects

func RestoreLegacyFile

func RestoreLegacyFile(saver func(*evepraisal.Appraisal) error, typeDB typedb.TypeDB, filename string) error

RestoreLegacyFile will load a given restore file into the database

Types

type Chat

type Chat struct {
	Items []Type `json:"items"`
}

Chat is used to get the items from a chat appraisal result

func (Chat) ToNewItems

func (t Chat) ToNewItems() []evepraisal.AppraisalItem

ToNewItems converts Chat to []evepraisal.AppraisalItem

type Killmail

type Killmail struct {
	Victim struct {
		Destroyed string `json:"destroyed"`
	} `json:"victim"`
	Dropped []struct {
		Name     string `json:"name"`
		Quantity int64  `json:"quantity"`
	} `json:"dropped"`
	Destroyed []struct {
		Name     string `json:"name"`
		Quantity int64  `json:"quantity"`
	} `json:"destroyed"`
}

Killmail is used to parse Legacy killmail results

func (Killmail) ToNewItems

func (t Killmail) ToNewItems() []evepraisal.AppraisalItem

ToNewItems converts Killmail to []evepraisal.AppraisalItem

type PriceBase

type PriceBase [][]json.RawMessage

PriceBase is used because there's some positional JSON nonsense going on here

type Prices

type Prices struct {
	Sell struct {
		Min        float64 `json:"min"`
		Max        float64 `json:"max"`
		Price      float64 `json:"price"`
		Median     float64 `json:"median"`
		Volume     float64 `json:"volume"`
		Percentile float64 `json:"percentile"`
		Stddev     float64 `json:"stddev"`
		Avg        float64 `json:"avg"`
	} `json:"sell"`
	Buy struct {
		Min        float64 `json:"min"`
		Max        float64 `json:"max"`
		Price      float64 `json:"price"`
		Median     float64 `json:"median"`
		Volume     float64 `json:"volume"`
		Percentile float64 `json:"percentile"`
		Stddev     float64 `json:"stddev"`
		Avg        float64 `json:"avg"`
	} `json:"buy"`
	All struct {
		Min        float64 `json:"min"`
		Max        float64 `json:"max"`
		Price      float64 `json:"price"`
		Median     float64 `json:"median"`
		Volume     float64 `json:"volume"`
		Percentile float64 `json:"percentile"`
		Stddev     float64 `json:"stddev"`
		Avg        float64 `json:"avg"`
	} `json:"all"`
}

Prices defines all of the prices for an item

func (Prices) ToNewPrices

func (p Prices) ToNewPrices() evepraisal.Prices

ToNewPrices converts legacy Prices to the new evepraisal.Prices

type Type

type Type struct {
	Name      string  `json:"name"`
	Quantity  float64 `json:"quantity"`
	Details   string  `json:"details"`
	Fitted    bool    `json:"fitted"`
	Destroyed bool    `json:"destroyed"`
	Dropped   bool    `json:"dropped"`
	Location  string  `json:"location"`
	Ship      string  `json:"ship"`
	Modules   []struct {
		Name     string `json:"name"`
		Quantity int64  `json:"quantity"`
		Ammo     string `json:"ammo"`
	}
	Ammo string `json:"ammo"`
}

Type is the old style of Types

func (Type) ToNewItems

func (t Type) ToNewItems() []evepraisal.AppraisalItem

ToNewItems converts the old Type to new []evepraisal.AppraisalItem

type TypeBase

type TypeBase [][]json.RawMessage

TypeBase exists because there is positional JSON nonsense

Jump to

Keyboard shortcuts

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