Documentation ¶
Index ¶
- type Fetcher
- type GlobalStorage
- type ReserveData
- func (rd ReserveData) ControlAuthDataSize() error
- func (rd ReserveData) CurrentAuthDataVersion(timepoint uint64) (common.Version, error)
- func (rd ReserveData) CurrentBTCInfoVersion(timepoint uint64) (common.Version, error)
- func (rd ReserveData) CurrentGoldInfoVersion(timepoint uint64) (common.Version, error)
- func (rd ReserveData) CurrentPriceVersion(timepoint uint64) (common.Version, error)
- func (rd ReserveData) CurrentUSDInfoVersion(timepoint uint64) (common.Version, error)
- func (rd ReserveData) GetAllFetcherConfiguration() (common.FetcherConfiguration, error)
- func (rd ReserveData) GetAllPrices(timepoint uint64) (common.AllPriceResponse, error)
- func (rd ReserveData) GetAuthData(timepoint uint64) (common.AuthDataResponse, error)
- func (rd ReserveData) GetBTCData(timestamp uint64) (common.BTCData, error)
- func (rd ReserveData) GetExchangeStatus() (common.ExchangesStatus, error)
- func (rd ReserveData) GetFeedConfiguration() ([]common.FeedConfiguration, error)
- func (rd ReserveData) GetGoldData(timestamp uint64) (common.GoldData, error)
- func (rd ReserveData) GetNotifications() (common.ExchangeNotifications, error)
- func (rd ReserveData) GetOnePrice(pairID common.TokenPairID, timepoint uint64) (common.OnePriceResponse, error)
- func (rd ReserveData) GetPendingActivities() ([]common.ActivityRecord, error)
- func (rd ReserveData) GetRate(timepoint uint64) (common.AllRateResponse, error)
- func (rd ReserveData) GetRates(fromTime, toTime uint64) ([]common.AllRateResponse, error)
- func (rd ReserveData) GetRecords(fromTime, toTime uint64) ([]common.ActivityRecord, error)
- func (rd ReserveData) GetTradeHistory(fromTime, toTime uint64) (common.AllTradeHistory, error)
- func (rd ReserveData) GetUSDData(timestamp uint64) (common.USDData, error)
- func (rd ReserveData) Run() error
- func (rd ReserveData) RunStorageController() error
- func (rd ReserveData) Stop() error
- func (rd ReserveData) UpdateExchangeNotification(exchange, action, tokenPair string, fromTime, toTime uint64, isWarning bool, ...) error
- func (rd ReserveData) UpdateExchangeStatus(exchange string, status bool, timestamp uint64) error
- func (rd ReserveData) UpdateFeedConfiguration(name string, enabled bool) error
- func (rd ReserveData) UpdateFetcherConfiguration(query common.FetcherConfiguration) error
- type Setting
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalStorage ¶ added in v0.1.1
type GlobalStorage interface { GetGoldInfo(version common.Version) (common.GoldData, error) CurrentGoldInfoVersion(timepoint uint64) (common.Version, error) GetBTCInfo(version common.Version) (common.BTCData, error) GetUSDInfo(version common.Version) (common.USDData, error) CurrentBTCInfoVersion(timepoint uint64) (common.Version, error) CurrentUSDInfoVersion(timepoint uint64) (common.Version, error) UpdateFeedConfiguration(string, bool) error GetFeedConfiguration() ([]common.FeedConfiguration, error) UpdateFetcherConfiguration(common.FetcherConfiguration) error GetAllFetcherConfiguration() (common.FetcherConfiguration, error) }
GlobalStorage is the interfaces that wraps database operations of real world pricing information of ReserveData.
type ReserveData ¶
type ReserveData struct {
// contains filtered or unexported fields
}
ReserveData struct for reserve data
func NewReserveData ¶
func NewReserveData(storage Storage, fetcher Fetcher, storageControllerRunner datapruner.StorageControllerRunner, arch archive.Archive, globalStorage GlobalStorage, exchanges []common.Exchange, setting Setting) *ReserveData
NewReserveData initiate a new reserve instance
func (ReserveData) ControlAuthDataSize ¶ added in v0.1.1
func (rd ReserveData) ControlAuthDataSize() error
ControlAuthDataSize pack old data to file, push to S3 and prune outdated data
func (ReserveData) CurrentAuthDataVersion ¶ added in v0.1.1
func (rd ReserveData) CurrentAuthDataVersion(timepoint uint64) (common.Version, error)
func (ReserveData) CurrentBTCInfoVersion ¶ added in v0.1.1
func (rd ReserveData) CurrentBTCInfoVersion(timepoint uint64) (common.Version, error)
func (ReserveData) CurrentGoldInfoVersion ¶ added in v0.1.1
func (rd ReserveData) CurrentGoldInfoVersion(timepoint uint64) (common.Version, error)
func (ReserveData) CurrentPriceVersion ¶
func (rd ReserveData) CurrentPriceVersion(timepoint uint64) (common.Version, error)
func (ReserveData) CurrentUSDInfoVersion ¶ added in v0.1.1
func (rd ReserveData) CurrentUSDInfoVersion(timepoint uint64) (common.Version, error)
func (ReserveData) GetAllFetcherConfiguration ¶ added in v0.1.1
func (rd ReserveData) GetAllFetcherConfiguration() (common.FetcherConfiguration, error)
GetAllFetcherConfiguration returns current fetcher configuration for all tokens
func (ReserveData) GetAllPrices ¶
func (rd ReserveData) GetAllPrices(timepoint uint64) (common.AllPriceResponse, error)
func (ReserveData) GetAuthData ¶ added in v0.1.1
func (rd ReserveData) GetAuthData(timepoint uint64) (common.AuthDataResponse, error)
func (ReserveData) GetBTCData ¶ added in v0.1.1
func (rd ReserveData) GetBTCData(timestamp uint64) (common.BTCData, error)
func (ReserveData) GetExchangeStatus ¶ added in v0.1.1
func (rd ReserveData) GetExchangeStatus() (common.ExchangesStatus, error)
func (ReserveData) GetFeedConfiguration ¶ added in v0.1.1
func (rd ReserveData) GetFeedConfiguration() ([]common.FeedConfiguration, error)
func (ReserveData) GetGoldData ¶ added in v0.1.1
func (rd ReserveData) GetGoldData(timestamp uint64) (common.GoldData, error)
func (ReserveData) GetNotifications ¶ added in v0.1.1
func (rd ReserveData) GetNotifications() (common.ExchangeNotifications, error)
func (ReserveData) GetOnePrice ¶
func (rd ReserveData) GetOnePrice(pairID common.TokenPairID, timepoint uint64) (common.OnePriceResponse, error)
func (ReserveData) GetPendingActivities ¶
func (rd ReserveData) GetPendingActivities() ([]common.ActivityRecord, error)
func (ReserveData) GetRate ¶ added in v0.1.1
func (rd ReserveData) GetRate(timepoint uint64) (common.AllRateResponse, error)
func (ReserveData) GetRates ¶ added in v0.1.1
func (rd ReserveData) GetRates(fromTime, toTime uint64) ([]common.AllRateResponse, error)
func (ReserveData) GetRecords ¶
func (rd ReserveData) GetRecords(fromTime, toTime uint64) ([]common.ActivityRecord, error)
func (ReserveData) GetTradeHistory ¶ added in v0.1.1
func (rd ReserveData) GetTradeHistory(fromTime, toTime uint64) (common.AllTradeHistory, error)
func (ReserveData) GetUSDData ¶ added in v0.1.1
func (rd ReserveData) GetUSDData(timestamp uint64) (common.USDData, error)
func (ReserveData) RunStorageController ¶ added in v0.1.1
func (rd ReserveData) RunStorageController() error
func (ReserveData) UpdateExchangeNotification ¶ added in v0.1.1
func (ReserveData) UpdateExchangeStatus ¶ added in v0.1.1
func (rd ReserveData) UpdateExchangeStatus(exchange string, status bool, timestamp uint64) error
func (ReserveData) UpdateFeedConfiguration ¶ added in v0.1.1
func (rd ReserveData) UpdateFeedConfiguration(name string, enabled bool) error
func (ReserveData) UpdateFetcherConfiguration ¶ added in v0.1.1
func (rd ReserveData) UpdateFetcherConfiguration(query common.FetcherConfiguration) error
UpdateFetcherConfiguration save btc fetcher configuration to db and return new configuration
type Setting ¶ added in v0.1.1
type Setting interface { GetInternalTokenByID(tokenID string) (common.Token, error) GetExchangeStatus() (common.ExchangesStatus, error) UpdateExchangeStatus(data common.ExchangesStatus) error UpdateExchangeNotification(exchange, action, tokenPair string, fromTime, toTime uint64, isWarning bool, msg string) error GetExchangeNotifications() (common.ExchangeNotifications, error) }
type Storage ¶
type Storage interface { CurrentPriceVersion(timepoint uint64) (common.Version, error) GetAllPrices(common.Version) (common.AllPriceEntry, error) GetOnePrice(common.TokenPairID, common.Version) (common.OnePrice, error) CurrentAuthDataVersion(timepoint uint64) (common.Version, error) GetAuthData(common.Version) (common.AuthDataSnapshot, error) //ExportExpiredAuthData: Write all expired records into a predetermined filepath //each record will be represented in JSON format, and seperates by endline character //Return: Number of records exported (uint64) and error ExportExpiredAuthData(timepoint uint64, filePath string) (uint64, error) PruneExpiredAuthData(timepoint uint64) (uint64, error) CurrentRateVersion(timepoint uint64) (common.Version, error) GetRate(common.Version) (common.AllRateEntry, error) GetRates(fromTime, toTime uint64) ([]common.AllRateEntry, error) GetAllRecords(fromTime, toTime uint64) ([]common.ActivityRecord, error) GetPendingActivities() ([]common.ActivityRecord, error) }
Storage is the interface that wraps all database operations of ReserveData.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.