data

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Run() error
	Stop() error
}

type ReserveData

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

func NewReserveData

func NewReserveData(storage Storage, fetcher Fetcher) *ReserveData

func (ReserveData) CurrentBalanceVersion

func (self ReserveData) CurrentBalanceVersion(timepoint uint64) (common.Version, error)

func (ReserveData) CurrentEBalanceVersion

func (self ReserveData) CurrentEBalanceVersion(timepoint uint64) (common.Version, error)

func (ReserveData) CurrentPriceVersion

func (self ReserveData) CurrentPriceVersion(timepoint uint64) (common.Version, error)

func (ReserveData) CurrentRateVersion

func (self ReserveData) CurrentRateVersion(timepoint uint64) (common.Version, error)

func (ReserveData) GetAllBalances

func (self ReserveData) GetAllBalances(timepoint uint64) (common.AllBalanceResponse, error)

func (ReserveData) GetAllEBalances

func (self ReserveData) GetAllEBalances(timepoint uint64) (common.AllEBalanceResponse, error)

func (ReserveData) GetAllPrices

func (self ReserveData) GetAllPrices(timepoint uint64) (common.AllPriceResponse, error)

func (ReserveData) GetAllRates

func (self ReserveData) GetAllRates(timepoint uint64) (common.AllRateResponse, error)

func (ReserveData) GetOnePrice

func (self ReserveData) GetOnePrice(pairID common.TokenPairID, timepoint uint64) (common.OnePriceResponse, error)

func (ReserveData) GetPendingActivities

func (self ReserveData) GetPendingActivities() ([]common.ActivityRecord, error)

func (ReserveData) GetRecords

func (self ReserveData) GetRecords() ([]common.ActivityRecord, error)

func (ReserveData) Run

func (self ReserveData) Run() error

func (ReserveData) Stop

func (self ReserveData) Stop() error

type Storage

type Storage interface {
	CurrentPriceVersion(timepoint uint64) (common.Version, error)
	GetAllPrices(common.Version) (map[common.TokenPairID]common.OnePrice, error)
	GetOnePrice(common.TokenPairID, common.Version) (common.OnePrice, error)

	CurrentBalanceVersion(timepoint uint64) (common.Version, error)
	GetAllBalances(common.Version) (map[string]common.BalanceEntry, error)

	CurrentEBalanceVersion(timepoint uint64) (common.Version, error)
	GetAllEBalances(common.Version) (map[common.ExchangeID]common.EBalanceEntry, error)

	CurrentRateVersion(timepoint uint64) (common.Version, error)
	GetAllRates(common.Version) (common.AllRateEntry, error)

	GetAllRecords() ([]common.ActivityRecord, error)
	GetPendingActivities() ([]common.ActivityRecord, error)
}

type TestFetcher

type TestFetcher struct{}

func NewTestFetcher

func NewTestFetcher() TestFetcher

type TestStorage

type TestStorage struct{}

func NewTestStorage

func NewTestStorage() TestStorage

func (TestStorage) CurrentPriceVersion

func (self TestStorage) CurrentPriceVersion() (common.Version, error)

func (TestStorage) GetAllPrices

func (self TestStorage) GetAllPrices(version common.Version) (map[common.TokenPairID]common.OnePrice, error)

func (TestStorage) GetOnePrice

func (self TestStorage) GetOnePrice(pairID common.TokenPairID, version common.Version) (common.OnePrice, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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