storage

package
v0.7.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 28, 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 (
	// ErrNotFound returns if record/index not found in storage.
	ErrNotFound = errors.New("storage object not found")

	// 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 SetRecord 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")
)
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 ActiveNodesStorage added in v0.7.5

type ActiveNodesStorage interface {
	SetActiveNodes(pulse core.PulseNumber, nodes []core.Node) error
	GetActiveNodes(pulse core.PulseNumber) ([]core.Node, error)
	GetActiveNodesByRole(pulse core.PulseNumber, role core.StaticRole) ([]core.Node, error)
	RemoveActiveNodesUntil(pulse core.PulseNumber)
}

ActiveNodesStorage provides info about active nodes

type ActiveNodesStorageMock added in v0.7.5

type ActiveNodesStorageMock struct {
	GetActiveNodesFunc       func(p core.PulseNumber) (r []core.Node, r1 error)
	GetActiveNodesCounter    uint64
	GetActiveNodesPreCounter uint64
	GetActiveNodesMock       mActiveNodesStorageMockGetActiveNodes

	GetActiveNodesByRoleFunc       func(p core.PulseNumber, p1 core.StaticRole) (r []core.Node, r1 error)
	GetActiveNodesByRoleCounter    uint64
	GetActiveNodesByRolePreCounter uint64
	GetActiveNodesByRoleMock       mActiveNodesStorageMockGetActiveNodesByRole

	RemoveActiveNodesUntilFunc       func(p core.PulseNumber)
	RemoveActiveNodesUntilCounter    uint64
	RemoveActiveNodesUntilPreCounter uint64
	RemoveActiveNodesUntilMock       mActiveNodesStorageMockRemoveActiveNodesUntil

	SetActiveNodesFunc       func(p core.PulseNumber, p1 []core.Node) (r error)
	SetActiveNodesCounter    uint64
	SetActiveNodesPreCounter uint64
	SetActiveNodesMock       mActiveNodesStorageMockSetActiveNodes
	// contains filtered or unexported fields
}

ActiveNodesStorageMock implements github.com/insolar/insolar/ledger/storage.ActiveNodesStorage

func NewActiveNodesStorageMock added in v0.7.5

func NewActiveNodesStorageMock(t minimock.Tester) *ActiveNodesStorageMock

NewActiveNodesStorageMock returns a mock for github.com/insolar/insolar/ledger/storage.ActiveNodesStorage

func (*ActiveNodesStorageMock) AllMocksCalled added in v0.7.5

func (m *ActiveNodesStorageMock) 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 (*ActiveNodesStorageMock) CheckMocksCalled added in v0.7.5

func (m *ActiveNodesStorageMock) 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 (*ActiveNodesStorageMock) Finish added in v0.7.5

func (m *ActiveNodesStorageMock) 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 (*ActiveNodesStorageMock) GetActiveNodes added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodes(p core.PulseNumber) (r []core.Node, r1 error)

GetActiveNodes implements github.com/insolar/insolar/ledger/storage.ActiveNodesStorage interface

func (*ActiveNodesStorageMock) GetActiveNodesByRole added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesByRole(p core.PulseNumber, p1 core.StaticRole) (r []core.Node, r1 error)

GetActiveNodesByRole implements github.com/insolar/insolar/ledger/storage.ActiveNodesStorage interface

func (*ActiveNodesStorageMock) GetActiveNodesByRoleFinished added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesByRoleFinished() bool

GetActiveNodesByRoleFinished returns true if mock invocations count is ok

func (*ActiveNodesStorageMock) GetActiveNodesByRoleMinimockCounter added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesByRoleMinimockCounter() uint64

GetActiveNodesByRoleMinimockCounter returns a count of ActiveNodesStorageMock.GetActiveNodesByRoleFunc invocations

func (*ActiveNodesStorageMock) GetActiveNodesByRoleMinimockPreCounter added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesByRoleMinimockPreCounter() uint64

GetActiveNodesByRoleMinimockPreCounter returns the value of ActiveNodesStorageMock.GetActiveNodesByRole invocations

func (*ActiveNodesStorageMock) GetActiveNodesFinished added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesFinished() bool

GetActiveNodesFinished returns true if mock invocations count is ok

func (*ActiveNodesStorageMock) GetActiveNodesMinimockCounter added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesMinimockCounter() uint64

GetActiveNodesMinimockCounter returns a count of ActiveNodesStorageMock.GetActiveNodesFunc invocations

func (*ActiveNodesStorageMock) GetActiveNodesMinimockPreCounter added in v0.7.5

func (m *ActiveNodesStorageMock) GetActiveNodesMinimockPreCounter() uint64

GetActiveNodesMinimockPreCounter returns the value of ActiveNodesStorageMock.GetActiveNodes invocations

func (*ActiveNodesStorageMock) MinimockFinish added in v0.7.5

func (m *ActiveNodesStorageMock) MinimockFinish()

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

func (*ActiveNodesStorageMock) MinimockWait added in v0.7.5

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

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

func (*ActiveNodesStorageMock) RemoveActiveNodesUntil added in v0.7.5

func (m *ActiveNodesStorageMock) RemoveActiveNodesUntil(p core.PulseNumber)

RemoveActiveNodesUntil implements github.com/insolar/insolar/ledger/storage.ActiveNodesStorage interface

func (*ActiveNodesStorageMock) RemoveActiveNodesUntilFinished added in v0.7.5

func (m *ActiveNodesStorageMock) RemoveActiveNodesUntilFinished() bool

RemoveActiveNodesUntilFinished returns true if mock invocations count is ok

func (*ActiveNodesStorageMock) RemoveActiveNodesUntilMinimockCounter added in v0.7.5

func (m *ActiveNodesStorageMock) RemoveActiveNodesUntilMinimockCounter() uint64

RemoveActiveNodesUntilMinimockCounter returns a count of ActiveNodesStorageMock.RemoveActiveNodesUntilFunc invocations

func (*ActiveNodesStorageMock) RemoveActiveNodesUntilMinimockPreCounter added in v0.7.5

func (m *ActiveNodesStorageMock) RemoveActiveNodesUntilMinimockPreCounter() uint64

RemoveActiveNodesUntilMinimockPreCounter returns the value of ActiveNodesStorageMock.RemoveActiveNodesUntil invocations

func (*ActiveNodesStorageMock) SetActiveNodes added in v0.7.5

func (m *ActiveNodesStorageMock) SetActiveNodes(p core.PulseNumber, p1 []core.Node) (r error)

SetActiveNodes implements github.com/insolar/insolar/ledger/storage.ActiveNodesStorage interface

func (*ActiveNodesStorageMock) SetActiveNodesFinished added in v0.7.5

func (m *ActiveNodesStorageMock) SetActiveNodesFinished() bool

SetActiveNodesFinished returns true if mock invocations count is ok

func (*ActiveNodesStorageMock) SetActiveNodesMinimockCounter added in v0.7.5

func (m *ActiveNodesStorageMock) SetActiveNodesMinimockCounter() uint64

SetActiveNodesMinimockCounter returns a count of ActiveNodesStorageMock.SetActiveNodesFunc invocations

func (*ActiveNodesStorageMock) SetActiveNodesMinimockPreCounter added in v0.7.5

func (m *ActiveNodesStorageMock) SetActiveNodesMinimockPreCounter() uint64

SetActiveNodesMinimockPreCounter returns the value of ActiveNodesStorageMock.SetActiveNodes invocations

func (*ActiveNodesStorageMock) ValidateCallCounters added in v0.7.5

func (m *ActiveNodesStorageMock) 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 (*ActiveNodesStorageMock) Wait added in v0.7.5

func (m *ActiveNodesStorageMock) 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 ActiveNodesStorageMockGetActiveNodesByRoleExpectation added in v0.7.5

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

func (*ActiveNodesStorageMockGetActiveNodesByRoleExpectation) Return added in v0.7.5

type ActiveNodesStorageMockGetActiveNodesByRoleInput added in v0.7.5

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

type ActiveNodesStorageMockGetActiveNodesByRoleResult added in v0.7.5

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

type ActiveNodesStorageMockGetActiveNodesExpectation added in v0.7.5

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

func (*ActiveNodesStorageMockGetActiveNodesExpectation) Return added in v0.7.5

type ActiveNodesStorageMockGetActiveNodesInput added in v0.7.5

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

type ActiveNodesStorageMockGetActiveNodesResult added in v0.7.5

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

type ActiveNodesStorageMockRemoveActiveNodesUntilExpectation added in v0.7.5

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

type ActiveNodesStorageMockRemoveActiveNodesUntilInput added in v0.7.5

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

type ActiveNodesStorageMockSetActiveNodesExpectation added in v0.7.5

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

func (*ActiveNodesStorageMockSetActiveNodesExpectation) Return added in v0.7.5

type ActiveNodesStorageMockSetActiveNodesInput added in v0.7.5

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

type ActiveNodesStorageMockSetActiveNodesResult added in v0.7.5

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

type Cleaner added in v0.7.5

type Cleaner interface {
	RemoveAllForJetUntilPulse(
		ctx context.Context,
		jetID core.RecordID,
		pn core.PulseNumber,
		recent recentstorage.RecentStorage,
	) (map[string]int, error)

	RemoveJetIndexesUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber, recent recentstorage.RecentStorage) (int, error)
	RemoveJetBlobsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber) (int, error)
	RemoveJetRecordsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber, recent recentstorage.RecentStorage) (int, error)
	RemoveJetDropsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber) (int, error)
}

Cleaner cleans lights after sync to heavy

type CleanerMock added in v0.7.5

type CleanerMock struct {
	RemoveAllForJetUntilPulseFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r map[string]int, r1 error)
	RemoveAllForJetUntilPulseCounter    uint64
	RemoveAllForJetUntilPulsePreCounter uint64
	RemoveAllForJetUntilPulseMock       mCleanerMockRemoveAllForJetUntilPulse

	RemoveJetBlobsUntilFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r int, r1 error)
	RemoveJetBlobsUntilCounter    uint64
	RemoveJetBlobsUntilPreCounter uint64
	RemoveJetBlobsUntilMock       mCleanerMockRemoveJetBlobsUntil

	RemoveJetDropsUntilFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r int, r1 error)
	RemoveJetDropsUntilCounter    uint64
	RemoveJetDropsUntilPreCounter uint64
	RemoveJetDropsUntilMock       mCleanerMockRemoveJetDropsUntil

	RemoveJetIndexesUntilFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r int, r1 error)
	RemoveJetIndexesUntilCounter    uint64
	RemoveJetIndexesUntilPreCounter uint64
	RemoveJetIndexesUntilMock       mCleanerMockRemoveJetIndexesUntil

	RemoveJetRecordsUntilFunc       func(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r int, r1 error)
	RemoveJetRecordsUntilCounter    uint64
	RemoveJetRecordsUntilPreCounter uint64
	RemoveJetRecordsUntilMock       mCleanerMockRemoveJetRecordsUntil
	// 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) 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) RemoveAllForJetUntilPulse added in v0.7.5

func (m *CleanerMock) RemoveAllForJetUntilPulse(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r map[string]int, r1 error)

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

func (*CleanerMock) RemoveAllForJetUntilPulseFinished added in v0.7.5

func (m *CleanerMock) RemoveAllForJetUntilPulseFinished() bool

RemoveAllForJetUntilPulseFinished returns true if mock invocations count is ok

func (*CleanerMock) RemoveAllForJetUntilPulseMinimockCounter added in v0.7.5

func (m *CleanerMock) RemoveAllForJetUntilPulseMinimockCounter() uint64

RemoveAllForJetUntilPulseMinimockCounter returns a count of CleanerMock.RemoveAllForJetUntilPulseFunc invocations

func (*CleanerMock) RemoveAllForJetUntilPulseMinimockPreCounter added in v0.7.5

func (m *CleanerMock) RemoveAllForJetUntilPulseMinimockPreCounter() uint64

RemoveAllForJetUntilPulseMinimockPreCounter returns the value of CleanerMock.RemoveAllForJetUntilPulse invocations

func (*CleanerMock) RemoveJetBlobsUntil added in v0.7.5

func (m *CleanerMock) RemoveJetBlobsUntil(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r int, r1 error)

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

func (*CleanerMock) RemoveJetBlobsUntilFinished added in v0.7.5

func (m *CleanerMock) RemoveJetBlobsUntilFinished() bool

RemoveJetBlobsUntilFinished returns true if mock invocations count is ok

func (*CleanerMock) RemoveJetBlobsUntilMinimockCounter added in v0.7.5

func (m *CleanerMock) RemoveJetBlobsUntilMinimockCounter() uint64

RemoveJetBlobsUntilMinimockCounter returns a count of CleanerMock.RemoveJetBlobsUntilFunc invocations

func (*CleanerMock) RemoveJetBlobsUntilMinimockPreCounter added in v0.7.5

func (m *CleanerMock) RemoveJetBlobsUntilMinimockPreCounter() uint64

RemoveJetBlobsUntilMinimockPreCounter returns the value of CleanerMock.RemoveJetBlobsUntil invocations

func (*CleanerMock) RemoveJetDropsUntil added in v0.7.5

func (m *CleanerMock) RemoveJetDropsUntil(p context.Context, p1 core.RecordID, p2 core.PulseNumber) (r int, r1 error)

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

func (*CleanerMock) RemoveJetDropsUntilFinished added in v0.7.5

func (m *CleanerMock) RemoveJetDropsUntilFinished() bool

RemoveJetDropsUntilFinished returns true if mock invocations count is ok

func (*CleanerMock) RemoveJetDropsUntilMinimockCounter added in v0.7.5

func (m *CleanerMock) RemoveJetDropsUntilMinimockCounter() uint64

RemoveJetDropsUntilMinimockCounter returns a count of CleanerMock.RemoveJetDropsUntilFunc invocations

func (*CleanerMock) RemoveJetDropsUntilMinimockPreCounter added in v0.7.5

func (m *CleanerMock) RemoveJetDropsUntilMinimockPreCounter() uint64

RemoveJetDropsUntilMinimockPreCounter returns the value of CleanerMock.RemoveJetDropsUntil invocations

func (*CleanerMock) RemoveJetIndexesUntil added in v0.7.5

func (m *CleanerMock) RemoveJetIndexesUntil(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r int, r1 error)

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

func (*CleanerMock) RemoveJetIndexesUntilFinished added in v0.7.5

func (m *CleanerMock) RemoveJetIndexesUntilFinished() bool

RemoveJetIndexesUntilFinished returns true if mock invocations count is ok

func (*CleanerMock) RemoveJetIndexesUntilMinimockCounter added in v0.7.5

func (m *CleanerMock) RemoveJetIndexesUntilMinimockCounter() uint64

RemoveJetIndexesUntilMinimockCounter returns a count of CleanerMock.RemoveJetIndexesUntilFunc invocations

func (*CleanerMock) RemoveJetIndexesUntilMinimockPreCounter added in v0.7.5

func (m *CleanerMock) RemoveJetIndexesUntilMinimockPreCounter() uint64

RemoveJetIndexesUntilMinimockPreCounter returns the value of CleanerMock.RemoveJetIndexesUntil invocations

func (*CleanerMock) RemoveJetRecordsUntil added in v0.7.5

func (m *CleanerMock) RemoveJetRecordsUntil(p context.Context, p1 core.RecordID, p2 core.PulseNumber, p3 recentstorage.RecentStorage) (r int, r1 error)

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

func (*CleanerMock) RemoveJetRecordsUntilFinished added in v0.7.5

func (m *CleanerMock) RemoveJetRecordsUntilFinished() bool

RemoveJetRecordsUntilFinished returns true if mock invocations count is ok

func (*CleanerMock) RemoveJetRecordsUntilMinimockCounter added in v0.7.5

func (m *CleanerMock) RemoveJetRecordsUntilMinimockCounter() uint64

RemoveJetRecordsUntilMinimockCounter returns a count of CleanerMock.RemoveJetRecordsUntilFunc invocations

func (*CleanerMock) RemoveJetRecordsUntilMinimockPreCounter added in v0.7.5

func (m *CleanerMock) RemoveJetRecordsUntilMinimockPreCounter() uint64

RemoveJetRecordsUntilMinimockPreCounter returns the value of CleanerMock.RemoveJetRecordsUntil invocations

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 CleanerMockRemoveAllForJetUntilPulseExpectation added in v0.7.5

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

func (*CleanerMockRemoveAllForJetUntilPulseExpectation) Return added in v0.7.5

type CleanerMockRemoveAllForJetUntilPulseInput added in v0.7.5

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

type CleanerMockRemoveAllForJetUntilPulseResult added in v0.7.5

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

type CleanerMockRemoveJetBlobsUntilExpectation added in v0.7.5

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

func (*CleanerMockRemoveJetBlobsUntilExpectation) Return added in v0.7.5

type CleanerMockRemoveJetBlobsUntilInput added in v0.7.5

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

type CleanerMockRemoveJetBlobsUntilResult added in v0.7.5

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

type CleanerMockRemoveJetDropsUntilExpectation added in v0.7.5

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

func (*CleanerMockRemoveJetDropsUntilExpectation) Return added in v0.7.5

type CleanerMockRemoveJetDropsUntilInput added in v0.7.5

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

type CleanerMockRemoveJetDropsUntilResult added in v0.7.5

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

type CleanerMockRemoveJetIndexesUntilExpectation added in v0.7.5

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

func (*CleanerMockRemoveJetIndexesUntilExpectation) Return added in v0.7.5

type CleanerMockRemoveJetIndexesUntilInput added in v0.7.5

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

type CleanerMockRemoveJetIndexesUntilResult added in v0.7.5

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

type CleanerMockRemoveJetRecordsUntilExpectation added in v0.7.5

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

func (*CleanerMockRemoveJetRecordsUntilExpectation) Return added in v0.7.5

type CleanerMockRemoveJetRecordsUntilInput added in v0.7.5

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

type CleanerMockRemoveJetRecordsUntilResult added in v0.7.5

type CleanerMockRemoveJetRecordsUntilResult 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 NewDB added in v0.0.6

func NewDB(conf configuration.Ledger, opts *badger.Options) (*DB, 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.

func (*DB) AddDropSize added in v0.7.5

func (db *DB) AddDropSize(ctx context.Context, dropSize *jet.DropSize) error

AddDropSize adds Jet drop size stats (required for split decision).

func (*DB) AddJets added in v0.7.5

func (db *DB) AddJets(ctx context.Context, jetIDs ...core.RecordID) error

AddJets stores a list of jets of the current node.

func (*DB) AddPulse added in v0.6.0

func (db *DB) AddPulse(ctx context.Context, pulse core.Pulse) error

AddPulse saves new pulse data and updates index.

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) CloneJetTree added in v0.7.5

func (db *DB) CloneJetTree(
	ctx context.Context, from, to core.PulseNumber,
) (*jet.Tree, error)

CloneJetTree copies tree from one pulse to another. Use it to copy past tree into new pulse.

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) CreateDrop added in v0.6.0

func (db *DB) CreateDrop(ctx context.Context, jetID core.RecordID, pulse core.PulseNumber, prevHash []byte) (
	*jet.JetDrop,
	[][]byte,
	uint64,
	error,
)

CreateDrop creates and stores jet drop for given pulse number.

On success returns saved drop object, slot records, drop size.

func (*DB) GenesisRef added in v0.6.0

func (db *DB) GenesisRef() *core.RecordRef

GenesisRef returns the genesis record reference.

Genesis record is the parent for all top-level records.

func (*DB) GetActiveNodes added in v0.6.3

func (db *DB) GetActiveNodes(pulse core.PulseNumber) ([]core.Node, error)

GetActiveNodes return active nodes for specified pulse.

func (*DB) GetActiveNodesByRole added in v0.7.5

func (db *DB) GetActiveNodesByRole(pulse core.PulseNumber, role core.StaticRole) ([]core.Node, error)

GetActiveNodesByRole return active nodes for specified pulse and role.

func (*DB) GetAllNonEmptySyncClientJets added in v0.7.5

func (db *DB) GetAllNonEmptySyncClientJets(ctx context.Context) (map[core.RecordID][]core.PulseNumber, error)

GetAllNonEmptySyncClientJets returns map of all jet's if they have non empty list pulses to sync.

func (*DB) GetAllSyncClientJets added in v0.7.5

func (db *DB) GetAllSyncClientJets(ctx context.Context) (map[core.RecordID][]core.PulseNumber, error)

GetAllSyncClientJets returns map of all jet's processed by node.

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) GetBlob added in v0.6.2

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

GetBlob returns binary value stored by record ID. TODO: switch from reference to passing blob id for consistency - @nordicdyno 6.Dec.2018

func (*DB) GetDrop added in v0.0.6

func (db *DB) GetDrop(ctx context.Context, jetID core.RecordID, pulse core.PulseNumber) (*jet.JetDrop, error)

GetDrop returns jet drop for a given pulse number and jet id.

func (*DB) GetDropSizeHistory added in v0.7.5

func (db *DB) GetDropSizeHistory(ctx context.Context, jetID core.RecordID) (jet.DropSizeHistory, error)

GetDropSizeHistory returns last drops sizes.

func (*DB) GetHeavySyncedPulse added in v0.6.3

func (db *DB) GetHeavySyncedPulse(ctx context.Context, jetID core.RecordID) (pn core.PulseNumber, err error)

GetHeavySyncedPulse returns last successfuly synced pulse number on heavy node.

func (*DB) GetJetSizesHistoryDepth added in v0.7.5

func (db *DB) GetJetSizesHistoryDepth() int

GetJetSizesHistoryDepth returns max amount of drop sizes

func (*DB) GetJetTree added in v0.7.5

func (db *DB) GetJetTree(ctx context.Context, pulse core.PulseNumber) (*jet.Tree, error)

GetJetTree fetches tree for specified pulse.

func (*DB) GetJets added in v0.7.5

func (db *DB) GetJets(ctx context.Context) (jet.IDSet, error)

GetJets returns jets of the current node

func (*DB) GetLatestPulse deprecated added in v0.7.5

func (db *DB) GetLatestPulse(ctx context.Context) (*Pulse, error)

Deprecated: use core.PulseStorage.Current() instead (or private getLatestPulse if applicable).

func (*DB) GetLocalData added in v0.6.3

func (db *DB) GetLocalData(ctx context.Context, pulse core.PulseNumber, key []byte) ([]byte, error)

GetLocalData retrieves data from storage.

func (*DB) GetObjectIndex added in v0.0.6

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

GetObjectIndex wraps matching transaction manager method.

func (*DB) GetPreviousPulse added in v0.7.5

func (db *DB) GetPreviousPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)

GetPreviousPulse returns pulse for provided pulse number.

func (*DB) GetPulse added in v0.6.0

func (db *DB) GetPulse(ctx context.Context, num core.PulseNumber) (*Pulse, error)

GetPulse returns pulse for provided pulse number.

func (*DB) GetRecord added in v0.0.6

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

GetRecord wraps matching transaction manager method.

func (*DB) GetSyncClientJetPulses added in v0.7.5

func (db *DB) GetSyncClientJetPulses(ctx context.Context, jetID core.RecordID) ([]core.PulseNumber, error)

GetSyncClientJetPulses returns all jet's pulses not synced to heavy.

func (*DB) Init added in v0.6.3

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

Init creates initial records in storage.

func (*DB) IterateIndexIDs added in v0.7.5

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

IterateIndexIDs iterates over index IDs on provided Jet ID.

func (*DB) IterateLocalData added in v0.6.3

func (db *DB) IterateLocalData(
	ctx context.Context,
	pulse core.PulseNumber,
	prefix []byte,
	handler func(k, v []byte) error,
) error

IterateLocalData iterates over all record with specified prefix and calls handler with key and value of that record.

The key will be returned without prefix (e.g. the remaining slice) and value will be returned as it was saved.

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) RemoveActiveNodesUntil added in v0.7.5

func (db *DB) RemoveActiveNodesUntil(pulse core.PulseNumber)

RemoveActiveNodesUntil removes active nodes for all nodes less than provided pulse.

func (*DB) RemoveAllForJetUntilPulse added in v0.7.5

func (db *DB) RemoveAllForJetUntilPulse(
	ctx context.Context,
	jetID core.RecordID,
	pn core.PulseNumber,
	recent recentstorage.RecentStorage,
) (map[string]int, error)

RemoveAllForJetUntilPulse removes all syncing on heavy records until pulse number for provided jetID returns removal stat and cummulative error

func (*DB) RemoveJetBlobsUntil added in v0.7.5

func (db *DB) RemoveJetBlobsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber) (int, error)

RemoveJetBlobsUntil removes for provided JetID all blobs older than provided pulse number.

func (*DB) RemoveJetDropsUntil added in v0.7.5

func (db *DB) RemoveJetDropsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber) (int, error)

RemoveJetDropsUntil removes for provided JetID all jet drops older than provided pulse number.

func (*DB) RemoveJetIndexesUntil added in v0.7.5

func (db *DB) RemoveJetIndexesUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber, recent recentstorage.RecentStorage) (int, error)

RemoveJetIndexesUntil removes for provided JetID all lifelines older than provided pulse number. Indexes caches by recent storage, we should avoid them deletion.

func (*DB) RemoveJetRecordsUntil added in v0.7.5

func (db *DB) RemoveJetRecordsUntil(ctx context.Context, jetID core.RecordID, pn core.PulseNumber, recent recentstorage.RecentStorage) (int, error)

RemoveJetRecordsUntil removes for provided JetID all records older than provided pulse number. In recods pending requests live, so we need recent storage here

func (*DB) RemoveObjectIndex added in v0.7.5

func (db *DB) RemoveObjectIndex(
	ctx context.Context,
	jetID core.RecordID,
	ref *core.RecordID,
) error

RemoveObjectIndex removes an index of an object

func (*DB) SetActiveNodes added in v0.6.3

func (db *DB) SetActiveNodes(pulse core.PulseNumber, nodes []core.Node) error

SetActiveNodes saves active nodes for pulse in memory.

func (*DB) SetBlob added in v0.6.2

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

SetBlob saves binary value for provided pulse.

func (*DB) SetDrop added in v0.0.6

func (db *DB) SetDrop(ctx context.Context, jetID core.RecordID, drop *jet.JetDrop) error

SetDrop saves provided JetDrop in db.

func (*DB) SetDropSizeHistory added in v0.7.5

func (db *DB) SetDropSizeHistory(ctx context.Context, jetID core.RecordID, dropSizeHistory jet.DropSizeHistory) error

SetDropSizeHistory saves drop sizes history.

func (*DB) SetHeavySyncedPulse added in v0.6.3

func (db *DB) SetHeavySyncedPulse(ctx context.Context, jetID core.RecordID, pulsenum core.PulseNumber) error

SetHeavySyncedPulse saves last successfuly synced pulse number on heavy node.

func (*DB) SetLocalData added in v0.6.3

func (db *DB) SetLocalData(ctx context.Context, pulse core.PulseNumber, key []byte, data []byte) error

SetLocalData saves provided data to storage.

func (*DB) SetMessage added in v0.6.2

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

SetMessage persists message to the database

func (*DB) SetObjectIndex added in v0.0.6

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

SetObjectIndex wraps matching transaction manager method.

func (*DB) SetRecord added in v0.0.6

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

SetRecord wraps matching transaction manager method.

func (*DB) SetSyncClientJetPulses added in v0.7.5

func (db *DB) SetSyncClientJetPulses(ctx context.Context, jetID core.RecordID, pns []core.PulseNumber) error

SetSyncClientJetPulses saves all jet's pulses not synced to heavy.

func (*DB) SetTxRetiries added in v0.0.6

func (db *DB) SetTxRetiries(n int)

SetTxRetiries sets number of retries on conflict in Update

func (*DB) SplitJetTree added in v0.7.5

func (db *DB) SplitJetTree(
	ctx context.Context, pulse core.PulseNumber, jetID core.RecordID,
) (*core.RecordID, *core.RecordID, error)

SplitJetTree performs jet split and returns resulting jet ids.

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) UpdateJetTree added in v0.7.5

func (db *DB) UpdateJetTree(ctx context.Context, pulse core.PulseNumber, setActual bool, ids ...core.RecordID) error

UpdateJetTree updates jet tree for specified pulse.

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 {
	SetTxRetiries(n int)
	GetJetSizesHistoryDepth() int
	GenesisRef() *core.RecordRef

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

	SetLocalData(ctx context.Context, pulse core.PulseNumber, key []byte, data []byte) error
	GetLocalData(ctx context.Context, pulse core.PulseNumber, key []byte) ([]byte, error)

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

	GetBadgerDB() *badger.DB

	Close() error
}

DBContext provides base db methods

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

	GenesisRefFunc       func() (r *core.RecordRef)
	GenesisRefCounter    uint64
	GenesisRefPreCounter uint64
	GenesisRefMock       mDBContextMockGenesisRef

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

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

	GetLocalDataFunc       func(p context.Context, p1 core.PulseNumber, p2 []byte) (r []byte, r1 error)
	GetLocalDataCounter    uint64
	GetLocalDataPreCounter uint64
	GetLocalDataMock       mDBContextMockGetLocalData

	SetLocalDataFunc       func(p context.Context, p1 core.PulseNumber, p2 []byte, p3 []byte) (r error)
	SetLocalDataCounter    uint64
	SetLocalDataPreCounter uint64
	SetLocalDataMock       mDBContextMockSetLocalData

	SetTxRetiriesFunc       func(p int)
	SetTxRetiriesCounter    uint64
	SetTxRetiriesPreCounter uint64
	SetTxRetiriesMock       mDBContextMockSetTxRetiries

	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) GenesisRef added in v0.7.5

func (m *DBContextMock) GenesisRef() (r *core.RecordRef)

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

func (*DBContextMock) GenesisRefFinished added in v0.7.5

func (m *DBContextMock) GenesisRefFinished() bool

GenesisRefFinished returns true if mock invocations count is ok

func (*DBContextMock) GenesisRefMinimockCounter added in v0.7.5

func (m *DBContextMock) GenesisRefMinimockCounter() uint64

GenesisRefMinimockCounter returns a count of DBContextMock.GenesisRefFunc invocations

func (*DBContextMock) GenesisRefMinimockPreCounter added in v0.7.5

func (m *DBContextMock) GenesisRefMinimockPreCounter() uint64

GenesisRefMinimockPreCounter returns the value of DBContextMock.GenesisRef invocations

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) GetJetSizesHistoryDepth added in v0.7.5

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

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

func (*DBContextMock) GetJetSizesHistoryDepthFinished added in v0.7.5

func (m *DBContextMock) GetJetSizesHistoryDepthFinished() bool

GetJetSizesHistoryDepthFinished returns true if mock invocations count is ok

func (*DBContextMock) GetJetSizesHistoryDepthMinimockCounter added in v0.7.5

func (m *DBContextMock) GetJetSizesHistoryDepthMinimockCounter() uint64

GetJetSizesHistoryDepthMinimockCounter returns a count of DBContextMock.GetJetSizesHistoryDepthFunc invocations

func (*DBContextMock) GetJetSizesHistoryDepthMinimockPreCounter added in v0.7.5

func (m *DBContextMock) GetJetSizesHistoryDepthMinimockPreCounter() uint64

GetJetSizesHistoryDepthMinimockPreCounter returns the value of DBContextMock.GetJetSizesHistoryDepth invocations

func (*DBContextMock) GetLocalData added in v0.7.5

func (m *DBContextMock) GetLocalData(p context.Context, p1 core.PulseNumber, p2 []byte) (r []byte, r1 error)

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

func (*DBContextMock) GetLocalDataFinished added in v0.7.5

func (m *DBContextMock) GetLocalDataFinished() bool

GetLocalDataFinished returns true if mock invocations count is ok

func (*DBContextMock) GetLocalDataMinimockCounter added in v0.7.5

func (m *DBContextMock) GetLocalDataMinimockCounter() uint64

GetLocalDataMinimockCounter returns a count of DBContextMock.GetLocalDataFunc invocations

func (*DBContextMock) GetLocalDataMinimockPreCounter added in v0.7.5

func (m *DBContextMock) GetLocalDataMinimockPreCounter() uint64

GetLocalDataMinimockPreCounter returns the value of DBContextMock.GetLocalData 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) SetLocalData added in v0.7.5

func (m *DBContextMock) SetLocalData(p context.Context, p1 core.PulseNumber, p2 []byte, p3 []byte) (r error)

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

func (*DBContextMock) SetLocalDataFinished added in v0.7.5

func (m *DBContextMock) SetLocalDataFinished() bool

SetLocalDataFinished returns true if mock invocations count is ok

func (*DBContextMock) SetLocalDataMinimockCounter added in v0.7.5

func (m *DBContextMock) SetLocalDataMinimockCounter() uint64

SetLocalDataMinimockCounter returns a count of DBContextMock.SetLocalDataFunc invocations

func (*DBContextMock) SetLocalDataMinimockPreCounter added in v0.7.5

func (m *DBContextMock) SetLocalDataMinimockPreCounter() uint64

SetLocalDataMinimockPreCounter returns the value of DBContextMock.SetLocalData invocations

func (*DBContextMock) SetTxRetiries added in v0.7.5

func (m *DBContextMock) SetTxRetiries(p int)

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

func (*DBContextMock) SetTxRetiriesFinished added in v0.7.5

func (m *DBContextMock) SetTxRetiriesFinished() bool

SetTxRetiriesFinished returns true if mock invocations count is ok

func (*DBContextMock) SetTxRetiriesMinimockCounter added in v0.7.5

func (m *DBContextMock) SetTxRetiriesMinimockCounter() uint64

SetTxRetiriesMinimockCounter returns a count of DBContextMock.SetTxRetiriesFunc invocations

func (*DBContextMock) SetTxRetiriesMinimockPreCounter added in v0.7.5

func (m *DBContextMock) SetTxRetiriesMinimockPreCounter() uint64

SetTxRetiriesMinimockPreCounter returns the value of DBContextMock.SetTxRetiries invocations

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 DBContextMockGenesisRefExpectation added in v0.7.5

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

func (*DBContextMockGenesisRefExpectation) Return added in v0.7.5

type DBContextMockGenesisRefResult added in v0.7.5

type DBContextMockGenesisRefResult 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 DBContextMockGetJetSizesHistoryDepthExpectation added in v0.7.5

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

func (*DBContextMockGetJetSizesHistoryDepthExpectation) Return added in v0.7.5

type DBContextMockGetJetSizesHistoryDepthResult added in v0.7.5

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

type DBContextMockGetLocalDataExpectation added in v0.7.5

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

func (*DBContextMockGetLocalDataExpectation) Return added in v0.7.5

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

type DBContextMockGetLocalDataInput added in v0.7.5

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

type DBContextMockGetLocalDataResult added in v0.7.5

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

type DBContextMockSetLocalDataExpectation added in v0.7.5

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

func (*DBContextMockSetLocalDataExpectation) Return added in v0.7.5

type DBContextMockSetLocalDataInput added in v0.7.5

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

type DBContextMockSetLocalDataResult added in v0.7.5

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

type DBContextMockSetTxRetiriesExpectation added in v0.7.5

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

type DBContextMockSetTxRetiriesInput added in v0.7.5

type DBContextMockSetTxRetiriesInput 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 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 {
	GetDrop(ctx context.Context, jetID core.RecordID, pulse core.PulseNumber) (*jet.JetDrop, error)
	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

	UpdateJetTree(ctx context.Context, pulse core.PulseNumber, setActual bool, ids ...core.RecordID) error
	GetJetTree(ctx context.Context, pulse core.PulseNumber) (*jet.Tree, error)
	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, error)

	AddJets(ctx context.Context, jetIDs ...core.RecordID) error
	GetJets(ctx context.Context) (jet.IDSet, 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)
}

JetStorage provides methods for working with jets and their drops

type JetStorageMock added in v0.7.5

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

	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, r1 error)
	CloneJetTreeCounter    uint64
	CloneJetTreePreCounter uint64
	CloneJetTreeMock       mJetStorageMockCloneJetTree

	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       mJetStorageMockCreateDrop

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

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

	GetJetTreeFunc       func(p context.Context, p1 core.PulseNumber) (r *jet.Tree, r1 error)
	GetJetTreeCounter    uint64
	GetJetTreePreCounter uint64
	GetJetTreeMock       mJetStorageMockGetJetTree

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

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

	SetDropSizeHistoryFunc       func(p context.Context, p1 core.RecordID, p2 jet.DropSizeHistory) (r error)
	SetDropSizeHistoryCounter    uint64
	SetDropSizeHistoryPreCounter uint64
	SetDropSizeHistoryMock       mJetStorageMockSetDropSizeHistory

	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) (r error)
	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) AddDropSize added in v0.7.5

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

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

func (*JetStorageMock) AddDropSizeFinished added in v0.7.5

func (m *JetStorageMock) AddDropSizeFinished() bool

AddDropSizeFinished returns true if mock invocations count is ok

func (*JetStorageMock) AddDropSizeMinimockCounter added in v0.7.5

func (m *JetStorageMock) AddDropSizeMinimockCounter() uint64

AddDropSizeMinimockCounter returns a count of JetStorageMock.AddDropSizeFunc invocations

func (*JetStorageMock) AddDropSizeMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) AddDropSizeMinimockPreCounter() uint64

AddDropSizeMinimockPreCounter returns the value of JetStorageMock.AddDropSize invocations

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, r1 error)

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) CreateDrop added in v0.7.5

func (m *JetStorageMock) 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.JetStorage interface

func (*JetStorageMock) CreateDropFinished added in v0.7.5

func (m *JetStorageMock) CreateDropFinished() bool

CreateDropFinished returns true if mock invocations count is ok

func (*JetStorageMock) CreateDropMinimockCounter added in v0.7.5

func (m *JetStorageMock) CreateDropMinimockCounter() uint64

CreateDropMinimockCounter returns a count of JetStorageMock.CreateDropFunc invocations

func (*JetStorageMock) CreateDropMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) CreateDropMinimockPreCounter() uint64

CreateDropMinimockPreCounter returns the value of JetStorageMock.CreateDrop 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) GetDrop added in v0.7.5

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

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

func (*JetStorageMock) GetDropFinished added in v0.7.5

func (m *JetStorageMock) GetDropFinished() bool

GetDropFinished returns true if mock invocations count is ok

func (*JetStorageMock) GetDropMinimockCounter added in v0.7.5

func (m *JetStorageMock) GetDropMinimockCounter() uint64

GetDropMinimockCounter returns a count of JetStorageMock.GetDropFunc invocations

func (*JetStorageMock) GetDropMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) GetDropMinimockPreCounter() uint64

GetDropMinimockPreCounter returns the value of JetStorageMock.GetDrop invocations

func (*JetStorageMock) GetDropSizeHistory added in v0.7.5

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

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

func (*JetStorageMock) GetDropSizeHistoryFinished added in v0.7.5

func (m *JetStorageMock) GetDropSizeHistoryFinished() bool

GetDropSizeHistoryFinished returns true if mock invocations count is ok

func (*JetStorageMock) GetDropSizeHistoryMinimockCounter added in v0.7.5

func (m *JetStorageMock) GetDropSizeHistoryMinimockCounter() uint64

GetDropSizeHistoryMinimockCounter returns a count of JetStorageMock.GetDropSizeHistoryFunc invocations

func (*JetStorageMock) GetDropSizeHistoryMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) GetDropSizeHistoryMinimockPreCounter() uint64

GetDropSizeHistoryMinimockPreCounter returns the value of JetStorageMock.GetDropSizeHistory invocations

func (*JetStorageMock) GetJetTree added in v0.7.5

func (m *JetStorageMock) GetJetTree(p context.Context, p1 core.PulseNumber) (r *jet.Tree, r1 error)

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

func (*JetStorageMock) GetJetTreeFinished added in v0.7.5

func (m *JetStorageMock) GetJetTreeFinished() bool

GetJetTreeFinished returns true if mock invocations count is ok

func (*JetStorageMock) GetJetTreeMinimockCounter added in v0.7.5

func (m *JetStorageMock) GetJetTreeMinimockCounter() uint64

GetJetTreeMinimockCounter returns a count of JetStorageMock.GetJetTreeFunc invocations

func (*JetStorageMock) GetJetTreeMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) GetJetTreeMinimockPreCounter() uint64

GetJetTreeMinimockPreCounter returns the value of JetStorageMock.GetJetTree invocations

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) SetDrop added in v0.7.5

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

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

func (*JetStorageMock) SetDropFinished added in v0.7.5

func (m *JetStorageMock) SetDropFinished() bool

SetDropFinished returns true if mock invocations count is ok

func (*JetStorageMock) SetDropMinimockCounter added in v0.7.5

func (m *JetStorageMock) SetDropMinimockCounter() uint64

SetDropMinimockCounter returns a count of JetStorageMock.SetDropFunc invocations

func (*JetStorageMock) SetDropMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) SetDropMinimockPreCounter() uint64

SetDropMinimockPreCounter returns the value of JetStorageMock.SetDrop invocations

func (*JetStorageMock) SetDropSizeHistory added in v0.7.5

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

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

func (*JetStorageMock) SetDropSizeHistoryFinished added in v0.7.5

func (m *JetStorageMock) SetDropSizeHistoryFinished() bool

SetDropSizeHistoryFinished returns true if mock invocations count is ok

func (*JetStorageMock) SetDropSizeHistoryMinimockCounter added in v0.7.5

func (m *JetStorageMock) SetDropSizeHistoryMinimockCounter() uint64

SetDropSizeHistoryMinimockCounter returns a count of JetStorageMock.SetDropSizeHistoryFunc invocations

func (*JetStorageMock) SetDropSizeHistoryMinimockPreCounter added in v0.7.5

func (m *JetStorageMock) SetDropSizeHistoryMinimockPreCounter() uint64

SetDropSizeHistoryMinimockPreCounter returns the value of JetStorageMock.SetDropSizeHistory invocations

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) (r error)

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 JetStorageMockAddDropSizeExpectation added in v0.7.5

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

func (*JetStorageMockAddDropSizeExpectation) Return added in v0.7.5

type JetStorageMockAddDropSizeInput added in v0.7.5

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

type JetStorageMockAddDropSizeResult added in v0.7.5

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

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 JetStorageMockCreateDropExpectation added in v0.7.5

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

func (*JetStorageMockCreateDropExpectation) Return added in v0.7.5

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

type JetStorageMockCreateDropInput added in v0.7.5

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

type JetStorageMockCreateDropResult added in v0.7.5

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

type JetStorageMockGetDropExpectation added in v0.7.5

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

func (*JetStorageMockGetDropExpectation) Return added in v0.7.5

type JetStorageMockGetDropInput added in v0.7.5

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

type JetStorageMockGetDropResult added in v0.7.5

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

type JetStorageMockGetDropSizeHistoryExpectation added in v0.7.5

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

func (*JetStorageMockGetDropSizeHistoryExpectation) Return added in v0.7.5

type JetStorageMockGetDropSizeHistoryInput added in v0.7.5

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

type JetStorageMockGetDropSizeHistoryResult added in v0.7.5

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

type JetStorageMockGetJetTreeExpectation added in v0.7.5

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

func (*JetStorageMockGetJetTreeExpectation) Return added in v0.7.5

type JetStorageMockGetJetTreeInput added in v0.7.5

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

type JetStorageMockGetJetTreeResult added in v0.7.5

type JetStorageMockGetJetTreeResult 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 JetStorageMockSetDropExpectation added in v0.7.5

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

func (*JetStorageMockSetDropExpectation) Return added in v0.7.5

type JetStorageMockSetDropInput added in v0.7.5

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

type JetStorageMockSetDropResult added in v0.7.5

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

type JetStorageMockSetDropSizeHistoryExpectation added in v0.7.5

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

func (*JetStorageMockSetDropSizeHistoryExpectation) Return added in v0.7.5

type JetStorageMockSetDropSizeHistoryInput added in v0.7.5

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

type JetStorageMockSetDropSizeHistoryResult added in v0.7.5

type JetStorageMockSetDropSizeHistoryResult 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
}

func (*JetStorageMockUpdateJetTreeExpectation) Return added in v0.7.5

type JetStorageMockUpdateJetTreeInput added in v0.7.5

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

type JetStorageMockUpdateJetTreeResult added in v0.7.5

type JetStorageMockUpdateJetTreeResult 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 Node added in v0.7.5

type Node struct {
	FID   core.RecordRef
	FRole core.StaticRole
}

func (Node) GetGlobuleID added in v0.7.5

func (Node) GetGlobuleID() core.GlobuleID

func (Node) ID added in v0.7.5

func (n Node) ID() core.RecordRef

func (Node) PhysicalAddress added in v0.7.5

func (Node) PhysicalAddress() string

func (Node) PublicKey added in v0.7.5

func (Node) PublicKey() crypto.PublicKey

func (Node) Role added in v0.7.5

func (n Node) Role() core.StaticRole

func (Node) ShortID added in v0.7.5

func (Node) ShortID() core.ShortNodeID

func (Node) Version added in v0.7.5

func (Node) Version() string

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

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)
	GetLatestPulse(ctx context.Context) (*Pulse, error)

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

PulseTracker allows to modify state of the pulse inside db

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

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

	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) 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) 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 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 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 RecentStorage added in v0.6.3

type RecentStorage struct {
	DefaultTTL int
	// contains filtered or unexported fields
}

RecentStorage is a base structure

func NewRecentStorage added in v0.6.3

func NewRecentStorage(jetID core.RecordID, defaultTTL int) *RecentStorage

NewRecentStorage creates default RecentStorage object

func (*RecentStorage) AddObject added in v0.6.3

func (r *RecentStorage) AddObject(ctx context.Context, id core.RecordID)

AddObject adds object to cache

func (*RecentStorage) AddObjectWithTLL added in v0.7.5

func (r *RecentStorage) AddObjectWithTLL(ctx context.Context, id core.RecordID, ttl int)

AddObjectWithTLL adds object with specified TTL to the cache

func (*RecentStorage) AddPendingRequest added in v0.6.3

func (r *RecentStorage) AddPendingRequest(ctx context.Context, obj, req core.RecordID)

AddPendingRequest adds request to cache.

func (*RecentStorage) DecreaseTTL added in v0.7.5

func (r *RecentStorage) DecreaseTTL(ctx context.Context)

DecreaseTTL decreases ttl and clears objects if their ttl is zero

func (*RecentStorage) GetObjects added in v0.6.3

func (r *RecentStorage) GetObjects() map[core.RecordID]int

GetObjects returns object hot-indexes.

func (*RecentStorage) GetRequests added in v0.6.3

func (r *RecentStorage) GetRequests() map[core.RecordID]map[core.RecordID]struct{}

GetRequests returns request hot-indexes.

func (*RecentStorage) GetRequestsForObject added in v0.7.5

func (r *RecentStorage) GetRequestsForObject(obj core.RecordID) []core.RecordID

GetRequestsForObject returns request hot-indexes for object.

func (*RecentStorage) IsRecordIDCached added in v0.7.5

func (r *RecentStorage) IsRecordIDCached(obj core.RecordID) bool

IsRecordIDCached checks recordID inside caches

func (*RecentStorage) RemovePendingRequest added in v0.6.3

func (r *RecentStorage) RemovePendingRequest(ctx context.Context, obj, req core.RecordID)

RemovePendingRequest removes request from cache.

type RecentStorageProvider added in v0.7.5

type RecentStorageProvider struct {
	DefaultTTL int
	// contains filtered or unexported fields
}

RecentStorageProvider provides a recent storage for jet

func NewRecentStorageProvider added in v0.7.5

func NewRecentStorageProvider(defaultTTL int) *RecentStorageProvider

NewRecentStorageProvider creates new provider

func (*RecentStorageProvider) CloneStorage added in v0.7.5

func (p *RecentStorageProvider) CloneStorage(ctx context.Context, fromJetID, toJetID core.RecordID)

CloneStorage clones a recent storage from one jet to another

func (*RecentStorageProvider) GetStorage added in v0.7.5

GetStorage returns a recent storage for jet

func (*RecentStorageProvider) RemoveStorage added in v0.7.5

func (p *RecentStorageProvider) RemoveStorage(ctx context.Context, id core.RecordID)

RemoveStorage removes storage from provider

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

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 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,
	j 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,
	j 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,
	j 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, j 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 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