mock

package
v1.2.35-indexer1.1.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdaptedSizedLruCacheStub added in v1.2.4

type AdaptedSizedLruCacheStub struct {
	AddSizedCalled                 func(key, value interface{}, sizeInBytes int64) bool
	GetCalled                      func(key interface{}) (value interface{}, ok bool)
	ContainsCalled                 func(key interface{}) (ok bool)
	AddSizedIfMissingCalled        func(key, value interface{}, sizeInBytes int64) (ok, evicted bool)
	PeekCalled                     func(key interface{}) (value interface{}, ok bool)
	RemoveCalled                   func(key interface{}) bool
	KeysCalled                     func() []interface{}
	LenCalled                      func() int
	SizeInBytesContainedCalled     func() uint64
	PurgeCalled                    func()
	AddSizedAndReturnEvictedCalled func(key, value interface{}, sizeInBytes int64) map[interface{}]interface{}
}

AdaptedSizedLruCacheStub --

func (*AdaptedSizedLruCacheStub) AddSized added in v1.2.4

func (a *AdaptedSizedLruCacheStub) AddSized(key, value interface{}, sizeInBytes int64) bool

AddSized -

func (*AdaptedSizedLruCacheStub) AddSizedAndReturnEvicted added in v1.2.4

func (a *AdaptedSizedLruCacheStub) AddSizedAndReturnEvicted(key, value interface{}, sizeInBytes int64) map[interface{}]interface{}

AddSizedAndReturnEvicted -

func (*AdaptedSizedLruCacheStub) AddSizedIfMissing added in v1.2.4

func (a *AdaptedSizedLruCacheStub) AddSizedIfMissing(key, value interface{}, sizeInBytes int64) (ok, evicted bool)

AddSizedIfMissing -

func (*AdaptedSizedLruCacheStub) Contains added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Contains(key interface{}) (ok bool)

Contains -

func (*AdaptedSizedLruCacheStub) Get added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Get(key interface{}) (value interface{}, ok bool)

Get -

func (*AdaptedSizedLruCacheStub) IsInterfaceNil added in v1.2.4

func (a *AdaptedSizedLruCacheStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*AdaptedSizedLruCacheStub) Keys added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Keys() []interface{}

Keys -

func (*AdaptedSizedLruCacheStub) Len added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Len() int

Len -

func (*AdaptedSizedLruCacheStub) Peek added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Peek(key interface{}) (value interface{}, ok bool)

Peek -

func (*AdaptedSizedLruCacheStub) Purge added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Purge()

Purge -

func (*AdaptedSizedLruCacheStub) Remove added in v1.2.4

func (a *AdaptedSizedLruCacheStub) Remove(key interface{}) bool

Remove -

func (*AdaptedSizedLruCacheStub) SizeInBytesContained added in v1.2.4

func (a *AdaptedSizedLruCacheStub) SizeInBytesContained() uint64

SizeInBytesContained -

type BootStrapDataProviderStub added in v1.0.111

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 added in v1.0.111

GetStorer -

func (*BootStrapDataProviderStub) IsInterfaceNil added in v1.0.111

func (b *BootStrapDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BootStrapDataProviderStub) LoadForPath added in v1.0.111

LoadForPath -

type DirectoryReaderStub added in v1.0.111

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 added in v1.0.111

func (d *DirectoryReaderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*DirectoryReaderStub) ListAllAsString added in v1.0.111

func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error)

ListAllAsString -

func (*DirectoryReaderStub) ListDirectoriesAsString added in v1.0.111

func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error)

ListDirectoriesAsString -

func (*DirectoryReaderStub) ListFilesAsString added in v1.0.111

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 added in v1.0.111

type HasherMock struct {
}

HasherMock that will be used for testing

func (HasherMock) Compute added in v1.0.111

func (sha HasherMock) Compute(s string) []byte

Compute will output the SHA's equivalent of the input string

func (HasherMock) EmptyHash added in v1.0.111

func (sha HasherMock) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (HasherMock) IsInterfaceNil added in v1.0.111

func (sha HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size added in v1.0.111

func (HasherMock) Size() int

Size returns the required size in bytes

type LatestStorageDataProviderStub added in v1.0.111

type LatestStorageDataProviderStub struct {
	GetParentDirAndLastEpochCalled func() (string, uint32, error)
	GetCalled                      func() (storage.LatestDataFromStorage, error)
	GetShardsFromDirectoryCalled   func(path string) ([]string, error)
}

LatestStorageDataProviderStub -

func (*LatestStorageDataProviderStub) Get added in v1.0.111

Get -

func (*LatestStorageDataProviderStub) GetParentDirAndLastEpoch added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)

GetParentDirAndLastEpoch -

func (*LatestStorageDataProviderStub) GetShardsFromDirectory added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)

GetShardsFromDirectory -

func (*LatestStorageDataProviderStub) IsInterfaceNil added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type MarshalizerMock added in v1.0.111

type MarshalizerMock struct {
	Fail bool
}

MarshalizerMock that will be used for testing

func (*MarshalizerMock) IsInterfaceNil added in v1.0.111

func (mm *MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshalizerMock) Marshal added in v1.0.111

func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)

Marshal converts the input object in a slice of bytes

func (*MarshalizerMock) Unmarshal added in v1.0.111

func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error

Unmarshal applies the serialized values over an instantiated object

type PersisterFactoryStub

type PersisterFactoryStub struct {
	CreateCalled         func(path string) (storage.Persister, error)
	CreateDisabledCalled func() storage.Persister
}

PersisterFactoryStub -

func (*PersisterFactoryStub) Create

func (pfs *PersisterFactoryStub) Create(path string) (storage.Persister, error)

Create -

func (*PersisterFactoryStub) CreateDisabled added in v1.1.1

func (pfs *PersisterFactoryStub) CreateDisabled() storage.Persister

CreateDisabled -

func (*PersisterFactoryStub) IsInterfaceNil

func (pfs *PersisterFactoryStub) IsInterfaceNil() bool

IsInterfaceNil -

type PersisterStub added in v1.2.4

type PersisterStub struct {
	PutCalled           func(key, val []byte) error
	GetCalled           func(key []byte) ([]byte, error)
	HasCalled           func(key []byte) error
	CloseCalled         func() error
	RemoveCalled        func(key []byte) error
	DestroyCalled       func() error
	DestroyClosedCalled func() error
	RangeKeysCalled     func(handler func(key []byte, val []byte) bool)
}

PersisterStub -

func (*PersisterStub) Close added in v1.2.4

func (p *PersisterStub) Close() error

Close -

func (*PersisterStub) Destroy added in v1.2.4

func (p *PersisterStub) Destroy() error

Destroy -

func (*PersisterStub) DestroyClosed added in v1.2.4

func (p *PersisterStub) DestroyClosed() error

DestroyClosed -

func (*PersisterStub) Get added in v1.2.4

func (p *PersisterStub) Get(key []byte) ([]byte, error)

Get -

func (*PersisterStub) Has added in v1.2.4

func (p *PersisterStub) Has(key []byte) error

Has -

func (*PersisterStub) IsInterfaceNil added in v1.2.4

func (p *PersisterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PersisterStub) Put added in v1.2.4

func (p *PersisterStub) Put(key, val []byte) error

Put -

func (*PersisterStub) RangeKeys added in v1.2.4

func (p *PersisterStub) RangeKeys(handler func(key []byte, val []byte) bool)

RangeKeys -

func (*PersisterStub) Remove added in v1.2.4

func (p *PersisterStub) Remove(key []byte) error

Remove -

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	SelfShardId uint32
	NumShards   uint32
}

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) SelfId

func (scm *ShardCoordinatorMock) SelfId() uint32

SelfId -

func (*ShardCoordinatorMock) SetSelfShardId

func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error

SetSelfShardId -

type StorageListProviderStub added in v1.2.4

type StorageListProviderStub struct {
	GetAllStorersCalled func() map[dataRetriever.UnitType]storage.Storer
}

StorageListProviderStub -

func (*StorageListProviderStub) GetAllStorers added in v1.2.4

func (sis *StorageListProviderStub) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*StorageListProviderStub) IsInterfaceNil added in v1.2.4

func (slps *StorageListProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type TimeCacheStub added in v1.0.127

type TimeCacheStub struct {
	UpsertCalled func(key string, span time.Duration) error
	HasCalled    func(key string) bool
	SweepCalled  func()
}

TimeCacheStub -

func (*TimeCacheStub) Has added in v1.0.127

func (tcs *TimeCacheStub) Has(key string) bool

Has -

func (*TimeCacheStub) IsInterfaceNil added in v1.0.127

func (tcs *TimeCacheStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*TimeCacheStub) Sweep added in v1.0.127

func (tcs *TimeCacheStub) Sweep()

Sweep -

func (*TimeCacheStub) Upsert added in v1.0.133

func (tcs *TimeCacheStub) Upsert(key string, span time.Duration) error

Upsert -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL