Versions in this module Expand all Collapse all v0 v0.8.5 Nov 28, 2022 v0.8.3 Nov 28, 2022 Changes in this version + const AllFilePermissions + const DefaultFilePermissions + const DefaultShards + const MaxEntrySizePerTxn + const MillisecondsInSecond + const NanosecondsInMillisecond + const OneHundred + var ErrNetworkNotSupported = errors.New("network not supported") + var OneHundredInt = big.NewInt(OneHundred) + var ZeroInt = big.NewInt(0) + func AllCurrencyBalance(ctx context.Context, network *types.NetworkIdentifier, helper FetcherHelper, ...) ([]*types.Amount, *types.BlockIdentifier, error) + func AtTip(tipDelay int64, blockTimestamp int64) bool + func BigPow10(e int32) *big.Float + func BtoMb(b float64) float64 + func CheckNetworkSupported(ctx context.Context, networkIdentifier *types.NetworkIdentifier, ...) (*types.NetworkStatusResponse, error) + func CheckNetworkTip(ctx context.Context, network *types.NetworkIdentifier, tipDelay int64, ...) (bool, *types.BlockIdentifier, error) + func CheckStorageTip(ctx context.Context, network *types.NetworkIdentifier, tipDelay int64, ...) (bool, *types.BlockIdentifier, error) + func ContainsAccountIdentifier(arr []*types.AccountIdentifier, s *types.AccountIdentifier) bool + func ContainsString(arr []string, s string) bool + func ContextSleep(ctx context.Context, duration time.Duration) error + func CreateCommandPath(dataDirectory string, cmd string, network *types.NetworkIdentifier) (string, error) + func CreateTempDir() (string, error) + func CurrencyBalance(ctx context.Context, network *types.NetworkIdentifier, helper FetcherHelper, ...) (*types.Amount, *types.BlockIdentifier, error) + func EnsurePathExists(path string) error + func Equal(a interface{}, b interface{}) bool + func LoadAndParse(filePath string, output interface{}) error + func Milliseconds() int64 + func PrettyAmount(amount *big.Int, currency *types.Currency) string + func RandomNumber(minimum *big.Int, maximum *big.Int) (*big.Int, error) + func RemoveTempDir(dir string) + func SerializeAndWrite(filePath string, object interface{}) error + func SizeOf(v interface{}) int + func TimeToTip(blocksPerSecond float64, lastSyncedIndex int64, tipIndex int64) time.Duration + func Zero() *big.Float + type AccountBalance struct + Account *types.AccountIdentifier + Amount *types.Amount + Block *types.BlockIdentifier + Coins []*types.Coin + func GetAccountBalances(ctx context.Context, fetcher FetcherHelper, ...) ([]*AccountBalance, error) + type AccountBalanceRequest struct + Account *types.AccountIdentifier + Currency *types.Currency + Network *types.NetworkIdentifier + type AccountCoinsRequest struct + Account *types.AccountIdentifier + Currencies []*types.Currency + IncludeMempool bool + Network *types.NetworkIdentifier + type AccountCoinsResponse struct + Coins []*types.Coin + func GetAccountCoins(ctx context.Context, fetcher FetcherHelper, ...) ([]*AccountCoinsResponse, error) + type BST struct + func (t *BST) Delete(key int64) + func (t *BST) Empty() bool + func (t *BST) Get(key int64) *Node + func (t *BST) Min() *Node + func (t *BST) Set(key int64, value int) + type BlockStorageHelper interface + GetBlockLazy func(ctx context.Context, blockIdentifier *types.PartialBlockIdentifier) (*types.BlockResponse, error) + type FetcherHelper interface + AccountBalanceRetry func(ctx context.Context, network *types.NetworkIdentifier, ...) (*types.BlockIdentifier, []*types.Amount, map[string]interface{}, ...) + AccountCoinsRetry func(ctx context.Context, network *types.NetworkIdentifier, ...) (*types.BlockIdentifier, []*types.Coin, map[string]interface{}, *fetcher.Error) + NetworkList func(ctx context.Context, metadata map[string]interface{}) (*types.NetworkListResponse, *fetcher.Error) + NetworkStatusRetry func(ctx context.Context, network *types.NetworkIdentifier, ...) (*types.NetworkStatusResponse, *fetcher.Error) + type MemoryUsage struct + GarbageCollections uint32 + Heap float64 + OtherSystem float64 + Stack float64 + System float64 + func MonitorMemoryUsage(ctx context.Context, maxHeapUsage int) *MemoryUsage + type MutexMap struct + func NewMutexMap(shards int) *MutexMap + func (m *MutexMap) GLock() + func (m *MutexMap) GUnlock() + func (m *MutexMap) Lock(identifier string, priority bool) + func (m *MutexMap) Unlock(identifier string) + type Node struct + Key int64 + Value int + type PriorityMutex struct + func (m *PriorityMutex) Lock(priority bool) + func (m *PriorityMutex) Unlock() + type ShardedMap struct + func NewShardedMap(shards int) *ShardedMap + func (m *ShardedMap) Lock(key string, priority bool) map[string]interface{} + func (m *ShardedMap) Unlock(key string)