market

package
v0.0.0-...-fe7b80c Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2015 License: MIT Imports: 10 Imported by: 0

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

func CheckCache(t int) bool

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

func GetUnitsSold(i interface{}) (int, error)

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

func GetCache

func GetCache(t int) (Cache, error)

GetCache returns a cache for a typeid

type Location

type Location struct {
	Name   string
	TypeID int
}
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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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