Documentation ¶
Index ¶
- type BootStrapDataProviderStub
- func (b *BootStrapDataProviderStub) GetStorer(storer storage.Storer) (process.BootStorer, error)
- func (b *BootStrapDataProviderStub) IsInterfaceNil() bool
- func (b *BootStrapDataProviderStub) LoadForPath(persisterFactory storage.PersisterFactory, path string) (*bootstrapStorage.BootstrapData, storage.Storer, error)
- type DirectoryReaderStub
- func (d *DirectoryReaderStub) IsInterfaceNil() bool
- func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error)
- func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error)
- func (d *DirectoryReaderStub) ListFilesAsString(directoryPath string) ([]string, error)
- type EpochStartNotifierStub
- func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
- func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
- func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
- type HasherMock
- type LatestStorageDataProviderStub
- func (lsdps *LatestStorageDataProviderStub) Get() (storage.LatestDataFromStorage, error)
- func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)
- func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)
- func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool
- type MarshalizerMock
- type PathManagerStub
- type PersisterFactoryStub
- type ShardCoordinatorMock
- func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm *ShardCoordinatorMock) ComputeId(_ []byte) uint32
- func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
- func (scm *ShardCoordinatorMock) NumberOfShards() uint32
- func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool
- func (scm *ShardCoordinatorMock) SelfId() uint32
- func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) Close() error
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) (map[string][]byte, error)
- func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
- func (ss *StorerStub) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
- type TimeCacheStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootStrapDataProviderStub ¶
type BootStrapDataProviderStub struct { LoadForPathCalled func(persisterFactory storage.PersisterFactory, path string) (*bootstrapStorage.BootstrapData, storage.Storer, error) GetStorerCalled func(storer storage.Storer) (process.BootStorer, error) }
BootStrapDataProviderStub -
func (*BootStrapDataProviderStub) GetStorer ¶
func (b *BootStrapDataProviderStub) GetStorer(storer storage.Storer) (process.BootStorer, error)
GetStorer -
func (*BootStrapDataProviderStub) IsInterfaceNil ¶
func (b *BootStrapDataProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*BootStrapDataProviderStub) LoadForPath ¶
func (b *BootStrapDataProviderStub) LoadForPath(persisterFactory storage.PersisterFactory, path string) (*bootstrapStorage.BootstrapData, storage.Storer, error)
LoadForPath -
type DirectoryReaderStub ¶
type DirectoryReaderStub struct { ListFilesAsStringCalled func(directoryPath string) ([]string, error) ListDirectoriesAsStringCalled func(directoryPath string) ([]string, error) ListAllAsStringCalled func(directoryPath string) ([]string, error) }
DirectoryReaderStub -
func (*DirectoryReaderStub) IsInterfaceNil ¶
func (d *DirectoryReaderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*DirectoryReaderStub) ListAllAsString ¶
func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error)
ListAllAsString -
func (*DirectoryReaderStub) ListDirectoriesAsString ¶
func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error)
ListDirectoriesAsString -
func (*DirectoryReaderStub) ListFilesAsString ¶
func (d *DirectoryReaderStub) ListFilesAsString(directoryPath string) ([]string, error)
ListFilesAsString -
type EpochStartNotifierStub ¶
type EpochStartNotifierStub struct { RegisterHandlerCalled func(handler epochStart.ActionHandler) UnregisterHandlerCalled func(handler epochStart.ActionHandler) NotifyAllCalled func(hdr data.HeaderHandler) }
EpochStartNotifierStub -
func (*EpochStartNotifierStub) IsInterfaceNil ¶
func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartNotifierStub) NotifyAll ¶
func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
NotifyAll -
func (*EpochStartNotifierStub) RegisterHandler ¶
func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
RegisterHandler -
func (*EpochStartNotifierStub) UnregisterHandler ¶
func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
UnregisterHandler -
type HasherMock ¶
type HasherMock struct { }
HasherMock that will be used for testing
func (HasherMock) Compute ¶
func (sha HasherMock) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherMock) EmptyHash ¶
func (sha HasherMock) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (HasherMock) IsInterfaceNil ¶
func (sha HasherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type LatestStorageDataProviderStub ¶
type LatestStorageDataProviderStub struct { GetParentDirAndLastEpochCalled func() (string, uint32, error) GetCalled func() (storage.LatestDataFromStorage, error) GetShardsFromDirectoryCalled func(path string) ([]string, error) }
LatestStorageDataProviderStub -
func (*LatestStorageDataProviderStub) Get ¶
func (lsdps *LatestStorageDataProviderStub) Get() (storage.LatestDataFromStorage, error)
Get -
func (*LatestStorageDataProviderStub) GetParentDirAndLastEpoch ¶
func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)
GetParentDirAndLastEpoch -
func (*LatestStorageDataProviderStub) GetShardsFromDirectory ¶
func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)
GetShardsFromDirectory -
func (*LatestStorageDataProviderStub) IsInterfaceNil ¶
func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
type MarshalizerMock ¶
type MarshalizerMock struct {
Fail bool
}
MarshalizerMock that will be used for testing
func (*MarshalizerMock) IsInterfaceNil ¶
func (mm *MarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerMock) Marshal ¶
func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerMock) Unmarshal ¶
func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type PathManagerStub ¶
type PathManagerStub struct { PathForEpochCalled func(shardId string, epoch uint32, identifier string) string PathForStaticCalled func(shardId string, identifier string) string }
PathManagerStub -
func (*PathManagerStub) IsInterfaceNil ¶
func (p *PathManagerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PathManagerStub) PathForEpoch ¶
func (p *PathManagerStub) PathForEpoch(shardId string, epoch uint32, identifier string) string
PathForEpoch -
func (*PathManagerStub) PathForStatic ¶
func (p *PathManagerStub) PathForStatic(shardId string, identifier string) string
PathForStatic -
type PersisterFactoryStub ¶
PersisterFactoryStub -
func (*PersisterFactoryStub) Create ¶
func (pfs *PersisterFactoryStub) Create(path string) (storage.Persister, error)
Create -
func (*PersisterFactoryStub) IsInterfaceNil ¶
func (pfs *PersisterFactoryStub) IsInterfaceNil() bool
IsInterfaceNil -
type ShardCoordinatorMock ¶
ShardCoordinatorMock -
func NewShardCoordinatorMock ¶
func NewShardCoordinatorMock(selfShardID uint32, numShards uint32) *ShardCoordinatorMock
NewShardCoordinatorMock -
func (*ShardCoordinatorMock) CommunicationIdentifier ¶
func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (*ShardCoordinatorMock) ComputeId ¶
func (scm *ShardCoordinatorMock) ComputeId(_ []byte) uint32
ComputeId -
func (*ShardCoordinatorMock) IsInterfaceNil ¶
func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardCoordinatorMock) NumberOfShards ¶
func (scm *ShardCoordinatorMock) NumberOfShards() uint32
NumberOfShards -
func (*ShardCoordinatorMock) SameShard ¶
func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool
SameShard -
func (*ShardCoordinatorMock) SetSelfShardId ¶
func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
SetSelfShardId -
type StorerStub ¶
type StorerStub struct { PutCalled func(key, data []byte) error GetCalled func(key []byte) ([]byte, error) GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error) HasCalled func(key []byte) error HasInEpochCalled func(key []byte, epoch uint32) error SearchFirstCalled func(key []byte) ([]byte, error) RemoveCalled func(key []byte) error ClearCacheCalled func() RangeKeysCalled func(handler func(key []byte, val []byte) bool) DestroyUnitCalled func() error GetBulkFromEpochCalled func(keys [][]byte, epoch uint32) (map[string][]byte, error) }
StorerStub -
func (*StorerStub) GetBulkFromEpoch ¶ added in v0.0.2
GetBulkFromEpoch -
func (*StorerStub) GetFromEpoch ¶
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
GetFromEpoch -
func (*StorerStub) HasInEpoch ¶
func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerStub) IsInterfaceNil ¶
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) RangeKeys ¶ added in v0.0.2
func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
RangeKeys -
func (*StorerStub) SearchFirst ¶
func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type TimeCacheStub ¶
type TimeCacheStub struct { UpsertCalled func(key string, span time.Duration) error HasCalled func(key string) bool SweepCalled func() }
TimeCacheStub -
func (*TimeCacheStub) IsInterfaceNil ¶
func (tcs *TimeCacheStub) IsInterfaceNil() bool
IsInterfaceNil -