storage

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package storage contains ledger storage implementation on top of BadgerDB engine.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrConflictRetriesOver is returned if Update transaction fails on all retry attempts.
	ErrConflictRetriesOver = errors.New("transaction conflict retries limit exceeded")

	// ErrConflict is the alias for badger.ErrConflict.
	ErrConflict = badger.ErrConflict

	// ErrOverride is returned if something tries to update existing record.
	ErrOverride = errors.New("records override is forbidden")

	// ErrClosed is returned when attempt to read or write to closed db.
	ErrClosed = errors.New("db is closed")

	// ErrPrevPulse is returned if previous pulse not found in storage
	ErrPrevPulse = errors.New("previous pulse not found")

	// ErrBadPulse is returned when pulse less than latest
	ErrBadPulse = errors.New("pulse should be bigger than latest")
)
View Source
var ErrReplicatorDone = errors.New("no more items in iterator")

ErrReplicatorDone is returned by an Replicator NextRecords method when the iteration is complete.

Functions

func NullifyJetInKey added in v0.7.5

func NullifyJetInKey(key []byte)

NullifyJetInKey nullify jet part in record.

Types

type Cleaner added in v0.7.5

type Cleaner interface {
	CleanJetRecordsUntilPulse(
		ctx context.Context,
		jetID core.RecordID,
		pn core.PulseNumber,
	) (map[string]RmStat, error)

	CleanJetIndexes(
		ctx context.Context,
		jetID core.RecordID,
		recent recentstorage.RecentIndexStorage,
		candidates []core.RecordID,
	) (RmStat, error)
}

Cleaner cleans lights after sync to heavy

func NewCleaner added in v0.8.0

func NewCleaner() Cleaner

NewCleaner is a constructor for Cleaner.

type CleanerMock added in v0.7.5

type CleanerMock struct {
	CleanJetIndexesFunc       func(p context.Context, p1 core.RecordID, p2 recentstorage.RecentIndexStorage, p3 []core.RecordID) (r RmStat, r1 error)
	CleanJetIndexesCounter    uint64
	CleanJetIndexesPreCounter uint64
	CleanJetIndexesMock       mCleanerMockCleanJetIndexes

	CleanJetRecordsUntilPulseFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r map[string]RmStat, r1 error)
	CleanJetRecordsUntilPulseCounter    uint64
	CleanJetRecordsUntilPulsePreCounter uint64
	CleanJetRecordsUntilPulseMock       mCleanerMockCleanJetRecordsUntilPulse
	// contains filtered or unexported fields
}

CleanerMock implements github.com/insolar/insolar/ledger/storage.Cleaner

func NewCleanerMock added in v0.7.5

func NewCleanerMock(t minimock.Tester) *CleanerMock

NewCleanerMock returns a mock for github.com/insolar/insolar/ledger/storage.Cleaner

func (*CleanerMock) AllMocksCalled added in v0.7.5

func (m *CleanerMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*CleanerMock) CheckMocksCalled added in v0.7.5

func (m *CleanerMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*CleanerMock) CleanJetIndexes added in v0.8.0

func (m *CleanerMock) CleanJetIndexes(p context.Context, p1 core.RecordID, p2 recentstorage.RecentIndexStorage, p3 []core.RecordID) (r RmStat, r1 error)

CleanJetIndexes implements github.com/insolar/insolar/ledger/storage.Cleaner interface

func (*CleanerMock) CleanJetIndexesFinished added in v0.8.0

func (m *CleanerMock) CleanJetIndexesFinished() bool

CleanJetIndexesFinished returns true if mock invocations count is ok

func (*CleanerMock) CleanJetIndexesMinimockCounter added in v0.8.0

func (m *CleanerMock) CleanJetIndexesMinimockCounter() uint64

CleanJetIndexesMinimockCounter returns a count of CleanerMock.CleanJetIndexesFunc invocations

func (*CleanerMock) CleanJetIndexesMinimockPreCounter added in v0.8.0

func (m *CleanerMock) CleanJetIndexesMinimockPreCounter() uint64

CleanJetIndexesMinimockPreCounter returns the value of CleanerMock.CleanJetIndexes invocations

func (*CleanerMock) CleanJetRecordsUntilPulse added in v0.8.0

func (m *CleanerMock) CleanJetRecordsUntilPulse(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r map[string]RmStat, r1 error)

CleanJetRecordsUntilPulse implements github.com/insolar/insolar/ledger/storage.Cleaner interface

func (*CleanerMock) CleanJetRecordsUntilPulseFinished added in v0.8.0

func (m *CleanerMock) CleanJetRecordsUntilPulseFinished() bool

CleanJetRecordsUntilPulseFinished returns true if mock invocations count is ok

func (*CleanerMock) CleanJetRecordsUntilPulseMinimockCounter added in v0.8.0

func (m *CleanerMock) CleanJetRecordsUntilPulseMinimockCounter() uint64

CleanJetRecordsUntilPulseMinimockCounter returns a count of CleanerMock.CleanJetRecordsUntilPulseFunc invocations

func (*CleanerMock) CleanJetRecordsUntilPulseMinimockPreCounter added in v0.8.0

func (m *CleanerMock) CleanJetRecordsUntilPulseMinimockPreCounter() uint64

CleanJetRecordsUntilPulseMinimockPreCounter returns the value of CleanerMock.CleanJetRecordsUntilPulse invocations

func (*CleanerMock) Finish added in v0.7.5

func (m *CleanerMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*CleanerMock) MinimockFinish added in v0.7.5

func (m *CleanerMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*CleanerMock) MinimockWait added in v0.7.5

func (m *CleanerMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*CleanerMock) ValidateCallCounters added in v0.7.5

func (m *CleanerMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*CleanerMock) Wait added in v0.7.5

func (m *CleanerMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type CleanerMockCleanJetIndexesExpectation added in v0.8.0

type CleanerMockCleanJetIndexesExpectation struct {
	// contains filtered or unexported fields
}

func (*CleanerMockCleanJetIndexesExpectation) Return added in v0.8.0

type CleanerMockCleanJetIndexesInput added in v0.8.0

type CleanerMockCleanJetIndexesInput struct {
	// contains filtered or unexported fields
}

type CleanerMockCleanJetIndexesResult added in v0.8.0

type CleanerMockCleanJetIndexesResult struct {
	// contains filtered or unexported fields
}

type CleanerMockCleanJetRecordsUntilPulseExpectation added in v0.8.0

type CleanerMockCleanJetRecordsUntilPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*CleanerMockCleanJetRecordsUntilPulseExpectation) Return added in v0.8.0

type CleanerMockCleanJetRecordsUntilPulseInput added in v0.8.0

type CleanerMockCleanJetRecordsUntilPulseInput struct {
	// contains filtered or unexported fields
}

type CleanerMockCleanJetRecordsUntilPulseResult added in v0.8.0

type CleanerMockCleanJetRecordsUntilPulseResult struct {
	// contains filtered or unexported fields
}

type DB added in v0.0.6

type DB struct {
	PlatformCryptographyScheme core.PlatformCryptographyScheme `inject:""`
	// contains filtered or unexported fields
}

DB represents BadgerDB storage implementation.

func (*DB) BeginTransaction added in v0.0.6

func (db *DB) BeginTransaction(update bool) (*TransactionManager, error)

BeginTransaction opens a new transaction. All methods called on returned transaction manager will persist changes only after success on "Commit" call.

func (*DB) Close added in v0.0.6

func (db *DB) Close() error

Close wraps BadgerDB Close method.

From https://godoc.org/github.com/dgraph-io/badger#DB.Close: «It's crucial to call it to ensure all the pending updates make their way to disk. Calling DB.Close() multiple times is not safe and wouldcause panic.»

func (*DB) GetBadgerDB added in v0.6.1

func (db *DB) GetBadgerDB() *badger.DB

GetBadgerDB return badger.DB instance (for internal usage, like tests)

func (*DB) GetPlatformCryptographyScheme added in v0.8.0

func (db *DB) GetPlatformCryptographyScheme() core.PlatformCryptographyScheme

func (*DB) IterateRecordsOnPulse added in v0.7.5

func (db *DB) IterateRecordsOnPulse(
	ctx context.Context,
	jetID core.RecordID,
	pulse core.PulseNumber,
	handler func(id core.RecordID, rec record.Record) error,
) error

IterateRecordsOnPulse iterates over records on provided Jet ID and Pulse.

func (*DB) Stop added in v0.6.3

func (db *DB) Stop(ctx context.Context) error

Stop stops DB component.

func (*DB) StoreKeyValues added in v0.6.3

func (db *DB) StoreKeyValues(ctx context.Context, kvs []core.KV) error

StoreKeyValues stores provided key/value pairs.

func (*DB) Update added in v0.0.6

func (db *DB) Update(ctx context.Context, fn func(*TransactionManager) error) error

Update accepts transaction function and commits changes. All calls to received transaction manager will be consistent and written tp disk or an error will be returned.

func (*DB) View added in v0.0.6

func (db *DB) View(ctx context.Context, fn func(*TransactionManager) error) error

View accepts transaction function. All calls to received transaction manager will be consistent.

type DBContext added in v0.7.5

type DBContext interface {
	BeginTransaction(update bool) (*TransactionManager, error)
	View(ctx context.Context, fn func(*TransactionManager) error) error
	Update(ctx context.Context, fn func(*TransactionManager) error) error

	IterateRecordsOnPulse(
		ctx context.Context,
		jetID core.RecordID,
		pulse core.PulseNumber,
		handler func(id core.RecordID, rec record.Record) error,
	) error

	StoreKeyValues(ctx context.Context, kvs []core.KV) error

	GetBadgerDB() *badger.DB

	Close() error
	// contains filtered or unexported methods
}

DBContext provides base db methods

func NewDB added in v0.0.6

func NewDB(conf configuration.Ledger, opts *badger.Options) (DBContext, error)

NewDB returns storage.DB with BadgerDB instance initialized by opts. Creates database in provided dir or in current directory if dir parameter is empty.

type DBContextMock added in v0.7.5

type DBContextMock struct {
	BeginTransactionFunc       func(p bool) (r *TransactionManager, r1 error)
	BeginTransactionCounter    uint64
	BeginTransactionPreCounter uint64
	BeginTransactionMock       mDBContextMockBeginTransaction

	CloseFunc       func() (r error)
	CloseCounter    uint64
	ClosePreCounter uint64
	CloseMock       mDBContextMockClose

	GetBadgerDBFunc       func() (r *badger.DB)
	GetBadgerDBCounter    uint64
	GetBadgerDBPreCounter uint64
	GetBadgerDBMock       mDBContextMockGetBadgerDB

	IterateRecordsOnPulseFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 func(p core.RecordID, p1 record.Record) (r error)) (r error)
	IterateRecordsOnPulseCounter    uint64
	IterateRecordsOnPulsePreCounter uint64
	IterateRecordsOnPulseMock       mDBContextMockIterateRecordsOnPulse

	StoreKeyValuesFunc       func(p context.Context, p1 []core.KV) (r error)
	StoreKeyValuesCounter    uint64
	StoreKeyValuesPreCounter uint64
	StoreKeyValuesMock       mDBContextMockStoreKeyValues

	UpdateFunc       func(p context.Context, p1 func(p *TransactionManager) (r error)) (r error)
	UpdateCounter    uint64
	UpdatePreCounter uint64
	UpdateMock       mDBContextMockUpdate

	ViewFunc       func(p context.Context, p1 func(p *TransactionManager) (r error)) (r error)
	ViewCounter    uint64
	ViewPreCounter uint64
	ViewMock       mDBContextMockView
	// contains filtered or unexported fields
}

DBContextMock implements github.com/insolar/insolar/ledger/storage.DBContext

func NewDBContextMock added in v0.7.5

func NewDBContextMock(t minimock.Tester) *DBContextMock

NewDBContextMock returns a mock for github.com/insolar/insolar/ledger/storage.DBContext

func (*DBContextMock) AllMocksCalled added in v0.7.5

func (m *DBContextMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*DBContextMock) BeginTransaction added in v0.7.5

func (m *DBContextMock) BeginTransaction(p bool) (r *TransactionManager, r1 error)

BeginTransaction implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) BeginTransactionFinished added in v0.7.5

func (m *DBContextMock) BeginTransactionFinished() bool

BeginTransactionFinished returns true if mock invocations count is ok

func (*DBContextMock) BeginTransactionMinimockCounter added in v0.7.5

func (m *DBContextMock) BeginTransactionMinimockCounter() uint64

BeginTransactionMinimockCounter returns a count of DBContextMock.BeginTransactionFunc invocations

func (*DBContextMock) BeginTransactionMinimockPreCounter added in v0.7.5

func (m *DBContextMock) BeginTransactionMinimockPreCounter() uint64

BeginTransactionMinimockPreCounter returns the value of DBContextMock.BeginTransaction invocations

func (*DBContextMock) CheckMocksCalled added in v0.7.5

func (m *DBContextMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*DBContextMock) Close added in v0.7.5

func (m *DBContextMock) Close() (r error)

Close implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) CloseFinished added in v0.7.5

func (m *DBContextMock) CloseFinished() bool

CloseFinished returns true if mock invocations count is ok

func (*DBContextMock) CloseMinimockCounter added in v0.7.5

func (m *DBContextMock) CloseMinimockCounter() uint64

CloseMinimockCounter returns a count of DBContextMock.CloseFunc invocations

func (*DBContextMock) CloseMinimockPreCounter added in v0.7.5

func (m *DBContextMock) CloseMinimockPreCounter() uint64

CloseMinimockPreCounter returns the value of DBContextMock.Close invocations

func (*DBContextMock) Finish added in v0.7.5

func (m *DBContextMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*DBContextMock) GetBadgerDB added in v0.7.5

func (m *DBContextMock) GetBadgerDB() (r *badger.DB)

GetBadgerDB implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) GetBadgerDBFinished added in v0.7.5

func (m *DBContextMock) GetBadgerDBFinished() bool

GetBadgerDBFinished returns true if mock invocations count is ok

func (*DBContextMock) GetBadgerDBMinimockCounter added in v0.7.5

func (m *DBContextMock) GetBadgerDBMinimockCounter() uint64

GetBadgerDBMinimockCounter returns a count of DBContextMock.GetBadgerDBFunc invocations

func (*DBContextMock) GetBadgerDBMinimockPreCounter added in v0.7.5

func (m *DBContextMock) GetBadgerDBMinimockPreCounter() uint64

GetBadgerDBMinimockPreCounter returns the value of DBContextMock.GetBadgerDB invocations

func (*DBContextMock) IterateRecordsOnPulse added in v0.8.0

func (m *DBContextMock) IterateRecordsOnPulse(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 func(p core.RecordID, p1 record.Record) (r error)) (r error)

IterateRecordsOnPulse implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) IterateRecordsOnPulseFinished added in v0.8.0

func (m *DBContextMock) IterateRecordsOnPulseFinished() bool

IterateRecordsOnPulseFinished returns true if mock invocations count is ok

func (*DBContextMock) IterateRecordsOnPulseMinimockCounter added in v0.8.0

func (m *DBContextMock) IterateRecordsOnPulseMinimockCounter() uint64

IterateRecordsOnPulseMinimockCounter returns a count of DBContextMock.IterateRecordsOnPulseFunc invocations

func (*DBContextMock) IterateRecordsOnPulseMinimockPreCounter added in v0.8.0

func (m *DBContextMock) IterateRecordsOnPulseMinimockPreCounter() uint64

IterateRecordsOnPulseMinimockPreCounter returns the value of DBContextMock.IterateRecordsOnPulse invocations

func (*DBContextMock) MinimockFinish added in v0.7.5

func (m *DBContextMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*DBContextMock) MinimockWait added in v0.7.5

func (m *DBContextMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*DBContextMock) StoreKeyValues added in v0.7.5

func (m *DBContextMock) StoreKeyValues(p context.Context, p1 []core.KV) (r error)

StoreKeyValues implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) StoreKeyValuesFinished added in v0.7.5

func (m *DBContextMock) StoreKeyValuesFinished() bool

StoreKeyValuesFinished returns true if mock invocations count is ok

func (*DBContextMock) StoreKeyValuesMinimockCounter added in v0.7.5

func (m *DBContextMock) StoreKeyValuesMinimockCounter() uint64

StoreKeyValuesMinimockCounter returns a count of DBContextMock.StoreKeyValuesFunc invocations

func (*DBContextMock) StoreKeyValuesMinimockPreCounter added in v0.7.5

func (m *DBContextMock) StoreKeyValuesMinimockPreCounter() uint64

StoreKeyValuesMinimockPreCounter returns the value of DBContextMock.StoreKeyValues invocations

func (*DBContextMock) Update added in v0.7.5

func (m *DBContextMock) Update(p context.Context, p1 func(p *TransactionManager) (r error)) (r error)

Update implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) UpdateFinished added in v0.7.5

func (m *DBContextMock) UpdateFinished() bool

UpdateFinished returns true if mock invocations count is ok

func (*DBContextMock) UpdateMinimockCounter added in v0.7.5

func (m *DBContextMock) UpdateMinimockCounter() uint64

UpdateMinimockCounter returns a count of DBContextMock.UpdateFunc invocations

func (*DBContextMock) UpdateMinimockPreCounter added in v0.7.5

func (m *DBContextMock) UpdateMinimockPreCounter() uint64

UpdateMinimockPreCounter returns the value of DBContextMock.Update invocations

func (*DBContextMock) ValidateCallCounters added in v0.7.5

func (m *DBContextMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*DBContextMock) View added in v0.7.5

func (m *DBContextMock) View(p context.Context, p1 func(p *TransactionManager) (r error)) (r error)

View implements github.com/insolar/insolar/ledger/storage.DBContext interface

func (*DBContextMock) ViewFinished added in v0.7.5

func (m *DBContextMock) ViewFinished() bool

ViewFinished returns true if mock invocations count is ok

func (*DBContextMock) ViewMinimockCounter added in v0.7.5

func (m *DBContextMock) ViewMinimockCounter() uint64

ViewMinimockCounter returns a count of DBContextMock.ViewFunc invocations

func (*DBContextMock) ViewMinimockPreCounter added in v0.7.5

func (m *DBContextMock) ViewMinimockPreCounter() uint64

ViewMinimockPreCounter returns the value of DBContextMock.View invocations

func (*DBContextMock) Wait added in v0.7.5

func (m *DBContextMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type DBContextMockBeginTransactionExpectation added in v0.7.5

type DBContextMockBeginTransactionExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockBeginTransactionExpectation) Return added in v0.7.5

type DBContextMockBeginTransactionInput added in v0.7.5

type DBContextMockBeginTransactionInput struct {
	// contains filtered or unexported fields
}

type DBContextMockBeginTransactionResult added in v0.7.5

type DBContextMockBeginTransactionResult struct {
	// contains filtered or unexported fields
}

type DBContextMockCloseExpectation added in v0.7.5

type DBContextMockCloseExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockCloseExpectation) Return added in v0.7.5

func (e *DBContextMockCloseExpectation) Return(r error)

type DBContextMockCloseResult added in v0.7.5

type DBContextMockCloseResult struct {
	// contains filtered or unexported fields
}

type DBContextMockGetBadgerDBExpectation added in v0.7.5

type DBContextMockGetBadgerDBExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockGetBadgerDBExpectation) Return added in v0.7.5

type DBContextMockGetBadgerDBResult added in v0.7.5

type DBContextMockGetBadgerDBResult struct {
	// contains filtered or unexported fields
}

type DBContextMockIterateRecordsOnPulseExpectation added in v0.8.0

type DBContextMockIterateRecordsOnPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockIterateRecordsOnPulseExpectation) Return added in v0.8.0

type DBContextMockIterateRecordsOnPulseInput added in v0.8.0

type DBContextMockIterateRecordsOnPulseInput struct {
	// contains filtered or unexported fields
}

type DBContextMockIterateRecordsOnPulseResult added in v0.8.0

type DBContextMockIterateRecordsOnPulseResult struct {
	// contains filtered or unexported fields
}

type DBContextMockStoreKeyValuesExpectation added in v0.7.5

type DBContextMockStoreKeyValuesExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockStoreKeyValuesExpectation) Return added in v0.7.5

type DBContextMockStoreKeyValuesInput added in v0.7.5

type DBContextMockStoreKeyValuesInput struct {
	// contains filtered or unexported fields
}

type DBContextMockStoreKeyValuesResult added in v0.7.5

type DBContextMockStoreKeyValuesResult struct {
	// contains filtered or unexported fields
}

type DBContextMockUpdateExpectation added in v0.7.5

type DBContextMockUpdateExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockUpdateExpectation) Return added in v0.7.5

type DBContextMockUpdateInput added in v0.7.5

type DBContextMockUpdateInput struct {
	// contains filtered or unexported fields
}

type DBContextMockUpdateResult added in v0.7.5

type DBContextMockUpdateResult struct {
	// contains filtered or unexported fields
}

type DBContextMockViewExpectation added in v0.7.5

type DBContextMockViewExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockViewExpectation) Return added in v0.7.5

func (e *DBContextMockViewExpectation) Return(r error)

type DBContextMockViewInput added in v0.7.5

type DBContextMockViewInput struct {
	// contains filtered or unexported fields
}

type DBContextMockViewResult added in v0.7.5

type DBContextMockViewResult struct {
	// contains filtered or unexported fields
}

type DBContextMockgetExpectation added in v0.8.0

type DBContextMockgetExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockgetExpectation) Return added in v0.8.0

func (e *DBContextMockgetExpectation) Return(r []byte, r1 error)

type DBContextMockgetInput added in v0.8.0

type DBContextMockgetInput struct {
	// contains filtered or unexported fields
}

type DBContextMockgetResult added in v0.8.0

type DBContextMockgetResult struct {
	// contains filtered or unexported fields
}

type DBContextMockiterateExpectation added in v0.8.0

type DBContextMockiterateExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMockiterateExpectation) Return added in v0.8.0

type DBContextMockiterateInput added in v0.8.0

type DBContextMockiterateInput struct {
	// contains filtered or unexported fields
}

type DBContextMockiterateResult added in v0.8.0

type DBContextMockiterateResult struct {
	// contains filtered or unexported fields
}

type DBContextMocksetExpectation added in v0.8.0

type DBContextMocksetExpectation struct {
	// contains filtered or unexported fields
}

func (*DBContextMocksetExpectation) Return added in v0.8.0

func (e *DBContextMocksetExpectation) Return(r error)

type DBContextMocksetInput added in v0.8.0

type DBContextMocksetInput struct {
	// contains filtered or unexported fields
}

type DBContextMocksetResult added in v0.8.0

type DBContextMocksetResult struct {
	// contains filtered or unexported fields
}

type DBContextMockwaitingFlightExpectation added in v0.8.0

type DBContextMockwaitingFlightExpectation struct {
}

type DropStorage added in v0.8.0

type DropStorage interface {
	CreateDrop(ctx context.Context, jetID core.RecordID, pulse core.PulseNumber, prevHash []byte) (
		*jet.JetDrop,
		[][]byte,
		uint64,
		error,
	)
	SetDrop(ctx context.Context, jetID core.RecordID, drop *jet.JetDrop) error
	GetDrop(ctx context.Context, jetID core.RecordID, pulse core.PulseNumber) (*jet.JetDrop, error)

	AddDropSize(ctx context.Context, dropSize *jet.DropSize) error
	SetDropSizeHistory(ctx context.Context, jetID core.RecordID, dropSizeHistory jet.DropSizeHistory) error
	GetDropSizeHistory(ctx context.Context, jetID core.RecordID) (jet.DropSizeHistory, error)

	GetJetSizesHistoryDepth() int
}

DropStorage jet-drops

func NewDropStorage added in v0.8.0

func NewDropStorage(jetSizesHistoryDepth int) DropStorage

type DropStorageMock added in v0.8.0

type DropStorageMock struct {
	AddDropSizeFunc       func(p context.Context, p1 *jet.DropSize) (r error)
	AddDropSizeCounter    uint64
	AddDropSizePreCounter uint64
	AddDropSizeMock       mDropStorageMockAddDropSize

	CreateDropFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 []byte) (r *jet.JetDrop, r1 [][]byte, r2 uint64, r3 error)
	CreateDropCounter    uint64
	CreateDropPreCounter uint64
	CreateDropMock       mDropStorageMockCreateDrop

	GetDropFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r *jet.JetDrop, r1 error)
	GetDropCounter    uint64
	GetDropPreCounter uint64
	GetDropMock       mDropStorageMockGetDrop

	GetDropSizeHistoryFunc       func(p context.Context, p1 core.RecordID) (r jet.DropSizeHistory, r1 error)
	GetDropSizeHistoryCounter    uint64
	GetDropSizeHistoryPreCounter uint64
	GetDropSizeHistoryMock       mDropStorageMockGetDropSizeHistory

	GetJetSizesHistoryDepthFunc       func() (r int)
	GetJetSizesHistoryDepthCounter    uint64
	GetJetSizesHistoryDepthPreCounter uint64
	GetJetSizesHistoryDepthMock       mDropStorageMockGetJetSizesHistoryDepth

	SetDropFunc       func(p context.Context, p1 core.RecordID, p2 *jet.JetDrop) (r error)
	SetDropCounter    uint64
	SetDropPreCounter uint64
	SetDropMock       mDropStorageMockSetDrop

	SetDropSizeHistoryFunc       func(p context.Context, p1 core.RecordID, p2 jet.DropSizeHistory) (r error)
	SetDropSizeHistoryCounter    uint64
	SetDropSizeHistoryPreCounter uint64
	SetDropSizeHistoryMock       mDropStorageMockSetDropSizeHistory
	// contains filtered or unexported fields
}

DropStorageMock implements github.com/insolar/insolar/ledger/storage.DropStorage

func NewDropStorageMock added in v0.8.0

func NewDropStorageMock(t minimock.Tester) *DropStorageMock

NewDropStorageMock returns a mock for github.com/insolar/insolar/ledger/storage.DropStorage

func (*DropStorageMock) AddDropSize added in v0.8.0

func (m *DropStorageMock) AddDropSize(p context.Context, p1 *jet.DropSize) (r error)

AddDropSize implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) AddDropSizeFinished added in v0.8.0

func (m *DropStorageMock) AddDropSizeFinished() bool

AddDropSizeFinished returns true if mock invocations count is ok

func (*DropStorageMock) AddDropSizeMinimockCounter added in v0.8.0

func (m *DropStorageMock) AddDropSizeMinimockCounter() uint64

AddDropSizeMinimockCounter returns a count of DropStorageMock.AddDropSizeFunc invocations

func (*DropStorageMock) AddDropSizeMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) AddDropSizeMinimockPreCounter() uint64

AddDropSizeMinimockPreCounter returns the value of DropStorageMock.AddDropSize invocations

func (*DropStorageMock) AllMocksCalled added in v0.8.0

func (m *DropStorageMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*DropStorageMock) CheckMocksCalled added in v0.8.0

func (m *DropStorageMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*DropStorageMock) CreateDrop added in v0.8.0

func (m *DropStorageMock) CreateDrop(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 []byte) (r *jet.JetDrop, r1 [][]byte, r2 uint64, r3 error)

CreateDrop implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) CreateDropFinished added in v0.8.0

func (m *DropStorageMock) CreateDropFinished() bool

CreateDropFinished returns true if mock invocations count is ok

func (*DropStorageMock) CreateDropMinimockCounter added in v0.8.0

func (m *DropStorageMock) CreateDropMinimockCounter() uint64

CreateDropMinimockCounter returns a count of DropStorageMock.CreateDropFunc invocations

func (*DropStorageMock) CreateDropMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) CreateDropMinimockPreCounter() uint64

CreateDropMinimockPreCounter returns the value of DropStorageMock.CreateDrop invocations

func (*DropStorageMock) Finish added in v0.8.0

func (m *DropStorageMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*DropStorageMock) GetDrop added in v0.8.0

func (m *DropStorageMock) GetDrop(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r *jet.JetDrop, r1 error)

GetDrop implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) GetDropFinished added in v0.8.0

func (m *DropStorageMock) GetDropFinished() bool

GetDropFinished returns true if mock invocations count is ok

func (*DropStorageMock) GetDropMinimockCounter added in v0.8.0

func (m *DropStorageMock) GetDropMinimockCounter() uint64

GetDropMinimockCounter returns a count of DropStorageMock.GetDropFunc invocations

func (*DropStorageMock) GetDropMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) GetDropMinimockPreCounter() uint64

GetDropMinimockPreCounter returns the value of DropStorageMock.GetDrop invocations

func (*DropStorageMock) GetDropSizeHistory added in v0.8.0

func (m *DropStorageMock) GetDropSizeHistory(p context.Context, p1 core.RecordID) (r jet.DropSizeHistory, r1 error)

GetDropSizeHistory implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) GetDropSizeHistoryFinished added in v0.8.0

func (m *DropStorageMock) GetDropSizeHistoryFinished() bool

GetDropSizeHistoryFinished returns true if mock invocations count is ok

func (*DropStorageMock) GetDropSizeHistoryMinimockCounter added in v0.8.0

func (m *DropStorageMock) GetDropSizeHistoryMinimockCounter() uint64

GetDropSizeHistoryMinimockCounter returns a count of DropStorageMock.GetDropSizeHistoryFunc invocations

func (*DropStorageMock) GetDropSizeHistoryMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) GetDropSizeHistoryMinimockPreCounter() uint64

GetDropSizeHistoryMinimockPreCounter returns the value of DropStorageMock.GetDropSizeHistory invocations

func (*DropStorageMock) GetJetSizesHistoryDepth added in v0.8.0

func (m *DropStorageMock) GetJetSizesHistoryDepth() (r int)

GetJetSizesHistoryDepth implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) GetJetSizesHistoryDepthFinished added in v0.8.0

func (m *DropStorageMock) GetJetSizesHistoryDepthFinished() bool

GetJetSizesHistoryDepthFinished returns true if mock invocations count is ok

func (*DropStorageMock) GetJetSizesHistoryDepthMinimockCounter added in v0.8.0

func (m *DropStorageMock) GetJetSizesHistoryDepthMinimockCounter() uint64

GetJetSizesHistoryDepthMinimockCounter returns a count of DropStorageMock.GetJetSizesHistoryDepthFunc invocations

func (*DropStorageMock) GetJetSizesHistoryDepthMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) GetJetSizesHistoryDepthMinimockPreCounter() uint64

GetJetSizesHistoryDepthMinimockPreCounter returns the value of DropStorageMock.GetJetSizesHistoryDepth invocations

func (*DropStorageMock) MinimockFinish added in v0.8.0

func (m *DropStorageMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*DropStorageMock) MinimockWait added in v0.8.0

func (m *DropStorageMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*DropStorageMock) SetDrop added in v0.8.0

func (m *DropStorageMock) SetDrop(p context.Context, p1 core.RecordID, p2 *jet.JetDrop) (r error)

SetDrop implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) SetDropFinished added in v0.8.0

func (m *DropStorageMock) SetDropFinished() bool

SetDropFinished returns true if mock invocations count is ok

func (*DropStorageMock) SetDropMinimockCounter added in v0.8.0

func (m *DropStorageMock) SetDropMinimockCounter() uint64

SetDropMinimockCounter returns a count of DropStorageMock.SetDropFunc invocations

func (*DropStorageMock) SetDropMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) SetDropMinimockPreCounter() uint64

SetDropMinimockPreCounter returns the value of DropStorageMock.SetDrop invocations

func (*DropStorageMock) SetDropSizeHistory added in v0.8.0

func (m *DropStorageMock) SetDropSizeHistory(p context.Context, p1 core.RecordID, p2 jet.DropSizeHistory) (r error)

SetDropSizeHistory implements github.com/insolar/insolar/ledger/storage.DropStorage interface

func (*DropStorageMock) SetDropSizeHistoryFinished added in v0.8.0

func (m *DropStorageMock) SetDropSizeHistoryFinished() bool

SetDropSizeHistoryFinished returns true if mock invocations count is ok

func (*DropStorageMock) SetDropSizeHistoryMinimockCounter added in v0.8.0

func (m *DropStorageMock) SetDropSizeHistoryMinimockCounter() uint64

SetDropSizeHistoryMinimockCounter returns a count of DropStorageMock.SetDropSizeHistoryFunc invocations

func (*DropStorageMock) SetDropSizeHistoryMinimockPreCounter added in v0.8.0

func (m *DropStorageMock) SetDropSizeHistoryMinimockPreCounter() uint64

SetDropSizeHistoryMinimockPreCounter returns the value of DropStorageMock.SetDropSizeHistory invocations

func (*DropStorageMock) ValidateCallCounters added in v0.8.0

func (m *DropStorageMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*DropStorageMock) Wait added in v0.8.0

func (m *DropStorageMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type DropStorageMockAddDropSizeExpectation added in v0.8.0

type DropStorageMockAddDropSizeExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockAddDropSizeExpectation) Return added in v0.8.0

type DropStorageMockAddDropSizeInput added in v0.8.0

type DropStorageMockAddDropSizeInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockAddDropSizeResult added in v0.8.0

type DropStorageMockAddDropSizeResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockCreateDropExpectation added in v0.8.0

type DropStorageMockCreateDropExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockCreateDropExpectation) Return added in v0.8.0

func (e *DropStorageMockCreateDropExpectation) Return(r *jet.JetDrop, r1 [][]byte, r2 uint64, r3 error)

type DropStorageMockCreateDropInput added in v0.8.0

type DropStorageMockCreateDropInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockCreateDropResult added in v0.8.0

type DropStorageMockCreateDropResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockGetDropExpectation added in v0.8.0

type DropStorageMockGetDropExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockGetDropExpectation) Return added in v0.8.0

type DropStorageMockGetDropInput added in v0.8.0

type DropStorageMockGetDropInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockGetDropResult added in v0.8.0

type DropStorageMockGetDropResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockGetDropSizeHistoryExpectation added in v0.8.0

type DropStorageMockGetDropSizeHistoryExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockGetDropSizeHistoryExpectation) Return added in v0.8.0

type DropStorageMockGetDropSizeHistoryInput added in v0.8.0

type DropStorageMockGetDropSizeHistoryInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockGetDropSizeHistoryResult added in v0.8.0

type DropStorageMockGetDropSizeHistoryResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockGetJetSizesHistoryDepthExpectation added in v0.8.0

type DropStorageMockGetJetSizesHistoryDepthExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockGetJetSizesHistoryDepthExpectation) Return added in v0.8.0

type DropStorageMockGetJetSizesHistoryDepthResult added in v0.8.0

type DropStorageMockGetJetSizesHistoryDepthResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockSetDropExpectation added in v0.8.0

type DropStorageMockSetDropExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockSetDropExpectation) Return added in v0.8.0

type DropStorageMockSetDropInput added in v0.8.0

type DropStorageMockSetDropInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockSetDropResult added in v0.8.0

type DropStorageMockSetDropResult struct {
	// contains filtered or unexported fields
}

type DropStorageMockSetDropSizeHistoryExpectation added in v0.8.0

type DropStorageMockSetDropSizeHistoryExpectation struct {
	// contains filtered or unexported fields
}

func (*DropStorageMockSetDropSizeHistoryExpectation) Return added in v0.8.0

type DropStorageMockSetDropSizeHistoryInput added in v0.8.0

type DropStorageMockSetDropSizeHistoryInput struct {
	// contains filtered or unexported fields
}

type DropStorageMockSetDropSizeHistoryResult added in v0.8.0

type DropStorageMockSetDropSizeHistoryResult struct {
	// contains filtered or unexported fields
}

type GenesisState added in v0.8.0

type GenesisState interface {
	component.Initer
	GenesisRef() *core.RecordRef
}

func NewGenesisInitializer added in v0.8.0

func NewGenesisInitializer() GenesisState

type IDLocker added in v0.6.0

type IDLocker struct {
	// contains filtered or unexported fields
}

IDLocker provides Lock/Unlock methods per record ID.

TODO: for further optimization we could use sync.Pool for mutexes.

func NewIDLocker added in v0.6.0

func NewIDLocker() *IDLocker

NewIDLocker creates new initialized IDLocker.

func (*IDLocker) Lock added in v0.6.0

func (l *IDLocker) Lock(id *core.RecordID)

Lock locks mutex belonged to record ID. If mutex does not exist, it will be created in concurrent safe fashion.

func (*IDLocker) Unlock added in v0.6.0

func (l *IDLocker) Unlock(id *core.RecordID)

Unlock unlocks mutex belonged to record ID.

type JetStorage added in v0.7.5

type JetStorage interface {
	UpdateJetTree(ctx context.Context, pulse core.PulseNumber, setActual bool, ids ...core.RecordID)
	FindJet(ctx context.Context, pulse core.PulseNumber, id core.RecordID) (*core.RecordID, bool)
	SplitJetTree(ctx context.Context, pulse core.PulseNumber, jetID core.RecordID) (*core.RecordID, *core.RecordID, error)
	CloneJetTree(ctx context.Context, from, to core.PulseNumber) *jet.Tree
	DeleteJetTree(ctx context.Context, pulse core.PulseNumber)

	AddJets(ctx context.Context, jetIDs ...core.RecordID) error
	GetJets(ctx context.Context) (jet.IDSet, error)
}

JetStorage provides methods for working with jets

func NewJetStorage added in v0.8.0

func NewJetStorage() JetStorage

type JetStorageMock added in v0.7.5

type JetStorageMock struct {
	AddJetsFunc       func(p context.Context, p1 ...core.RecordID) (r error)
	AddJetsCounter    uint64
	AddJetsPreCounter uint64
	AddJetsMock       mJetStorageMockAddJets

	CloneJetTreeFunc       func(p context.Context, p1 core.PulseNumber, p2 core.PulseNumber) (r *jet.Tree)
	CloneJetTreeCounter    uint64
	CloneJetTreePreCounter uint64
	CloneJetTreeMock       mJetStorageMockCloneJetTree

	DeleteJetTreeFunc       func(p context.Context, p1 core.PulseNumber)
	DeleteJetTreeCounter    uint64
	DeleteJetTreePreCounter uint64
	DeleteJetTreeMock       mJetStorageMockDeleteJetTree

	FindJetFunc       func(p context.Context, p1 core.PulseNumber, p2 core.RecordID) (r *core.RecordID, r1 bool)
	FindJetCounter    uint64
	FindJetPreCounter uint64
	FindJetMock       mJetStorageMockFindJet

	GetJetsFunc       func(p context.Context) (r jet.IDSet, r1 error)
	GetJetsCounter    uint64
	GetJetsPreCounter uint64
	GetJetsMock       mJetStorageMockGetJets

	SplitJetTreeFunc       func(p context.Context, p1 core.PulseNumber, p2 core.RecordID) (r *core.RecordID, r1 *core.RecordID, r2 error)
	SplitJetTreeCounter    uint64
	SplitJetTreePreCounter uint64
	SplitJetTreeMock       mJetStorageMockSplitJetTree

	UpdateJetTreeFunc       func(p context.Context, p1 core.PulseNumber, p2 bool, p3 ...core.RecordID)
	UpdateJetTreeCounter    uint64
	UpdateJetTreePreCounter uint64
	UpdateJetTreeMock       mJetStorageMockUpdateJetTree
	// contains filtered or unexported fields
}

JetStorageMock implements github.com/insolar/insolar/ledger/storage.JetStorage

func NewJetStorageMock added in v0.7.5

func NewJetStorageMock(t minimock.Tester) *JetStorageMock

NewJetStorageMock returns a mock for github.com/insolar/insolar/ledger/storage.JetStorage

func (*JetStorageMock) AddJets added in v0.7.5

func (m *JetStorageMock) AddJets(p context.Context, p1 ...core.RecordID) (r error)

AddJets implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) AddJetsFinished added in v0.7.5

func (m *JetStorageMock) AddJetsFinished() bool

AddJetsFinished returns true if mock invocations count is ok

func (*JetStorageMock) AddJetsMinimockCounter added in v0.7.5

func (m *JetStorageMock) AddJetsMinimockCounter() uint64

AddJetsMinimockCounter returns a count of JetStorageMock.AddJetsFunc invocations

func (*JetStorageMock) AddJetsMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) AddJetsMinimockPreCounter() uint64

AddJetsMinimockPreCounter returns the value of JetStorageMock.AddJets invocations

func (*JetStorageMock) AllMocksCalled added in v0.7.5

func (m *JetStorageMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*JetStorageMock) CheckMocksCalled added in v0.7.5

func (m *JetStorageMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*JetStorageMock) CloneJetTree added in v0.7.5

func (m *JetStorageMock) CloneJetTree(p context.Context, p1 core.PulseNumber, p2 core.PulseNumber) (r *jet.Tree)

CloneJetTree implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) CloneJetTreeFinished added in v0.7.5

func (m *JetStorageMock) CloneJetTreeFinished() bool

CloneJetTreeFinished returns true if mock invocations count is ok

func (*JetStorageMock) CloneJetTreeMinimockCounter added in v0.7.5

func (m *JetStorageMock) CloneJetTreeMinimockCounter() uint64

CloneJetTreeMinimockCounter returns a count of JetStorageMock.CloneJetTreeFunc invocations

func (*JetStorageMock) CloneJetTreeMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) CloneJetTreeMinimockPreCounter() uint64

CloneJetTreeMinimockPreCounter returns the value of JetStorageMock.CloneJetTree invocations

func (*JetStorageMock) DeleteJetTree added in v0.8.0

func (m *JetStorageMock) DeleteJetTree(p context.Context, p1 core.PulseNumber)

DeleteJetTree implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) DeleteJetTreeFinished added in v0.8.0

func (m *JetStorageMock) DeleteJetTreeFinished() bool

DeleteJetTreeFinished returns true if mock invocations count is ok

func (*JetStorageMock) DeleteJetTreeMinimockCounter added in v0.8.0

func (m *JetStorageMock) DeleteJetTreeMinimockCounter() uint64

DeleteJetTreeMinimockCounter returns a count of JetStorageMock.DeleteJetTreeFunc invocations

func (*JetStorageMock) DeleteJetTreeMinimockPreCounter added in v0.8.0

func (m *JetStorageMock) DeleteJetTreeMinimockPreCounter() uint64

DeleteJetTreeMinimockPreCounter returns the value of JetStorageMock.DeleteJetTree invocations

func (*JetStorageMock) FindJet added in v0.8.0

func (m *JetStorageMock) FindJet(p context.Context, p1 core.PulseNumber, p2 core.RecordID) (r *core.RecordID, r1 bool)

FindJet implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) FindJetFinished added in v0.8.0

func (m *JetStorageMock) FindJetFinished() bool

FindJetFinished returns true if mock invocations count is ok

func (*JetStorageMock) FindJetMinimockCounter added in v0.8.0

func (m *JetStorageMock) FindJetMinimockCounter() uint64

FindJetMinimockCounter returns a count of JetStorageMock.FindJetFunc invocations

func (*JetStorageMock) FindJetMinimockPreCounter added in v0.8.0

func (m *JetStorageMock) FindJetMinimockPreCounter() uint64

FindJetMinimockPreCounter returns the value of JetStorageMock.FindJet invocations

func (*JetStorageMock) Finish added in v0.7.5

func (m *JetStorageMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*JetStorageMock) GetJets added in v0.7.5

func (m *JetStorageMock) GetJets(p context.Context) (r jet.IDSet, r1 error)

GetJets implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) GetJetsFinished added in v0.7.5

func (m *JetStorageMock) GetJetsFinished() bool

GetJetsFinished returns true if mock invocations count is ok

func (*JetStorageMock) GetJetsMinimockCounter added in v0.7.5

func (m *JetStorageMock) GetJetsMinimockCounter() uint64

GetJetsMinimockCounter returns a count of JetStorageMock.GetJetsFunc invocations

func (*JetStorageMock) GetJetsMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) GetJetsMinimockPreCounter() uint64

GetJetsMinimockPreCounter returns the value of JetStorageMock.GetJets invocations

func (*JetStorageMock) MinimockFinish added in v0.7.5

func (m *JetStorageMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*JetStorageMock) MinimockWait added in v0.7.5

func (m *JetStorageMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*JetStorageMock) SplitJetTree added in v0.7.5

func (m *JetStorageMock) SplitJetTree(p context.Context, p1 core.PulseNumber, p2 core.RecordID) (r *core.RecordID, r1 *core.RecordID, r2 error)

SplitJetTree implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) SplitJetTreeFinished added in v0.7.5

func (m *JetStorageMock) SplitJetTreeFinished() bool

SplitJetTreeFinished returns true if mock invocations count is ok

func (*JetStorageMock) SplitJetTreeMinimockCounter added in v0.7.5

func (m *JetStorageMock) SplitJetTreeMinimockCounter() uint64

SplitJetTreeMinimockCounter returns a count of JetStorageMock.SplitJetTreeFunc invocations

func (*JetStorageMock) SplitJetTreeMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) SplitJetTreeMinimockPreCounter() uint64

SplitJetTreeMinimockPreCounter returns the value of JetStorageMock.SplitJetTree invocations

func (*JetStorageMock) UpdateJetTree added in v0.7.5

func (m *JetStorageMock) UpdateJetTree(p context.Context, p1 core.PulseNumber, p2 bool, p3 ...core.RecordID)

UpdateJetTree implements github.com/insolar/insolar/ledger/storage.JetStorage interface

func (*JetStorageMock) UpdateJetTreeFinished added in v0.7.5

func (m *JetStorageMock) UpdateJetTreeFinished() bool

UpdateJetTreeFinished returns true if mock invocations count is ok

func (*JetStorageMock) UpdateJetTreeMinimockCounter added in v0.7.5

func (m *JetStorageMock) UpdateJetTreeMinimockCounter() uint64

UpdateJetTreeMinimockCounter returns a count of JetStorageMock.UpdateJetTreeFunc invocations

func (*JetStorageMock) UpdateJetTreeMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) UpdateJetTreeMinimockPreCounter() uint64

UpdateJetTreeMinimockPreCounter returns the value of JetStorageMock.UpdateJetTree invocations

func (*JetStorageMock) ValidateCallCounters added in v0.7.5

func (m *JetStorageMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*JetStorageMock) Wait added in v0.7.5

func (m *JetStorageMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type JetStorageMockAddJetsExpectation added in v0.7.5

type JetStorageMockAddJetsExpectation struct {
	// contains filtered or unexported fields
}

func (*JetStorageMockAddJetsExpectation) Return added in v0.7.5

type JetStorageMockAddJetsInput added in v0.7.5

type JetStorageMockAddJetsInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockAddJetsResult added in v0.7.5

type JetStorageMockAddJetsResult struct {
	// contains filtered or unexported fields
}

type JetStorageMockCloneJetTreeExpectation added in v0.7.5

type JetStorageMockCloneJetTreeExpectation struct {
	// contains filtered or unexported fields
}

func (*JetStorageMockCloneJetTreeExpectation) Return added in v0.7.5

type JetStorageMockCloneJetTreeInput added in v0.7.5

type JetStorageMockCloneJetTreeInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockCloneJetTreeResult added in v0.7.5

type JetStorageMockCloneJetTreeResult struct {
	// contains filtered or unexported fields
}

type JetStorageMockDeleteJetTreeExpectation added in v0.8.0

type JetStorageMockDeleteJetTreeExpectation struct {
	// contains filtered or unexported fields
}

type JetStorageMockDeleteJetTreeInput added in v0.8.0

type JetStorageMockDeleteJetTreeInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockFindJetExpectation added in v0.8.0

type JetStorageMockFindJetExpectation struct {
	// contains filtered or unexported fields
}

func (*JetStorageMockFindJetExpectation) Return added in v0.8.0

type JetStorageMockFindJetInput added in v0.8.0

type JetStorageMockFindJetInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockFindJetResult added in v0.8.0

type JetStorageMockFindJetResult struct {
	// contains filtered or unexported fields
}

type JetStorageMockGetJetsExpectation added in v0.7.5

type JetStorageMockGetJetsExpectation struct {
	// contains filtered or unexported fields
}

func (*JetStorageMockGetJetsExpectation) Return added in v0.7.5

type JetStorageMockGetJetsInput added in v0.7.5

type JetStorageMockGetJetsInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockGetJetsResult added in v0.7.5

type JetStorageMockGetJetsResult struct {
	// contains filtered or unexported fields
}

type JetStorageMockSplitJetTreeExpectation added in v0.7.5

type JetStorageMockSplitJetTreeExpectation struct {
	// contains filtered or unexported fields
}

func (*JetStorageMockSplitJetTreeExpectation) Return added in v0.7.5

type JetStorageMockSplitJetTreeInput added in v0.7.5

type JetStorageMockSplitJetTreeInput struct {
	// contains filtered or unexported fields
}

type JetStorageMockSplitJetTreeResult added in v0.7.5

type JetStorageMockSplitJetTreeResult struct {
	// contains filtered or unexported fields
}

type JetStorageMockUpdateJetTreeExpectation added in v0.7.5

type JetStorageMockUpdateJetTreeExpectation struct {
	// contains filtered or unexported fields
}

type JetStorageMockUpdateJetTreeInput added in v0.7.5

type JetStorageMockUpdateJetTreeInput struct {
	// contains filtered or unexported fields
}

type Key added in v0.7.5

type Key []byte

Key type for wrapping storage binary key.

func (Key) PulseNumber added in v0.7.5

func (b Key) PulseNumber() core.PulseNumber

PulseNumber returns pulse number for provided storage binary key.

func (Key) String added in v0.7.5

func (b Key) String() string

String string hex representation

type ObjectStorage added in v0.7.5

type ObjectStorage interface {
	GetBlob(ctx context.Context, jetID core.RecordID, id *core.RecordID) ([]byte, error)
	SetBlob(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, blob []byte) (*core.RecordID, error)

	GetRecord(ctx context.Context, jetID core.RecordID, id *core.RecordID) (record.Record, error)
	SetRecord(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, rec record.Record) (*core.RecordID, error)

	SetMessage(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, genericMessage core.Message) error

	IterateIndexIDs(
		ctx context.Context,
		jetID core.RecordID,
		handler func(id core.RecordID) error,
	) error

	GetObjectIndex(
		ctx context.Context,
		jetID core.RecordID,
		id *core.RecordID,
		forupdate bool,
	) (*index.ObjectLifeline, error)

	SetObjectIndex(
		ctx context.Context,
		jetID core.RecordID,
		id *core.RecordID,
		idx *index.ObjectLifeline,
	) error

	RemoveObjectIndex(
		ctx context.Context,
		jetID core.RecordID,
		ref *core.RecordID,
	) error
}

ObjectStorage returns objects and their meta

func NewObjectStorage added in v0.8.0

func NewObjectStorage() ObjectStorage

type ObjectStorageMock added in v0.7.5

type ObjectStorageMock struct {
	GetBlobFunc       func(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r []byte, r1 error)
	GetBlobCounter    uint64
	GetBlobPreCounter uint64
	GetBlobMock       mObjectStorageMockGetBlob

	GetObjectIndexFunc       func(p context.Context, p1 core.RecordID, p2 *core.RecordID, p3 bool) (r *index.ObjectLifeline, r1 error)
	GetObjectIndexCounter    uint64
	GetObjectIndexPreCounter uint64
	GetObjectIndexMock       mObjectStorageMockGetObjectIndex

	GetRecordFunc       func(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r record.Record, r1 error)
	GetRecordCounter    uint64
	GetRecordPreCounter uint64
	GetRecordMock       mObjectStorageMockGetRecord

	IterateIndexIDsFunc       func(p context.Context, p1 core.RecordID, p2 func(p core.RecordID) (r error)) (r error)
	IterateIndexIDsCounter    uint64
	IterateIndexIDsPreCounter uint64
	IterateIndexIDsMock       mObjectStorageMockIterateIndexIDs

	RemoveObjectIndexFunc       func(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r error)
	RemoveObjectIndexCounter    uint64
	RemoveObjectIndexPreCounter uint64
	RemoveObjectIndexMock       mObjectStorageMockRemoveObjectIndex

	SetBlobFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 []byte) (r *core.RecordID, r1 error)
	SetBlobCounter    uint64
	SetBlobPreCounter uint64
	SetBlobMock       mObjectStorageMockSetBlob

	SetMessageFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 core.Message) (r error)
	SetMessageCounter    uint64
	SetMessagePreCounter uint64
	SetMessageMock       mObjectStorageMockSetMessage

	SetObjectIndexFunc       func(p context.Context, p1 core.RecordID, p2 *core.RecordID, p3 *index.ObjectLifeline) (r error)
	SetObjectIndexCounter    uint64
	SetObjectIndexPreCounter uint64
	SetObjectIndexMock       mObjectStorageMockSetObjectIndex

	SetRecordFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 record.Record) (r *core.RecordID, r1 error)
	SetRecordCounter    uint64
	SetRecordPreCounter uint64
	SetRecordMock       mObjectStorageMockSetRecord
	// contains filtered or unexported fields
}

ObjectStorageMock implements github.com/insolar/insolar/ledger/storage.ObjectStorage

func NewObjectStorageMock added in v0.7.5

func NewObjectStorageMock(t minimock.Tester) *ObjectStorageMock

NewObjectStorageMock returns a mock for github.com/insolar/insolar/ledger/storage.ObjectStorage

func (*ObjectStorageMock) AllMocksCalled added in v0.7.5

func (m *ObjectStorageMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*ObjectStorageMock) CheckMocksCalled added in v0.7.5

func (m *ObjectStorageMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*ObjectStorageMock) Finish added in v0.7.5

func (m *ObjectStorageMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*ObjectStorageMock) GetBlob added in v0.7.5

func (m *ObjectStorageMock) GetBlob(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r []byte, r1 error)

GetBlob implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) GetBlobFinished added in v0.7.5

func (m *ObjectStorageMock) GetBlobFinished() bool

GetBlobFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) GetBlobMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) GetBlobMinimockCounter() uint64

GetBlobMinimockCounter returns a count of ObjectStorageMock.GetBlobFunc invocations

func (*ObjectStorageMock) GetBlobMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) GetBlobMinimockPreCounter() uint64

GetBlobMinimockPreCounter returns the value of ObjectStorageMock.GetBlob invocations

func (*ObjectStorageMock) GetObjectIndex added in v0.7.5

func (m *ObjectStorageMock) GetObjectIndex(p context.Context, p1 core.RecordID, p2 *core.RecordID, p3 bool) (r *index.ObjectLifeline, r1 error)

GetObjectIndex implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) GetObjectIndexFinished added in v0.7.5

func (m *ObjectStorageMock) GetObjectIndexFinished() bool

GetObjectIndexFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) GetObjectIndexMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) GetObjectIndexMinimockCounter() uint64

GetObjectIndexMinimockCounter returns a count of ObjectStorageMock.GetObjectIndexFunc invocations

func (*ObjectStorageMock) GetObjectIndexMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) GetObjectIndexMinimockPreCounter() uint64

GetObjectIndexMinimockPreCounter returns the value of ObjectStorageMock.GetObjectIndex invocations

func (*ObjectStorageMock) GetRecord added in v0.7.5

func (m *ObjectStorageMock) GetRecord(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r record.Record, r1 error)

GetRecord implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) GetRecordFinished added in v0.7.5

func (m *ObjectStorageMock) GetRecordFinished() bool

GetRecordFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) GetRecordMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) GetRecordMinimockCounter() uint64

GetRecordMinimockCounter returns a count of ObjectStorageMock.GetRecordFunc invocations

func (*ObjectStorageMock) GetRecordMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) GetRecordMinimockPreCounter() uint64

GetRecordMinimockPreCounter returns the value of ObjectStorageMock.GetRecord invocations

func (*ObjectStorageMock) IterateIndexIDs added in v0.7.5

func (m *ObjectStorageMock) IterateIndexIDs(p context.Context, p1 core.RecordID, p2 func(p core.RecordID) (r error)) (r error)

IterateIndexIDs implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) IterateIndexIDsFinished added in v0.7.5

func (m *ObjectStorageMock) IterateIndexIDsFinished() bool

IterateIndexIDsFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) IterateIndexIDsMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) IterateIndexIDsMinimockCounter() uint64

IterateIndexIDsMinimockCounter returns a count of ObjectStorageMock.IterateIndexIDsFunc invocations

func (*ObjectStorageMock) IterateIndexIDsMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) IterateIndexIDsMinimockPreCounter() uint64

IterateIndexIDsMinimockPreCounter returns the value of ObjectStorageMock.IterateIndexIDs invocations

func (*ObjectStorageMock) MinimockFinish added in v0.7.5

func (m *ObjectStorageMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*ObjectStorageMock) MinimockWait added in v0.7.5

func (m *ObjectStorageMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*ObjectStorageMock) RemoveObjectIndex added in v0.7.5

func (m *ObjectStorageMock) RemoveObjectIndex(p context.Context, p1 core.RecordID, p2 *core.RecordID) (r error)

RemoveObjectIndex implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) RemoveObjectIndexFinished added in v0.7.5

func (m *ObjectStorageMock) RemoveObjectIndexFinished() bool

RemoveObjectIndexFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) RemoveObjectIndexMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) RemoveObjectIndexMinimockCounter() uint64

RemoveObjectIndexMinimockCounter returns a count of ObjectStorageMock.RemoveObjectIndexFunc invocations

func (*ObjectStorageMock) RemoveObjectIndexMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) RemoveObjectIndexMinimockPreCounter() uint64

RemoveObjectIndexMinimockPreCounter returns the value of ObjectStorageMock.RemoveObjectIndex invocations

func (*ObjectStorageMock) SetBlob added in v0.7.5

func (m *ObjectStorageMock) SetBlob(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 []byte) (r *core.RecordID, r1 error)

SetBlob implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) SetBlobFinished added in v0.7.5

func (m *ObjectStorageMock) SetBlobFinished() bool

SetBlobFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) SetBlobMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) SetBlobMinimockCounter() uint64

SetBlobMinimockCounter returns a count of ObjectStorageMock.SetBlobFunc invocations

func (*ObjectStorageMock) SetBlobMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) SetBlobMinimockPreCounter() uint64

SetBlobMinimockPreCounter returns the value of ObjectStorageMock.SetBlob invocations

func (*ObjectStorageMock) SetMessage added in v0.7.5

func (m *ObjectStorageMock) SetMessage(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 core.Message) (r error)

SetMessage implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) SetMessageFinished added in v0.7.5

func (m *ObjectStorageMock) SetMessageFinished() bool

SetMessageFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) SetMessageMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) SetMessageMinimockCounter() uint64

SetMessageMinimockCounter returns a count of ObjectStorageMock.SetMessageFunc invocations

func (*ObjectStorageMock) SetMessageMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) SetMessageMinimockPreCounter() uint64

SetMessageMinimockPreCounter returns the value of ObjectStorageMock.SetMessage invocations

func (*ObjectStorageMock) SetObjectIndex added in v0.7.5

func (m *ObjectStorageMock) SetObjectIndex(p context.Context, p1 core.RecordID, p2 *core.RecordID, p3 *index.ObjectLifeline) (r error)

SetObjectIndex implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) SetObjectIndexFinished added in v0.7.5

func (m *ObjectStorageMock) SetObjectIndexFinished() bool

SetObjectIndexFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) SetObjectIndexMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) SetObjectIndexMinimockCounter() uint64

SetObjectIndexMinimockCounter returns a count of ObjectStorageMock.SetObjectIndexFunc invocations

func (*ObjectStorageMock) SetObjectIndexMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) SetObjectIndexMinimockPreCounter() uint64

SetObjectIndexMinimockPreCounter returns the value of ObjectStorageMock.SetObjectIndex invocations

func (*ObjectStorageMock) SetRecord added in v0.7.5

SetRecord implements github.com/insolar/insolar/ledger/storage.ObjectStorage interface

func (*ObjectStorageMock) SetRecordFinished added in v0.7.5

func (m *ObjectStorageMock) SetRecordFinished() bool

SetRecordFinished returns true if mock invocations count is ok

func (*ObjectStorageMock) SetRecordMinimockCounter added in v0.7.5

func (m *ObjectStorageMock) SetRecordMinimockCounter() uint64

SetRecordMinimockCounter returns a count of ObjectStorageMock.SetRecordFunc invocations

func (*ObjectStorageMock) SetRecordMinimockPreCounter added in v0.7.5

func (m *ObjectStorageMock) SetRecordMinimockPreCounter() uint64

SetRecordMinimockPreCounter returns the value of ObjectStorageMock.SetRecord invocations

func (*ObjectStorageMock) ValidateCallCounters added in v0.7.5

func (m *ObjectStorageMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*ObjectStorageMock) Wait added in v0.7.5

func (m *ObjectStorageMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type ObjectStorageMockGetBlobExpectation added in v0.7.5

type ObjectStorageMockGetBlobExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockGetBlobExpectation) Return added in v0.7.5

func (e *ObjectStorageMockGetBlobExpectation) Return(r []byte, r1 error)

type ObjectStorageMockGetBlobInput added in v0.7.5

type ObjectStorageMockGetBlobInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockGetBlobResult added in v0.7.5

type ObjectStorageMockGetBlobResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockGetObjectIndexExpectation added in v0.7.5

type ObjectStorageMockGetObjectIndexExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockGetObjectIndexExpectation) Return added in v0.7.5

type ObjectStorageMockGetObjectIndexInput added in v0.7.5

type ObjectStorageMockGetObjectIndexInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockGetObjectIndexResult added in v0.7.5

type ObjectStorageMockGetObjectIndexResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockGetRecordExpectation added in v0.7.5

type ObjectStorageMockGetRecordExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockGetRecordExpectation) Return added in v0.7.5

type ObjectStorageMockGetRecordInput added in v0.7.5

type ObjectStorageMockGetRecordInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockGetRecordResult added in v0.7.5

type ObjectStorageMockGetRecordResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockIterateIndexIDsExpectation added in v0.7.5

type ObjectStorageMockIterateIndexIDsExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockIterateIndexIDsExpectation) Return added in v0.7.5

type ObjectStorageMockIterateIndexIDsInput added in v0.7.5

type ObjectStorageMockIterateIndexIDsInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockIterateIndexIDsResult added in v0.7.5

type ObjectStorageMockIterateIndexIDsResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockRemoveObjectIndexExpectation added in v0.7.5

type ObjectStorageMockRemoveObjectIndexExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockRemoveObjectIndexExpectation) Return added in v0.7.5

type ObjectStorageMockRemoveObjectIndexInput added in v0.7.5

type ObjectStorageMockRemoveObjectIndexInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockRemoveObjectIndexResult added in v0.7.5

type ObjectStorageMockRemoveObjectIndexResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetBlobExpectation added in v0.7.5

type ObjectStorageMockSetBlobExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockSetBlobExpectation) Return added in v0.7.5

type ObjectStorageMockSetBlobInput added in v0.7.5

type ObjectStorageMockSetBlobInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetBlobResult added in v0.7.5

type ObjectStorageMockSetBlobResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetMessageExpectation added in v0.7.5

type ObjectStorageMockSetMessageExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockSetMessageExpectation) Return added in v0.7.5

type ObjectStorageMockSetMessageInput added in v0.7.5

type ObjectStorageMockSetMessageInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetMessageResult added in v0.7.5

type ObjectStorageMockSetMessageResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetObjectIndexExpectation added in v0.7.5

type ObjectStorageMockSetObjectIndexExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockSetObjectIndexExpectation) Return added in v0.7.5

type ObjectStorageMockSetObjectIndexInput added in v0.7.5

type ObjectStorageMockSetObjectIndexInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetObjectIndexResult added in v0.7.5

type ObjectStorageMockSetObjectIndexResult struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetRecordExpectation added in v0.7.5

type ObjectStorageMockSetRecordExpectation struct {
	// contains filtered or unexported fields
}

func (*ObjectStorageMockSetRecordExpectation) Return added in v0.7.5

type ObjectStorageMockSetRecordInput added in v0.7.5

type ObjectStorageMockSetRecordInput struct {
	// contains filtered or unexported fields
}

type ObjectStorageMockSetRecordResult added in v0.7.5

type ObjectStorageMockSetRecordResult struct {
	// contains filtered or unexported fields
}

type Pulse added in v0.6.3

type Pulse struct {
	Prev         *core.PulseNumber
	Next         *core.PulseNumber
	SerialNumber int
	Pulse        core.Pulse
}

Pulse is a record containing pulse info.

func (*Pulse) Bytes added in v0.6.3

func (p *Pulse) Bytes() []byte

Bytes serializes pulse.

type PulseStorage added in v0.7.5

type PulseStorage struct {
	PulseTracker PulseTracker `inject:""`
	// contains filtered or unexported fields
}

PulseStorage implements core.PulseStorage

func NewPulseStorage added in v0.7.5

func NewPulseStorage() *PulseStorage

NewPulseStorage creates new pulse storage

func (*PulseStorage) Current added in v0.7.5

func (ps *PulseStorage) Current(ctx context.Context) (*core.Pulse, error)

Current returns current pulse of the system

func (*PulseStorage) Lock added in v0.7.5

func (ps *PulseStorage) Lock()

Lock takes lock on parent's pulse storage

func (*PulseStorage) Set added in v0.7.5

func (ps *PulseStorage) Set(pulse *core.Pulse)

func (*PulseStorage) Unlock added in v0.7.5

func (ps *PulseStorage) Unlock()

Unlock takes unlock on parent's pulse storage

type PulseTracker added in v0.7.5

type PulseTracker interface {
	GetPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)
	GetPreviousPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)
	GetNthPrevPulse(ctx context.Context, n uint, from core.PulseNumber) (*Pulse, error)
	GetLatestPulse(ctx context.Context) (*Pulse, error)

	AddPulse(ctx context.Context, pulse core.Pulse) error

	DeletePulse(ctx context.Context, num core.PulseNumber) error
}

PulseTracker allows to modify state of the pulse inside storage (internal or external)

func NewPulseTracker added in v0.8.0

func NewPulseTracker() PulseTracker

NewPulseTracker returns new instance PulseTracker with DB-storage realization

func NewPulseTrackerMemory added in v0.8.0

func NewPulseTrackerMemory() PulseTracker

NewPulseTracker returns new instance PulseTracker with in-memory realization

type PulseTrackerMock added in v0.7.5

type PulseTrackerMock struct {
	AddPulseFunc       func(p context.Context, p1 core.Pulse) (r error)
	AddPulseCounter    uint64
	AddPulsePreCounter uint64
	AddPulseMock       mPulseTrackerMockAddPulse

	DeletePulseFunc       func(p context.Context, p1 core.PulseNumber) (r error)
	DeletePulseCounter    uint64
	DeletePulsePreCounter uint64
	DeletePulseMock       mPulseTrackerMockDeletePulse

	GetLatestPulseFunc       func(p context.Context) (r *Pulse, r1 error)
	GetLatestPulseCounter    uint64
	GetLatestPulsePreCounter uint64
	GetLatestPulseMock       mPulseTrackerMockGetLatestPulse

	GetNthPrevPulseFunc       func(p context.Context, p1 uint, p2 core.PulseNumber) (r *Pulse, r1 error)
	GetNthPrevPulseCounter    uint64
	GetNthPrevPulsePreCounter uint64
	GetNthPrevPulseMock       mPulseTrackerMockGetNthPrevPulse

	GetPreviousPulseFunc       func(p context.Context, p1 core.PulseNumber) (r *Pulse, r1 error)
	GetPreviousPulseCounter    uint64
	GetPreviousPulsePreCounter uint64
	GetPreviousPulseMock       mPulseTrackerMockGetPreviousPulse

	GetPulseFunc       func(p context.Context, p1 core.PulseNumber) (r *Pulse, r1 error)
	GetPulseCounter    uint64
	GetPulsePreCounter uint64
	GetPulseMock       mPulseTrackerMockGetPulse
	// contains filtered or unexported fields
}

PulseTrackerMock implements github.com/insolar/insolar/ledger/storage.PulseTracker

func NewPulseTrackerMock added in v0.7.5

func NewPulseTrackerMock(t minimock.Tester) *PulseTrackerMock

NewPulseTrackerMock returns a mock for github.com/insolar/insolar/ledger/storage.PulseTracker

func (*PulseTrackerMock) AddPulse added in v0.7.5

func (m *PulseTrackerMock) AddPulse(p context.Context, p1 core.Pulse) (r error)

AddPulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) AddPulseFinished added in v0.7.5

func (m *PulseTrackerMock) AddPulseFinished() bool

AddPulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) AddPulseMinimockCounter added in v0.7.5

func (m *PulseTrackerMock) AddPulseMinimockCounter() uint64

AddPulseMinimockCounter returns a count of PulseTrackerMock.AddPulseFunc invocations

func (*PulseTrackerMock) AddPulseMinimockPreCounter added in v0.7.5

func (m *PulseTrackerMock) AddPulseMinimockPreCounter() uint64

AddPulseMinimockPreCounter returns the value of PulseTrackerMock.AddPulse invocations

func (*PulseTrackerMock) AllMocksCalled added in v0.7.5

func (m *PulseTrackerMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*PulseTrackerMock) CheckMocksCalled added in v0.7.5

func (m *PulseTrackerMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*PulseTrackerMock) DeletePulse added in v0.8.0

func (m *PulseTrackerMock) DeletePulse(p context.Context, p1 core.PulseNumber) (r error)

DeletePulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) DeletePulseFinished added in v0.8.0

func (m *PulseTrackerMock) DeletePulseFinished() bool

DeletePulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) DeletePulseMinimockCounter added in v0.8.0

func (m *PulseTrackerMock) DeletePulseMinimockCounter() uint64

DeletePulseMinimockCounter returns a count of PulseTrackerMock.DeletePulseFunc invocations

func (*PulseTrackerMock) DeletePulseMinimockPreCounter added in v0.8.0

func (m *PulseTrackerMock) DeletePulseMinimockPreCounter() uint64

DeletePulseMinimockPreCounter returns the value of PulseTrackerMock.DeletePulse invocations

func (*PulseTrackerMock) Finish added in v0.7.5

func (m *PulseTrackerMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*PulseTrackerMock) GetLatestPulse added in v0.7.5

func (m *PulseTrackerMock) GetLatestPulse(p context.Context) (r *Pulse, r1 error)

GetLatestPulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) GetLatestPulseFinished added in v0.7.5

func (m *PulseTrackerMock) GetLatestPulseFinished() bool

GetLatestPulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) GetLatestPulseMinimockCounter added in v0.7.5

func (m *PulseTrackerMock) GetLatestPulseMinimockCounter() uint64

GetLatestPulseMinimockCounter returns a count of PulseTrackerMock.GetLatestPulseFunc invocations

func (*PulseTrackerMock) GetLatestPulseMinimockPreCounter added in v0.7.5

func (m *PulseTrackerMock) GetLatestPulseMinimockPreCounter() uint64

GetLatestPulseMinimockPreCounter returns the value of PulseTrackerMock.GetLatestPulse invocations

func (*PulseTrackerMock) GetNthPrevPulse added in v0.8.0

func (m *PulseTrackerMock) GetNthPrevPulse(p context.Context, p1 uint, p2 core.PulseNumber) (r *Pulse, r1 error)

GetNthPrevPulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) GetNthPrevPulseFinished added in v0.8.0

func (m *PulseTrackerMock) GetNthPrevPulseFinished() bool

GetNthPrevPulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) GetNthPrevPulseMinimockCounter added in v0.8.0

func (m *PulseTrackerMock) GetNthPrevPulseMinimockCounter() uint64

GetNthPrevPulseMinimockCounter returns a count of PulseTrackerMock.GetNthPrevPulseFunc invocations

func (*PulseTrackerMock) GetNthPrevPulseMinimockPreCounter added in v0.8.0

func (m *PulseTrackerMock) GetNthPrevPulseMinimockPreCounter() uint64

GetNthPrevPulseMinimockPreCounter returns the value of PulseTrackerMock.GetNthPrevPulse invocations

func (*PulseTrackerMock) GetPreviousPulse added in v0.7.5

func (m *PulseTrackerMock) GetPreviousPulse(p context.Context, p1 core.PulseNumber) (r *Pulse, r1 error)

GetPreviousPulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) GetPreviousPulseFinished added in v0.7.5

func (m *PulseTrackerMock) GetPreviousPulseFinished() bool

GetPreviousPulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) GetPreviousPulseMinimockCounter added in v0.7.5

func (m *PulseTrackerMock) GetPreviousPulseMinimockCounter() uint64

GetPreviousPulseMinimockCounter returns a count of PulseTrackerMock.GetPreviousPulseFunc invocations

func (*PulseTrackerMock) GetPreviousPulseMinimockPreCounter added in v0.7.5

func (m *PulseTrackerMock) GetPreviousPulseMinimockPreCounter() uint64

GetPreviousPulseMinimockPreCounter returns the value of PulseTrackerMock.GetPreviousPulse invocations

func (*PulseTrackerMock) GetPulse added in v0.7.5

func (m *PulseTrackerMock) GetPulse(p context.Context, p1 core.PulseNumber) (r *Pulse, r1 error)

GetPulse implements github.com/insolar/insolar/ledger/storage.PulseTracker interface

func (*PulseTrackerMock) GetPulseFinished added in v0.7.5

func (m *PulseTrackerMock) GetPulseFinished() bool

GetPulseFinished returns true if mock invocations count is ok

func (*PulseTrackerMock) GetPulseMinimockCounter added in v0.7.5

func (m *PulseTrackerMock) GetPulseMinimockCounter() uint64

GetPulseMinimockCounter returns a count of PulseTrackerMock.GetPulseFunc invocations

func (*PulseTrackerMock) GetPulseMinimockPreCounter added in v0.7.5

func (m *PulseTrackerMock) GetPulseMinimockPreCounter() uint64

GetPulseMinimockPreCounter returns the value of PulseTrackerMock.GetPulse invocations

func (*PulseTrackerMock) MinimockFinish added in v0.7.5

func (m *PulseTrackerMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*PulseTrackerMock) MinimockWait added in v0.7.5

func (m *PulseTrackerMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*PulseTrackerMock) ValidateCallCounters added in v0.7.5

func (m *PulseTrackerMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*PulseTrackerMock) Wait added in v0.7.5

func (m *PulseTrackerMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type PulseTrackerMockAddPulseExpectation added in v0.7.5

type PulseTrackerMockAddPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockAddPulseExpectation) Return added in v0.7.5

type PulseTrackerMockAddPulseInput added in v0.7.5

type PulseTrackerMockAddPulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockAddPulseResult added in v0.7.5

type PulseTrackerMockAddPulseResult struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockDeletePulseExpectation added in v0.8.0

type PulseTrackerMockDeletePulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockDeletePulseExpectation) Return added in v0.8.0

type PulseTrackerMockDeletePulseInput added in v0.8.0

type PulseTrackerMockDeletePulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockDeletePulseResult added in v0.8.0

type PulseTrackerMockDeletePulseResult struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetLatestPulseExpectation added in v0.7.5

type PulseTrackerMockGetLatestPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockGetLatestPulseExpectation) Return added in v0.7.5

type PulseTrackerMockGetLatestPulseInput added in v0.7.5

type PulseTrackerMockGetLatestPulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetLatestPulseResult added in v0.7.5

type PulseTrackerMockGetLatestPulseResult struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetNthPrevPulseExpectation added in v0.8.0

type PulseTrackerMockGetNthPrevPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockGetNthPrevPulseExpectation) Return added in v0.8.0

type PulseTrackerMockGetNthPrevPulseInput added in v0.8.0

type PulseTrackerMockGetNthPrevPulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetNthPrevPulseResult added in v0.8.0

type PulseTrackerMockGetNthPrevPulseResult struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetPreviousPulseExpectation added in v0.7.5

type PulseTrackerMockGetPreviousPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockGetPreviousPulseExpectation) Return added in v0.7.5

type PulseTrackerMockGetPreviousPulseInput added in v0.7.5

type PulseTrackerMockGetPreviousPulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetPreviousPulseResult added in v0.7.5

type PulseTrackerMockGetPreviousPulseResult struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetPulseExpectation added in v0.7.5

type PulseTrackerMockGetPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*PulseTrackerMockGetPulseExpectation) Return added in v0.7.5

type PulseTrackerMockGetPulseInput added in v0.7.5

type PulseTrackerMockGetPulseInput struct {
	// contains filtered or unexported fields
}

type PulseTrackerMockGetPulseResult added in v0.7.5

type PulseTrackerMockGetPulseResult struct {
	// contains filtered or unexported fields
}

type ReplicaIter added in v0.6.3

type ReplicaIter struct {
	// contains filtered or unexported fields
}

ReplicaIter provides partial iterator over BadgerDB key/value pairs required for replication to Heavy Material node in provided pulses range.

"Required KV pairs" are all keys with namespace 'scopeIDRecord' (TODO: 'add scopeIDBlob') in provided pulses range and all indexes from zero pulse to the end of provided range.

"Partial" means it fetches data in chunks of the specified size. After a chunk has been fetched, an iterator saves current position.

NOTE: This is not an "honest" alogrithm, because the last record size can exceed the limit. Better implementation is for the future work.

func NewReplicaIter added in v0.6.3

func NewReplicaIter(
	ctx context.Context,
	dbContext DBContext,
	jetID core.RecordID,
	start core.PulseNumber,
	end core.PulseNumber,
	limit int,
) *ReplicaIter

NewReplicaIter creates ReplicaIter what iterates over records on jet, required for heavy material replication.

Params 'start' and 'end' defines pulses from which scan should happen, and on which it should be stopped, but indexes scan are always started from core.FirstPulseNumber.

Param 'limit' sets per message limit.

func (*ReplicaIter) LastSeenPulse added in v0.7.5

func (r *ReplicaIter) LastSeenPulse() core.PulseNumber

LastPulse returns maximum pulse number of returned keys after each fetch.

func (*ReplicaIter) NextRecords added in v0.6.3

func (r *ReplicaIter) NextRecords() ([]core.KV, error)

NextRecords fetches next part of key value pairs.

type ReplicaStorage added in v0.7.5

type ReplicaStorage interface {
	SetHeavySyncedPulse(ctx context.Context, jetID core.RecordID, pulsenum core.PulseNumber) error
	GetHeavySyncedPulse(ctx context.Context, jetID core.RecordID) (pn core.PulseNumber, err error)
	GetSyncClientJetPulses(ctx context.Context, jetID core.RecordID) ([]core.PulseNumber, error)
	SetSyncClientJetPulses(ctx context.Context, jetID core.RecordID, pns []core.PulseNumber) error
	GetAllSyncClientJets(ctx context.Context) (map[core.RecordID][]core.PulseNumber, error)
	GetAllNonEmptySyncClientJets(ctx context.Context) (map[core.RecordID][]core.PulseNumber, error)
}

ReplicaStorage is a heavy-based storage

func NewReplicaStorage added in v0.8.0

func NewReplicaStorage() ReplicaStorage

type ReplicaStorageMock added in v0.7.5

type ReplicaStorageMock struct {
	GetAllNonEmptySyncClientJetsFunc       func(p context.Context) (r map[core.RecordID][]core.PulseNumber, r1 error)
	GetAllNonEmptySyncClientJetsCounter    uint64
	GetAllNonEmptySyncClientJetsPreCounter uint64
	GetAllNonEmptySyncClientJetsMock       mReplicaStorageMockGetAllNonEmptySyncClientJets

	GetAllSyncClientJetsFunc       func(p context.Context) (r map[core.RecordID][]core.PulseNumber, r1 error)
	GetAllSyncClientJetsCounter    uint64
	GetAllSyncClientJetsPreCounter uint64
	GetAllSyncClientJetsMock       mReplicaStorageMockGetAllSyncClientJets

	GetHeavySyncedPulseFunc       func(p context.Context, p1 core.RecordID) (r core.PulseNumber, r1 error)
	GetHeavySyncedPulseCounter    uint64
	GetHeavySyncedPulsePreCounter uint64
	GetHeavySyncedPulseMock       mReplicaStorageMockGetHeavySyncedPulse

	GetSyncClientJetPulsesFunc       func(p context.Context, p1 core.RecordID) (r []core.PulseNumber, r1 error)
	GetSyncClientJetPulsesCounter    uint64
	GetSyncClientJetPulsesPreCounter uint64
	GetSyncClientJetPulsesMock       mReplicaStorageMockGetSyncClientJetPulses

	SetHeavySyncedPulseFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r error)
	SetHeavySyncedPulseCounter    uint64
	SetHeavySyncedPulsePreCounter uint64
	SetHeavySyncedPulseMock       mReplicaStorageMockSetHeavySyncedPulse

	SetSyncClientJetPulsesFunc       func(p context.Context, p1 core.RecordID, p2 []core.PulseNumber) (r error)
	SetSyncClientJetPulsesCounter    uint64
	SetSyncClientJetPulsesPreCounter uint64
	SetSyncClientJetPulsesMock       mReplicaStorageMockSetSyncClientJetPulses
	// contains filtered or unexported fields
}

ReplicaStorageMock implements github.com/insolar/insolar/ledger/storage.ReplicaStorage

func NewReplicaStorageMock added in v0.7.5

func NewReplicaStorageMock(t minimock.Tester) *ReplicaStorageMock

NewReplicaStorageMock returns a mock for github.com/insolar/insolar/ledger/storage.ReplicaStorage

func (*ReplicaStorageMock) AllMocksCalled added in v0.7.5

func (m *ReplicaStorageMock) AllMocksCalled() bool

AllMocksCalled returns true if all mocked methods were called before the execution of AllMocksCalled, it can be used with assert/require, i.e. assert.True(mock.AllMocksCalled())

func (*ReplicaStorageMock) CheckMocksCalled added in v0.7.5

func (m *ReplicaStorageMock) CheckMocksCalled()

CheckMocksCalled checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*ReplicaStorageMock) Finish added in v0.7.5

func (m *ReplicaStorageMock) Finish()

Finish checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish or use Finish method of minimock.Controller

func (*ReplicaStorageMock) GetAllNonEmptySyncClientJets added in v0.7.5

func (m *ReplicaStorageMock) GetAllNonEmptySyncClientJets(p context.Context) (r map[core.RecordID][]core.PulseNumber, r1 error)

GetAllNonEmptySyncClientJets implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) GetAllNonEmptySyncClientJetsFinished added in v0.7.5

func (m *ReplicaStorageMock) GetAllNonEmptySyncClientJetsFinished() bool

GetAllNonEmptySyncClientJetsFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) GetAllNonEmptySyncClientJetsMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) GetAllNonEmptySyncClientJetsMinimockCounter() uint64

GetAllNonEmptySyncClientJetsMinimockCounter returns a count of ReplicaStorageMock.GetAllNonEmptySyncClientJetsFunc invocations

func (*ReplicaStorageMock) GetAllNonEmptySyncClientJetsMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) GetAllNonEmptySyncClientJetsMinimockPreCounter() uint64

GetAllNonEmptySyncClientJetsMinimockPreCounter returns the value of ReplicaStorageMock.GetAllNonEmptySyncClientJets invocations

func (*ReplicaStorageMock) GetAllSyncClientJets added in v0.7.5

func (m *ReplicaStorageMock) GetAllSyncClientJets(p context.Context) (r map[core.RecordID][]core.PulseNumber, r1 error)

GetAllSyncClientJets implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) GetAllSyncClientJetsFinished added in v0.7.5

func (m *ReplicaStorageMock) GetAllSyncClientJetsFinished() bool

GetAllSyncClientJetsFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) GetAllSyncClientJetsMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) GetAllSyncClientJetsMinimockCounter() uint64

GetAllSyncClientJetsMinimockCounter returns a count of ReplicaStorageMock.GetAllSyncClientJetsFunc invocations

func (*ReplicaStorageMock) GetAllSyncClientJetsMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) GetAllSyncClientJetsMinimockPreCounter() uint64

GetAllSyncClientJetsMinimockPreCounter returns the value of ReplicaStorageMock.GetAllSyncClientJets invocations

func (*ReplicaStorageMock) GetHeavySyncedPulse added in v0.7.5

func (m *ReplicaStorageMock) GetHeavySyncedPulse(p context.Context, p1 core.RecordID) (r core.PulseNumber, r1 error)

GetHeavySyncedPulse implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) GetHeavySyncedPulseFinished added in v0.7.5

func (m *ReplicaStorageMock) GetHeavySyncedPulseFinished() bool

GetHeavySyncedPulseFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) GetHeavySyncedPulseMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) GetHeavySyncedPulseMinimockCounter() uint64

GetHeavySyncedPulseMinimockCounter returns a count of ReplicaStorageMock.GetHeavySyncedPulseFunc invocations

func (*ReplicaStorageMock) GetHeavySyncedPulseMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) GetHeavySyncedPulseMinimockPreCounter() uint64

GetHeavySyncedPulseMinimockPreCounter returns the value of ReplicaStorageMock.GetHeavySyncedPulse invocations

func (*ReplicaStorageMock) GetSyncClientJetPulses added in v0.7.5

func (m *ReplicaStorageMock) GetSyncClientJetPulses(p context.Context, p1 core.RecordID) (r []core.PulseNumber, r1 error)

GetSyncClientJetPulses implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) GetSyncClientJetPulsesFinished added in v0.7.5

func (m *ReplicaStorageMock) GetSyncClientJetPulsesFinished() bool

GetSyncClientJetPulsesFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) GetSyncClientJetPulsesMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) GetSyncClientJetPulsesMinimockCounter() uint64

GetSyncClientJetPulsesMinimockCounter returns a count of ReplicaStorageMock.GetSyncClientJetPulsesFunc invocations

func (*ReplicaStorageMock) GetSyncClientJetPulsesMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) GetSyncClientJetPulsesMinimockPreCounter() uint64

GetSyncClientJetPulsesMinimockPreCounter returns the value of ReplicaStorageMock.GetSyncClientJetPulses invocations

func (*ReplicaStorageMock) MinimockFinish added in v0.7.5

func (m *ReplicaStorageMock) MinimockFinish()

MinimockFinish checks that all mocked methods of the interface have been called at least once

func (*ReplicaStorageMock) MinimockWait added in v0.7.5

func (m *ReplicaStorageMock) MinimockWait(timeout time.Duration)

MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller

func (*ReplicaStorageMock) SetHeavySyncedPulse added in v0.7.5

func (m *ReplicaStorageMock) SetHeavySyncedPulse(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r error)

SetHeavySyncedPulse implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) SetHeavySyncedPulseFinished added in v0.7.5

func (m *ReplicaStorageMock) SetHeavySyncedPulseFinished() bool

SetHeavySyncedPulseFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) SetHeavySyncedPulseMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) SetHeavySyncedPulseMinimockCounter() uint64

SetHeavySyncedPulseMinimockCounter returns a count of ReplicaStorageMock.SetHeavySyncedPulseFunc invocations

func (*ReplicaStorageMock) SetHeavySyncedPulseMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) SetHeavySyncedPulseMinimockPreCounter() uint64

SetHeavySyncedPulseMinimockPreCounter returns the value of ReplicaStorageMock.SetHeavySyncedPulse invocations

func (*ReplicaStorageMock) SetSyncClientJetPulses added in v0.7.5

func (m *ReplicaStorageMock) SetSyncClientJetPulses(p context.Context, p1 core.RecordID, p2 []core.PulseNumber) (r error)

SetSyncClientJetPulses implements github.com/insolar/insolar/ledger/storage.ReplicaStorage interface

func (*ReplicaStorageMock) SetSyncClientJetPulsesFinished added in v0.7.5

func (m *ReplicaStorageMock) SetSyncClientJetPulsesFinished() bool

SetSyncClientJetPulsesFinished returns true if mock invocations count is ok

func (*ReplicaStorageMock) SetSyncClientJetPulsesMinimockCounter added in v0.7.5

func (m *ReplicaStorageMock) SetSyncClientJetPulsesMinimockCounter() uint64

SetSyncClientJetPulsesMinimockCounter returns a count of ReplicaStorageMock.SetSyncClientJetPulsesFunc invocations

func (*ReplicaStorageMock) SetSyncClientJetPulsesMinimockPreCounter added in v0.7.5

func (m *ReplicaStorageMock) SetSyncClientJetPulsesMinimockPreCounter() uint64

SetSyncClientJetPulsesMinimockPreCounter returns the value of ReplicaStorageMock.SetSyncClientJetPulses invocations

func (*ReplicaStorageMock) ValidateCallCounters added in v0.7.5

func (m *ReplicaStorageMock) ValidateCallCounters()

ValidateCallCounters checks that all mocked methods of the interface have been called at least once Deprecated: please use MinimockFinish method or use Finish method of minimock.Controller

func (*ReplicaStorageMock) Wait added in v0.7.5

func (m *ReplicaStorageMock) Wait(timeout time.Duration)

Wait waits for all mocked methods to be called at least once Deprecated: please use MinimockWait or use Wait method of minimock.Controller

type ReplicaStorageMockGetAllNonEmptySyncClientJetsExpectation added in v0.7.5

type ReplicaStorageMockGetAllNonEmptySyncClientJetsExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockGetAllNonEmptySyncClientJetsExpectation) Return added in v0.7.5

type ReplicaStorageMockGetAllNonEmptySyncClientJetsInput added in v0.7.5

type ReplicaStorageMockGetAllNonEmptySyncClientJetsInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetAllNonEmptySyncClientJetsResult added in v0.7.5

type ReplicaStorageMockGetAllNonEmptySyncClientJetsResult struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetAllSyncClientJetsExpectation added in v0.7.5

type ReplicaStorageMockGetAllSyncClientJetsExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockGetAllSyncClientJetsExpectation) Return added in v0.7.5

type ReplicaStorageMockGetAllSyncClientJetsInput added in v0.7.5

type ReplicaStorageMockGetAllSyncClientJetsInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetAllSyncClientJetsResult added in v0.7.5

type ReplicaStorageMockGetAllSyncClientJetsResult struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetHeavySyncedPulseExpectation added in v0.7.5

type ReplicaStorageMockGetHeavySyncedPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockGetHeavySyncedPulseExpectation) Return added in v0.7.5

type ReplicaStorageMockGetHeavySyncedPulseInput added in v0.7.5

type ReplicaStorageMockGetHeavySyncedPulseInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetHeavySyncedPulseResult added in v0.7.5

type ReplicaStorageMockGetHeavySyncedPulseResult struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetSyncClientJetPulsesExpectation added in v0.7.5

type ReplicaStorageMockGetSyncClientJetPulsesExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockGetSyncClientJetPulsesExpectation) Return added in v0.7.5

type ReplicaStorageMockGetSyncClientJetPulsesInput added in v0.7.5

type ReplicaStorageMockGetSyncClientJetPulsesInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockGetSyncClientJetPulsesResult added in v0.7.5

type ReplicaStorageMockGetSyncClientJetPulsesResult struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockSetHeavySyncedPulseExpectation added in v0.7.5

type ReplicaStorageMockSetHeavySyncedPulseExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockSetHeavySyncedPulseExpectation) Return added in v0.7.5

type ReplicaStorageMockSetHeavySyncedPulseInput added in v0.7.5

type ReplicaStorageMockSetHeavySyncedPulseInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockSetHeavySyncedPulseResult added in v0.7.5

type ReplicaStorageMockSetHeavySyncedPulseResult struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockSetSyncClientJetPulsesExpectation added in v0.7.5

type ReplicaStorageMockSetSyncClientJetPulsesExpectation struct {
	// contains filtered or unexported fields
}

func (*ReplicaStorageMockSetSyncClientJetPulsesExpectation) Return added in v0.7.5

type ReplicaStorageMockSetSyncClientJetPulsesInput added in v0.7.5

type ReplicaStorageMockSetSyncClientJetPulsesInput struct {
	// contains filtered or unexported fields
}

type ReplicaStorageMockSetSyncClientJetPulsesResult added in v0.7.5

type ReplicaStorageMockSetSyncClientJetPulsesResult struct {
	// contains filtered or unexported fields
}

type RmStat added in v0.8.0

type RmStat struct {
	Scanned int64
	Removed int64
	Errors  int64
}

RmStat holds removal statistics

type Store added in v0.0.5

type Store interface {
	GetRecord(ctx context.Context, jetID core.RecordID, ref *core.RecordID) (record.Record, error)
	SetRecord(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, rec record.Record) (*core.RecordID, error)
	GetBlob(ctx context.Context, jetID core.RecordID, ref *core.RecordID) ([]byte, error)
	SetBlob(ctx context.Context, jetID core.RecordID, number core.PulseNumber, blob []byte) (*core.RecordID, error)

	GetObjectIndex(ctx context.Context, jetID core.RecordID, ref *core.RecordID, forupdate bool) (*index.ObjectLifeline, error)
	SetObjectIndex(ctx context.Context, jetID core.RecordID, ref *core.RecordID, idx *index.ObjectLifeline) error
	RemoveObjectIndex(ctx context.Context, jetID core.RecordID, ref *core.RecordID) error

	// Deprecated: use core.PulseStorage.Current() instead
	GetLatestPulse(ctx context.Context) (*Pulse, error)
	GetPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)
}

Store is used by context unaware clients who can work inside transactions as well as outside.

type TransactionManager added in v0.0.6

type TransactionManager struct {
	// contains filtered or unexported fields
}

TransactionManager is used to ensure persistent writes to disk.

func (*TransactionManager) Commit added in v0.0.6

func (m *TransactionManager) Commit() error

Commit tries to write transaction on disk. Returns error on fail.

func (*TransactionManager) Discard added in v0.0.6

func (m *TransactionManager) Discard()

Discard terminates transaction without disk writes.

func (*TransactionManager) GetBlob added in v0.6.2

func (m *TransactionManager) GetBlob(ctx context.Context, jetID core.RecordID, id *core.RecordID) ([]byte, error)

GetBlob returns binary value stored by record ID.

func (*TransactionManager) GetLatestPulse added in v0.7.5

func (m *TransactionManager) GetLatestPulse(ctx context.Context) (*Pulse, error)

GetLatestPulse returns the latest pulse

func (*TransactionManager) GetObjectIndex added in v0.0.6

func (m *TransactionManager) GetObjectIndex(
	ctx context.Context,
	jetID core.RecordID,
	id *core.RecordID,
	forupdate bool,
) (*index.ObjectLifeline, error)

GetObjectIndex fetches object lifeline index.

func (*TransactionManager) GetPulse added in v0.6.3

func (m *TransactionManager) GetPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)

GetPulse returns pulse for provided pulse number.

func (*TransactionManager) GetRecord added in v0.0.6

func (m *TransactionManager) GetRecord(ctx context.Context, jetID core.RecordID, id *core.RecordID) (record.Record, error)

GetRecord returns record from BadgerDB by *record.Reference.

It returns ErrNotFound if the DB does not contain the key.

func (*TransactionManager) GetRequest added in v0.5.0

func (m *TransactionManager) GetRequest(ctx context.Context, jetID core.RecordID, id *core.RecordID) (record.Request, error)

GetRequest returns request record from BadgerDB by *record.Reference.

It returns ErrNotFound if the DB does not contain the key.

func (*TransactionManager) RemoveObjectIndex added in v0.7.5

func (m *TransactionManager) RemoveObjectIndex(
	ctx context.Context,
	jetID core.RecordID,
	ref *core.RecordID,
) error

RemoveObjectIndex removes an index of an object

func (*TransactionManager) SetBlob added in v0.6.2

func (m *TransactionManager) SetBlob(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, blob []byte) (*core.RecordID, error)

SetBlob saves binary value for provided pulse.

func (*TransactionManager) SetObjectIndex added in v0.0.6

func (m *TransactionManager) SetObjectIndex(
	ctx context.Context,
	jetID core.RecordID,
	id *core.RecordID,
	idx *index.ObjectLifeline,
) error

SetObjectIndex stores object lifeline index.

func (*TransactionManager) SetRecord added in v0.0.6

func (m *TransactionManager) SetRecord(ctx context.Context, jetID core.RecordID, pulseNumber core.PulseNumber, rec record.Record) (*core.RecordID, error)

SetRecord stores record in BadgerDB and returns *record.ID of new record.

If record exists returns both *record.ID and ErrOverride error. If record not found returns nil and ErrNotFound error

Directories

Path Synopsis
Package index represents indexes and meta information for records.
Package index represents indexes and meta information for records.
Package jet provides methods for working with Jet objects.
Package jet provides methods for working with Jet objects.
Package nodes contains node storage
Package nodes contains node storage
Package record contains code and types for storage records manipulation.
Package record contains code and types for storage records manipulation.
Package storagetest contains high level API tests and test utils for other modules.
Package storagetest contains high level API tests and test utils for other modules.

Jump to

Keyboard shortcuts

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