Documentation ¶
Overview ¶
Package market is a package to lookup market information for DUST514
Index ¶
Constants ¶
View Source
const BaseURL = "http://public-crest.eveonline.com/market/"
BaseURL is the base url for market data
View Source
const (
// TimeFormat is used internally for market cache
TimeFormat = "01-02 2006 03:04PM"
)
Variables ¶
This section is empty.
Functions ¶
func CacheData ¶
func CacheData(t int, m map[string]MarketData) error
CacheData stores our market cache
func CheckCache ¶
CheckCache checks to see if we have valid cache for the type.
func GetMarketData ¶
func GetMarketData(s *sde.SDEType) map[string]MarketData
GetMarketData returns a set of MarketData for a type.
func GetUnitsSold ¶
Types ¶
type Cache ¶
type Cache struct { Data map[string]MarketData `json:"data"` Time string `json:"time"` TypeID int `json:"typeid"` }
Cache is our struct for each cache file
type Location ¶
regions.go is just a hardcoded anonymous struct to keep track of all of the regions
Location is a tuple like struct of the reigon name and it's typeID
type Locations ¶
type Locations struct {
Regions []Location
}
Locations is just a slice of all the locations
var Regions Locations
type MarketData ¶
type MarketData struct {
Items []MarketDataEntry `json:"items"`
}
MarketData is a set to group a slice of MarketDataEntry
type MarketDataEntry ¶
type MarketDataEntry struct { AveragePrice float64 `json:"avgPrice"` Date string `json:"date"` HighPrice float64 `json:"highPrice"` LowPrice float64 `json:"lowPrice"` OrderCount float64 `json:"orderCount"` Volume float64 `json:"volume"` }
MarketDataEntry is a struct for Unmarhaling Market data
Click to show internal directories.
Click to hide internal directories.