stats

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

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

Go to latest
Published: Dec 15, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Items []Item

Items var array

Functions

func Add

func Add(exchange string, p pair.CurrencyPair, assetType string, price, volume float64)

Add adds or updates the item stats

func AlreadyExists

func AlreadyExists(exchange string, p pair.CurrencyPair, assetType string, price, volume float64) bool

AlreadyExists checks to see if item info already exists for a specific currency pair and asset type

func Append

func Append(exchange string, p pair.CurrencyPair, assetType string, price, volume float64)

Append adds or updates the item stats for a specific currency pair and asset type

Types

type ByPrice

type ByPrice []Item

ByPrice allows sorting by price

func (ByPrice) Len

func (b ByPrice) Len() int

func (ByPrice) Less

func (b ByPrice) Less(i, j int) bool

func (ByPrice) Swap

func (b ByPrice) Swap(i, j int)

type ByVolume

type ByVolume []Item

ByVolume allows sorting by volume

func (ByVolume) Len

func (b ByVolume) Len() int

func (ByVolume) Less

func (b ByVolume) Less(i, j int) bool

func (ByVolume) Swap

func (b ByVolume) Swap(i, j int)

type Item

type Item struct {
	Exchange  string
	Pair      pair.CurrencyPair
	AssetType string
	Price     float64
	Volume    float64
}

Item holds various fields for storing currency pair stats

func SortExchangesByPrice

func SortExchangesByPrice(p pair.CurrencyPair, assetType string, reverse bool) []Item

SortExchangesByPrice sorts item info by volume for a specific currency pair and asset type. Reverse will reverse the order from lowest to highest

func SortExchangesByVolume

func SortExchangesByVolume(p pair.CurrencyPair, assetType string, reverse bool) []Item

SortExchangesByVolume sorts item info by volume for a specific currency pair and asset type. Reverse will reverse the order from lowest to highest

Jump to

Keyboard shortcuts

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