Versions in this module Expand all Collapse all v3 v3.0.1 Oct 30, 2019 Changes in this version + const BlockBin + const BlockChainSize + const BlockSize + const ChainWork + const CoinSupply + const DayBin + const DurationBTW + const Fees + const HashRate + const HashrateAvgLength + const HeightAxis + const InvalidBinErr + const POWDifficulty + const PercentStaked + const TicketPoolSize + const TicketPoolValue + const TicketPrice + const TimeAxis + const TxCount + const UnknownChartErr + const WindMissedVotes + const WindowBin + var DefaultBinLevel = DayBin + func AllCreditAddressRows(rows []*dbtypes.AddressRow) []*dbtypes.AddressRow + func AllDebitAddressRows(rows []*dbtypes.AddressRow) []*dbtypes.AddressRow + func CountCreditDebitRows(rows []*dbtypes.AddressRow) (numCredit, numDebit int) + func CountCreditDebitRowsCompact(rows []*dbtypes.AddressRowCompact) (numCredit, numDebit int) + func CountCreditDebitRowsMerged(rows []*dbtypes.AddressRowMerged) (numCredit, numDebit int) + func CreditAddressRows(rows interface{}, N, offset int) interface + func DebitAddressRows(rows interface{}, N, offset int) interface + func DisableLog() + func ParseAxis(aType string) axisType + func ParseBin(bin string) binLevel + func UseLogger(logger slog.Logger) + func ValidateLengths(lens ...lengther) (int, error) + type AddressCache struct + ProjectAddress string + func NewAddressCache(rowCapacity int) *AddressCache + func (ac *AddressCache) Balance(addr string) (*dbtypes.AddressBalance, *BlockID) + func (ac *AddressCache) BalanceStats() (hits, misses int) + func (ac *AddressCache) Clear(addrs []string) (numCleared int) + func (ac *AddressCache) ClearAll() (numCleared int) + func (ac *AddressCache) ClearRows(addr string) + func (ac *AddressCache) ClearUTXOs(addr string) + func (ac *AddressCache) HistoryChart(addr string, addrChart dbtypes.HistoryChart, ...) (*dbtypes.ChartsData, *BlockID) + func (ac *AddressCache) HistoryStats() (hits, misses int) + func (ac *AddressCache) Length() (numAddrs, numTxns, numUTXOs int) + func (ac *AddressCache) NumAddresses() int + func (ac *AddressCache) NumRows(addr string) (int, *BlockID) + func (ac *AddressCache) Reporter() + func (ac *AddressCache) RowStats() (hits, misses int) + func (ac *AddressCache) Rows(addr string) ([]*dbtypes.AddressRowCompact, *BlockID) + func (ac *AddressCache) StoreBalance(addr string, balance *dbtypes.AddressBalance, block *BlockID) bool + func (ac *AddressCache) StoreHistoryChart(addr string, addrChart dbtypes.HistoryChart, ...) bool + func (ac *AddressCache) StoreRows(addr string, rows []*dbtypes.AddressRow, block *BlockID) bool + func (ac *AddressCache) StoreRowsCompact(addr string, rows []*dbtypes.AddressRowCompact, block *BlockID) bool + func (ac *AddressCache) StoreUTXOs(addr string, utxos []*dbtypes.AddressTxnOutput, block *BlockID) bool + func (ac *AddressCache) Transactions(addr string, N, offset int64, txnType dbtypes.AddrTxnViewType) ([]*dbtypes.AddressRow, *BlockID, error) + func (ac *AddressCache) TransactionsCompact(addr string, N, offset int64, txnType dbtypes.AddrTxnViewType) ([]*dbtypes.AddressRowCompact, *BlockID, error) + func (ac *AddressCache) TransactionsMerged(addr string, N, offset int64, txnType dbtypes.AddrTxnViewType) ([]*dbtypes.AddressRowMerged, *BlockID, error) + func (ac *AddressCache) UTXOs(addr string) ([]*dbtypes.AddressTxnOutput, *BlockID) + func (ac *AddressCache) UtxoStats() (hits, misses int) + type AddressCacheItem struct + func (d *AddressCacheItem) Balance() (*dbtypes.AddressBalance, *BlockID) + func (d *AddressCacheItem) BlockHash() chainhash.Hash + func (d *AddressCacheItem) BlockHeight() int64 + func (d *AddressCacheItem) HistoryChart(addrChart dbtypes.HistoryChart, chartGrouping dbtypes.TimeBasedGrouping) (*dbtypes.ChartsData, *BlockID) + func (d *AddressCacheItem) NumRows() (int, *BlockID) + func (d *AddressCacheItem) Rows() ([]*dbtypes.AddressRowCompact, *BlockID) + func (d *AddressCacheItem) SetBalance(block BlockID, balance *dbtypes.AddressBalance) + func (d *AddressCacheItem) SetRows(block BlockID, rows []*dbtypes.AddressRowCompact) + func (d *AddressCacheItem) SetUTXOs(block BlockID, utxos []*dbtypes.AddressTxnOutput) + func (d *AddressCacheItem) Transactions(N, offset int, txnView dbtypes.AddrTxnViewType) (interface{}, *BlockID, error) + func (d *AddressCacheItem) UTXOs() ([]*dbtypes.AddressTxnOutput, *BlockID) + type BlockID struct + Hash chainhash.Hash + Height int64 + func NewBlockID(hash *chainhash.Hash, height int64) *BlockID + type CacheLock struct + func NewCacheLock() *CacheLock + func (cl *CacheLock) TryLock(addr string) (busy bool, wait chan struct{}, done func()) + type ChartData struct + Blocks *zoomSet + Days *zoomSet + DiffInterval int32 + StartPOS int32 + Windows *windowSet + func NewChartData(ctx context.Context, height uint32, chainParams *chaincfg.Params) *ChartData + func (charts *ChartData) AddUpdater(updater ChartUpdater) + func (charts *ChartData) Chart(chartID, binString, axisString string) ([]byte, error) + func (charts *ChartData) Dump(dumpPath string) + func (charts *ChartData) FeesTip() int32 + func (charts *ChartData) Height() int32 + func (charts *ChartData) Lengthen() error + func (charts *ChartData) Load(cacheDumpPath string) error + func (charts *ChartData) MissedVotesTip() int32 + func (charts *ChartData) NewAtomsTip() int32 + func (charts *ChartData) PoolSizeTip() int32 + func (charts *ChartData) ReorgHandler(reorg *txhelpers.ReorgData) error + func (charts *ChartData) StateID() uint64 + func (charts *ChartData) TicketPriceTip() int32 + func (charts *ChartData) TriggerUpdate(_ string, _ uint32) error + func (charts *ChartData) Update() error + type ChartError string + func (e ChartError) Error() string + type ChartFloats []float64 + func (data ChartFloats) Avg(s, e int) float64 + func (data ChartFloats) Length() int + func (data ChartFloats) Sum(s, e int) (sum float64) + func (data ChartFloats) Truncate(l int) lengther + type ChartGobject struct + BlockSize ChartUints + Chainwork ChartUints + Fees ChartUints + Height ChartUints + MissedVotes ChartUints + NewAtoms ChartUints + PoolSize ChartUints + PoolValue ChartUints + PowDiff ChartFloats + StakeCount ChartUints + TicketPrice ChartUints + Time ChartUints + TxCount ChartUints + WindowTime ChartUints + type ChartMaker func(charts *ChartData, bin binLevel, axis axisType) ([]byte, error) + type ChartUints []uint64 + func (data ChartUints) Avg(s, e int) uint64 + func (data ChartUints) Length() int + func (data ChartUints) Sum(s, e int) (sum uint64) + func (data ChartUints) Truncate(l int) lengther + type ChartUpdater struct + Appender func(*ChartData, *sql.Rows) error + Fetcher func(*ChartData) (*sql.Rows, func(), error) + Tag string + type TxHistory struct + AmtFlowByInterval [dbtypes.NumIntervals]*dbtypes.ChartsData + TypeByInterval [dbtypes.NumIntervals]*dbtypes.ChartsData + func (th *TxHistory) Clear() Other modules containing this package github.com/decred/dcrdata/db/cache github.com/decred/dcrdata/db/cache/v2 github.com/decred/dcrdata/v4 github.com/decred/dcrdata/v6 github.com/decred/dcrdata/v7