prices

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

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

Go to latest
Published: May 9, 2019 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PricesCommand = cli.Command{
	Name:  "prices",
	Usage: "options for adding to prices database",
	Subcommands: []cli.Command{
		loadPriceCommand,
		loadPriceDirCommand,
		loadSinglePriceCommand,
		searchPriceCommand,
		printPriceCommand,
	},
}

Functions

This section is empty.

Types

type CryptoCompareResponse

type CryptoCompareResponse struct {
	USD            float64 `json:"USD"`
	ConversionType struct {
		Type             string `json:"type"`
		ConversionSymbol string `json:"conversionSymbol"`
	} `json:"ConversionType"`
}

type PriceItem

type PriceItem struct {
	Currency string
	Date     string
	Base     string
	Amount   float64
}

func PriceSearch

func PriceSearch(coin, searchdate string) (*PriceItem, error)

type Pricer

type Pricer struct {
	DB cgtdb.Database
}

func NewPricer

func NewPricer(db cgtdb.Database) *Pricer

func (*Pricer) AddPriceDir

func (p *Pricer) AddPriceDir(dirname, base, dateFormat string, dateColumn, priceColumn int)

func (*Pricer) AddPriceFile

func (p *Pricer) AddPriceFile(filename, base, currency, dateFormat string, dateColumn, priceColumn int)

func (*Pricer) AddSinglePrice

func (p *Pricer) AddSinglePrice(date, currency, amount, base string)

func (*Pricer) Close

func (p *Pricer) Close()

func (*Pricer) GetPrice

func (pr *Pricer) GetPrice(date, currency string) float64

Jump to

Keyboard shortcuts

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