models

package
v0.0.0-...-1a139e7 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2015 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package models provides the models being used by the application to store required information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvePraisal

type EvePraisal struct {
	Created    int64            `json:"created"`
	ID         int64            `json:"id"`
	Items      []EvePraisalItem `json:"items"`
	Kind       string           `json:"kind"`
	MarketID   int64            `json:"market_id"`
	MarketName string           `json:"market_name"`
	Totals     EvePraisalTotals `json:"totals"`
}

EvePraisal represents a retrieved evepraisal and all values

func (EvePraisal) GetTotalBuyValue

func (e EvePraisal) GetTotalBuyValue() float64

GetTotalBuyValue fetches the total buy value of the EvePraisal

func (EvePraisal) GetTotalSellValue

func (e EvePraisal) GetTotalSellValue() float64

GetTotalSellValue fetches the total sell value of the EvePraisal

func (EvePraisal) GetTotalVolume

func (e EvePraisal) GetTotalVolume() float64

GetTotalVolume fetches the total volume of the EvePraisal

type EvePraisalItem

type EvePraisalItem struct {
	GroupID  int64            `json:"groupID"`
	Market   bool             `json:"market"`
	Name     string           `json:"name"`
	Prices   EvePraisalPrices `json:"prices"`
	Quantity int64            `json:"quantity"`
	TypeID   int64            `json:"typeID"`
	TypeName string           `json:"typeName"`
	Volume   float64          `json:"volume"`
}

EvePraisalItem represents one item as retrieved from evepraisal

type EvePraisalPrice

type EvePraisalPrice struct {
	Average float64 `json:"avg"`
	Maximum float64 `json:"max"`
	Minimum float64 `json:"min"`
	Price   float64 `json:"price"`
}

EvePraisalPrice represents a single price including average, minimum and maximum

type EvePraisalPrices

type EvePraisalPrices struct {
	All  EvePraisalPrice `json:"all"`
	Buy  EvePraisalPrice `json:"buy"`
	Sell EvePraisalPrice `json:"sell"`
}

EvePraisalPrices represents all three prices of one EvePraisalItem

type EvePraisalTotals

type EvePraisalTotals struct {
	Buy    float64 `json:"buy"`
	Sell   float64 `json:"sell"`
	Volume float64 `json:"volume"`
}

EvePraisalTotals represents the total of all prices of the EvePraisal and all items

type LootPaste

type LootPaste struct {
	ID            int64
	CharacterName string
	RawPaste      string
	PasteComment  string
	TotalValue    int
	TaxAmount     int
	Timestamp     time.Time
}

LootPaste stores all required information about the loot paste

func NewLootPaste

func NewLootPaste(character string, rawPaste string, comment string) *LootPaste

NewLootPaste creates a new loot paste with the given values

func (*LootPaste) FetchValue

func (lootPaste *LootPaste) FetchValue() error

FetchValue transmits the given loot paste to evepraisal and retrieves its values

func (*LootPaste) PasteLoot

func (lootPaste *LootPaste) PasteLoot() (string, error)

PasteLoot sends the given loot to evepraisal and retrieves the evepraisal ID

func (*LootPaste) RetrieveLootValue

func (lootPaste *LootPaste) RetrieveLootValue(lootID string) error

RetrieveLootValue fetches the evepraisal of the posted loot and parses the result

Jump to

Keyboard shortcuts

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