CryptoRates: bitbucket.org/ltry/CryptoRates/header Index | Files

package header

import "bitbucket.org/ltry/CryptoRates/header"

Index

Package Files

checks.go db.go exchange.go header.go rate.go

Variables

var MAXPROCS = 20

func ExchangeGetRateCheck Uses

func ExchangeGetRateCheck(exchange CryptoExchange, pairs []CurrPair, recency int64) error

func Init Uses

func Init()

func MockInit Uses

func MockInit()

func RateCheck Uses

func RateCheck(rate Rate, recency int64) error

type BoltContainer Uses

type BoltContainer struct {
    // contains filtered or unexported fields
}

func (*BoltContainer) Close Uses

func (bc *BoltContainer) Close() error

func (*BoltContainer) Init Uses

func (bc *BoltContainer) Init(path string)

func (*BoltContainer) LoadRate Uses

func (bc *BoltContainer) LoadRate(market CryptoExchange, pair CurrPair) (Rate, error)

func (*BoltContainer) SaveRate Uses

func (bc *BoltContainer) SaveRate(exchange CryptoExchange, rate Rate) error

type CryptoExchange Uses

type CryptoExchange interface {
    GetName() string
    GetRate(CurrPair, int64) (Rate, error)
    GetTradesUrl(CurrPair) string
}

type CurrPair Uses

type CurrPair struct {
    First  string
    Second string
}

func (CurrPair) String Uses

func (pair CurrPair) String() string

type DBContainer Uses

type DBContainer interface {
    Init(string)
    Close() error
    SaveRate(CryptoExchange, Rate) error
    LoadRate(CryptoExchange, CurrPair) (Rate, error)
}
var DBC DBContainer

type FormattedRate Uses

type FormattedRate struct {
    Pair      string `json:"pair"`
    Exchange  string `json:"exchange"`
    BuyPrice  string `json:"buyPrice"`
    SellPrice string `json:"sellPrice"`
    Updated   string `json:"updated"`
}

func (*FormattedRate) FromRate Uses

func (fRate *FormattedRate) FromRate(market CryptoExchange, rate Rate)

func (*FormattedRate) ToRate Uses

func (fRate *FormattedRate) ToRate() (Rate, error)

type FormattedRates Uses

type FormattedRates []FormattedRate

func (FormattedRates) Len Uses

func (fRates FormattedRates) Len() int

func (FormattedRates) Less Uses

func (fRates FormattedRates) Less(i, j int) bool

func (FormattedRates) Swap Uses

func (fRates FormattedRates) Swap(i, j int)

type MockDBContainer Uses

type MockDBContainer struct {
    MockInit     func()
    MockClose    func() error
    MockSaveRate func(CryptoExchange, Rate) error
    MockLoadRate func(CryptoExchange, CurrPair) (Rate, error)
}

func (*MockDBContainer) Close Uses

func (dbc *MockDBContainer) Close() error

func (*MockDBContainer) Init Uses

func (dbc *MockDBContainer) Init(string)

func (*MockDBContainer) LoadRate Uses

func (dbc *MockDBContainer) LoadRate(exchange CryptoExchange, pair CurrPair) (Rate, error)

func (*MockDBContainer) SaveRate Uses

func (dbc *MockDBContainer) SaveRate(exchange CryptoExchange, rate Rate) error

type MockExchange Uses

type MockExchange struct {
    MockGetName      func() string
    MockGetTradesUrl func(CurrPair) string
    MockGetRate      func(CurrPair, int64) (Rate, error)
}

func (*MockExchange) GetName Uses

func (exchange *MockExchange) GetName() string

func (*MockExchange) GetRate Uses

func (exchange *MockExchange) GetRate(pair CurrPair, recency int64) (Rate, error)

func (*MockExchange) GetTradesUrl Uses

func (exchange *MockExchange) GetTradesUrl(pair CurrPair) string

type Rate Uses

type Rate struct {
    Pair      CurrPair
    BuyPrice  float64
    SellPrice float64
    Updated   int64
}

func (Rate) String Uses

func (rate Rate) String() string

Package header imports 12 packages (graph) and is imported by 8 packages. Updated 2020-01-27. Refresh now. Tools for package owners.