Documentation ¶
Index ¶
- func CreatePoolsHolder(numShards uint32, selfShard uint32) dataRetriever.PoolsHolder
- func CreatePoolsHolderWithTxPool(txPool dataRetriever.ShardedDataCacherNotifier) dataRetriever.PoolsHolder
- func CreateTxPool(numShards uint32, selfShard uint32) (dataRetriever.ShardedDataCacherNotifier, error)
- func GetGeneralConfig() config.Config
- type CacherMock
- func (cacher *CacherMock) Clear()
- func (cacher *CacherMock) Get(key []byte) (value interface{}, ok bool)
- func (cacher *CacherMock) Has(key []byte) bool
- func (cacher *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (has, added bool)
- func (cacher *CacherMock) IsInterfaceNil() bool
- func (cacher *CacherMock) Keys() [][]byte
- func (cacher *CacherMock) Len() int
- func (cacher *CacherMock) MaxSize() int
- func (cacher *CacherMock) Peek(key []byte) (value interface{}, ok bool)
- func (cacher *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
- func (cacher *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cacher *CacherMock) Remove(key []byte)
- func (cacher *CacherMock) UnRegisterHandler(string)
- type CacherStub
- func (cacher *CacherStub) Clear()
- func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Has(key []byte) bool
- func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
- func (cacher *CacherStub) IsInterfaceNil() bool
- func (cacher *CacherStub) Keys() [][]byte
- func (cacher *CacherStub) Len() int
- func (cacher *CacherStub) MaxSize() int
- func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
- func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cacher *CacherStub) Remove(key []byte)
- func (cacher *CacherStub) UnRegisterHandler(id string)
- type PeerHonestyHandlerStub
- type PoolsHolderMock
- func (holder *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (holder *PoolsHolderMock) Headers() dataRetriever.HeadersPool
- func (holder *PoolsHolderMock) IsInterfaceNil() bool
- func (holder *PoolsHolderMock) MiniBlocks() storage.Cacher
- func (holder *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
- func (holder *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderMock) SetTransactions(pool dataRetriever.ShardedDataCacherNotifier)
- func (holder *PoolsHolderMock) SetUnsignedTransactions(pool dataRetriever.ShardedDataCacherNotifier)
- func (holder *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderMock) TrieNodes() storage.Cacher
- func (holder *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PoolsHolderStub
- func (holder *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (holder *PoolsHolderStub) Headers() dataRetriever.HeadersPool
- func (holder *PoolsHolderStub) IsInterfaceNil() bool
- func (holder *PoolsHolderStub) MetaBlocks() storage.Cacher
- func (holder *PoolsHolderStub) MiniBlocks() storage.Cacher
- func (holder *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
- func (holder *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderStub) TrieNodes() storage.Cacher
- func (holder *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type ProtoMarshalizerMock
- type ShardedDataStub
- func (shardedData *ShardedDataStub) AddData(key []byte, data interface{}, sizeInBytes int, cacheID string)
- func (shardedData *ShardedDataStub) Clear()
- func (shardedData *ShardedDataStub) ClearShardStore(cacheID string)
- func (sd *ShardedDataStub) GetCounts() counting.CountsWithSize
- func (shardedData *ShardedDataStub) ImmunizeSetOfDataAgainstEviction(keys [][]byte, cacheID string)
- func (shardedData *ShardedDataStub) IsInterfaceNil() bool
- func (shardedData *ShardedDataStub) MergeShardStores(sourceCacheID, destCacheID string)
- func (shardedData *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{}))
- func (shardedData *ShardedDataStub) RemoveData(key []byte, cacheID string)
- func (shardedData *ShardedDataStub) RemoveDataFromAllShards(key []byte)
- func (shardedData *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheID string)
- func (shardedData *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
- func (shardedData *ShardedDataStub) ShardDataStore(cacheID string) storage.Cacher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePoolsHolder ¶
func CreatePoolsHolder(numShards uint32, selfShard uint32) dataRetriever.PoolsHolder
CreatePoolsHolder -
func CreatePoolsHolderWithTxPool ¶
func CreatePoolsHolderWithTxPool(txPool dataRetriever.ShardedDataCacherNotifier) dataRetriever.PoolsHolder
CreatePoolsHolderWithTxPool -
func CreateTxPool ¶
func CreateTxPool(numShards uint32, selfShard uint32) (dataRetriever.ShardedDataCacherNotifier, error)
CreateTxPool -
func GetGeneralConfig ¶
Types ¶
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
CacherMock -
func (*CacherMock) Get ¶
func (cacher *CacherMock) Get(key []byte) (value interface{}, ok bool)
Get -
func (*CacherMock) HasOrAdd ¶
func (cacher *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (has, added bool)
HasOrAdd -
func (*CacherMock) IsInterfaceNil ¶
func (cacher *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Peek ¶
func (cacher *CacherMock) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherMock) Put ¶
func (cacher *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
Put -
func (*CacherMock) RegisterHandler ¶
func (cacher *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherMock) UnRegisterHandler ¶
func (cacher *CacherMock) UnRegisterHandler(string)
UnRegisterHandler -
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}, sizeInBytes int) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}, sizeInBytes int) (has, added bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte, value interface{})) UnRegisterHandlerCalled func(id string) }
CacherStub -
func (*CacherStub) Get ¶
func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
Get -
func (*CacherStub) HasOrAdd ¶
func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cacher *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherStub) UnRegisterHandler ¶
func (cacher *CacherStub) UnRegisterHandler(id string)
UnRegisterHandler -
type PeerHonestyHandlerStub ¶
PeerHonestyHandlerStub -
func (*PeerHonestyHandlerStub) ChangeScore ¶
func (phhs *PeerHonestyHandlerStub) ChangeScore(pk string, topic string, units int)
ChangeScore -
func (*PeerHonestyHandlerStub) IsInterfaceNil ¶
func (phhs *PeerHonestyHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type PoolsHolderMock ¶
type PoolsHolderMock struct {
// contains filtered or unexported fields
}
PoolsHolderMock -
func (*PoolsHolderMock) CurrentBlockTxs ¶
func (holder *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderMock) Headers ¶
func (holder *PoolsHolderMock) Headers() dataRetriever.HeadersPool
Headers -
func (*PoolsHolderMock) IsInterfaceNil ¶
func (holder *PoolsHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderMock) MiniBlocks ¶
func (holder *PoolsHolderMock) MiniBlocks() storage.Cacher
MiniBlocks -
func (*PoolsHolderMock) PeerChangesBlocks ¶
func (holder *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderMock) RewardTransactions ¶
func (holder *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderMock) SetTransactions ¶
func (holder *PoolsHolderMock) SetTransactions(pool dataRetriever.ShardedDataCacherNotifier)
SetTransactions -
func (*PoolsHolderMock) SetUnsignedTransactions ¶
func (holder *PoolsHolderMock) SetUnsignedTransactions(pool dataRetriever.ShardedDataCacherNotifier)
SetUnsignedTransactions -
func (*PoolsHolderMock) Transactions ¶
func (holder *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderMock) TrieNodes ¶
func (holder *PoolsHolderMock) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderMock) UnsignedTransactions ¶
func (holder *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type PoolsHolderStub ¶
type PoolsHolderStub struct { HeadersCalled func() dataRetriever.HeadersPool TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier RewardTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier MiniBlocksCalled func() storage.Cacher MetaBlocksCalled func() storage.Cacher CurrBlockTxsCalled func() dataRetriever.TransactionCacher TrieNodesCalled func() storage.Cacher PeerChangesBlocksCalled func() storage.Cacher }
PoolsHolderStub -
func (*PoolsHolderStub) CurrentBlockTxs ¶
func (holder *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderStub) Headers ¶
func (holder *PoolsHolderStub) Headers() dataRetriever.HeadersPool
Headers -
func (*PoolsHolderStub) IsInterfaceNil ¶
func (holder *PoolsHolderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderStub) MetaBlocks ¶
func (holder *PoolsHolderStub) MetaBlocks() storage.Cacher
MetaBlocks -
func (*PoolsHolderStub) MiniBlocks ¶
func (holder *PoolsHolderStub) MiniBlocks() storage.Cacher
MiniBlocks -
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (holder *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderStub) RewardTransactions ¶
func (holder *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderStub) Transactions ¶
func (holder *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderStub) TrieNodes ¶
func (holder *PoolsHolderStub) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderStub) UnsignedTransactions ¶
func (holder *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type ProtoMarshalizerMock ¶
type ProtoMarshalizerMock struct { }
ProtoMarshalizerMock implements marshaling with protobuf
func (*ProtoMarshalizerMock) IsInterfaceNil ¶
func (pmm *ProtoMarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ProtoMarshalizerMock) Marshal ¶
func (pmm *ProtoMarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal does the actual serialization of an object The object to be serialized must implement the gogoProtoObj interface
func (*ProtoMarshalizerMock) Unmarshal ¶
func (pmm *ProtoMarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal does the actual deserialization of an object The object to be deserialized must implement the gogoProtoObj interface
type ShardedDataStub ¶
type ShardedDataStub struct { RegisterOnAddedCalled func(func(key []byte, value interface{})) ShardDataStoreCalled func(cacheID string) storage.Cacher AddDataCalled func(key []byte, data interface{}, sizeInBytes int, cacheID string) SearchFirstDataCalled func(key []byte) (value interface{}, ok bool) RemoveDataCalled func(key []byte, cacheID string) RemoveDataFromAllShardsCalled func(key []byte) MergeShardStoresCalled func(sourceCacheID, destCacheID string) MoveDataCalled func(sourceCacheID, destCacheID string, key [][]byte) ClearCalled func() ClearShardStoreCalled func(cacheID string) RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheID string) ImmunizeSetOfDataAgainstEvictionCalled func(keys [][]byte, cacheID string) CreateShardStoreCalled func(destCacheID string) GetCountsCalled func() counting.CountsWithSize }
ShardedDataStub -
func (*ShardedDataStub) AddData ¶
func (shardedData *ShardedDataStub) AddData(key []byte, data interface{}, sizeInBytes int, cacheID string)
AddData -
func (*ShardedDataStub) ClearShardStore ¶
func (shardedData *ShardedDataStub) ClearShardStore(cacheID string)
ClearShardStore -
func (*ShardedDataStub) GetCounts ¶
func (sd *ShardedDataStub) GetCounts() counting.CountsWithSize
GetCounts -
func (*ShardedDataStub) ImmunizeSetOfDataAgainstEviction ¶
func (shardedData *ShardedDataStub) ImmunizeSetOfDataAgainstEviction(keys [][]byte, cacheID string)
ImmunizeSetOfDataAgainstEviction -
func (*ShardedDataStub) IsInterfaceNil ¶
func (shardedData *ShardedDataStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardedDataStub) MergeShardStores ¶
func (shardedData *ShardedDataStub) MergeShardStores(sourceCacheID, destCacheID string)
MergeShardStores -
func (*ShardedDataStub) RegisterOnAdded ¶ added in v1.0.137
func (shardedData *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{}))
RegisterOnAdded -
func (*ShardedDataStub) RemoveData ¶
func (shardedData *ShardedDataStub) RemoveData(key []byte, cacheID string)
RemoveData -
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (shardedData *ShardedDataStub) RemoveDataFromAllShards(key []byte)
RemoveDataFromAllShards -
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (shardedData *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheID string)
RemoveSetOfDataFromPool -
func (*ShardedDataStub) SearchFirstData ¶
func (shardedData *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
SearchFirstData -
func (*ShardedDataStub) ShardDataStore ¶
func (shardedData *ShardedDataStub) ShardDataStore(cacheID string) storage.Cacher
ShardDataStore -