Documentation ¶
Overview ¶
Package nodes contains node storage
Index ¶
- type Accessor
- type AccessorMock
- func (m *AccessorMock) All(p core.PulseNumber) (r []insolar.Node, r1 error)
- func (m *AccessorMock) AllFinished() bool
- func (m *AccessorMock) AllMinimockCounter() uint64
- func (m *AccessorMock) AllMinimockPreCounter() uint64
- func (m *AccessorMock) AllMocksCalled() bool
- func (m *AccessorMock) CheckMocksCalled()
- func (m *AccessorMock) Finish()
- func (m *AccessorMock) InRole(p core.PulseNumber, p1 core.StaticRole) (r []insolar.Node, r1 error)
- func (m *AccessorMock) InRoleFinished() bool
- func (m *AccessorMock) InRoleMinimockCounter() uint64
- func (m *AccessorMock) InRoleMinimockPreCounter() uint64
- func (m *AccessorMock) MinimockFinish()
- func (m *AccessorMock) MinimockWait(timeout time.Duration)
- func (m *AccessorMock) ValidateCallCounters()
- func (m *AccessorMock) Wait(timeout time.Duration)
- type AccessorMockAllExpectation
- type AccessorMockAllInput
- type AccessorMockAllResult
- type AccessorMockInRoleExpectation
- type AccessorMockInRoleInput
- type AccessorMockInRoleResult
- type Setter
- type SetterMock
- func (m *SetterMock) AllMocksCalled() bool
- func (m *SetterMock) CheckMocksCalled()
- func (m *SetterMock) Delete(p core.PulseNumber)
- func (m *SetterMock) DeleteFinished() bool
- func (m *SetterMock) DeleteMinimockCounter() uint64
- func (m *SetterMock) DeleteMinimockPreCounter() uint64
- func (m *SetterMock) Finish()
- func (m *SetterMock) MinimockFinish()
- func (m *SetterMock) MinimockWait(timeout time.Duration)
- func (m *SetterMock) Set(p core.PulseNumber, p1 []insolar.Node) (r error)
- func (m *SetterMock) SetFinished() bool
- func (m *SetterMock) SetMinimockCounter() uint64
- func (m *SetterMock) SetMinimockPreCounter() uint64
- func (m *SetterMock) ValidateCallCounters()
- func (m *SetterMock) Wait(timeout time.Duration)
- type SetterMockDeleteExpectation
- type SetterMockDeleteInput
- type SetterMockSetExpectation
- type SetterMockSetInput
- type SetterMockSetResult
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessor ¶
type Accessor interface { All(pulse core.PulseNumber) ([]insolar.Node, error) InRole(pulse core.PulseNumber, role core.StaticRole) ([]insolar.Node, error) }
Accessor provides info about active nodes.
type AccessorMock ¶
type AccessorMock struct { AllFunc func(p core.PulseNumber) (r []insolar.Node, r1 error) AllCounter uint64 AllPreCounter uint64 AllMock mAccessorMockAll InRoleFunc func(p core.PulseNumber, p1 core.StaticRole) (r []insolar.Node, r1 error) InRoleCounter uint64 InRolePreCounter uint64 InRoleMock mAccessorMockInRole // contains filtered or unexported fields }
AccessorMock implements github.com/insolar/insolar/ledger/storage/nodes.Accessor
func NewAccessorMock ¶
func NewAccessorMock(t minimock.Tester) *AccessorMock
NewAccessorMock returns a mock for github.com/insolar/insolar/ledger/storage/nodes.Accessor
func (*AccessorMock) All ¶
func (m *AccessorMock) All(p core.PulseNumber) (r []insolar.Node, r1 error)
All implements github.com/insolar/insolar/ledger/storage/nodes.Accessor interface
func (*AccessorMock) AllFinished ¶
func (m *AccessorMock) AllFinished() bool
AllFinished returns true if mock invocations count is ok
func (*AccessorMock) AllMinimockCounter ¶
func (m *AccessorMock) AllMinimockCounter() uint64
AllMinimockCounter returns a count of AccessorMock.AllFunc invocations
func (*AccessorMock) AllMinimockPreCounter ¶
func (m *AccessorMock) AllMinimockPreCounter() uint64
AllMinimockPreCounter returns the value of AccessorMock.All invocations
func (*AccessorMock) AllMocksCalled ¶
func (m *AccessorMock) 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 (*AccessorMock) CheckMocksCalled ¶
func (m *AccessorMock) 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 (*AccessorMock) Finish ¶
func (m *AccessorMock) 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 (*AccessorMock) InRole ¶
func (m *AccessorMock) InRole(p core.PulseNumber, p1 core.StaticRole) (r []insolar.Node, r1 error)
InRole implements github.com/insolar/insolar/ledger/storage/nodes.Accessor interface
func (*AccessorMock) InRoleFinished ¶
func (m *AccessorMock) InRoleFinished() bool
InRoleFinished returns true if mock invocations count is ok
func (*AccessorMock) InRoleMinimockCounter ¶
func (m *AccessorMock) InRoleMinimockCounter() uint64
InRoleMinimockCounter returns a count of AccessorMock.InRoleFunc invocations
func (*AccessorMock) InRoleMinimockPreCounter ¶
func (m *AccessorMock) InRoleMinimockPreCounter() uint64
InRoleMinimockPreCounter returns the value of AccessorMock.InRole invocations
func (*AccessorMock) MinimockFinish ¶
func (m *AccessorMock) MinimockFinish()
MinimockFinish checks that all mocked methods of the interface have been called at least once
func (*AccessorMock) MinimockWait ¶
func (m *AccessorMock) MinimockWait(timeout time.Duration)
MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller
func (*AccessorMock) ValidateCallCounters ¶
func (m *AccessorMock) 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 (*AccessorMock) Wait ¶
func (m *AccessorMock) 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 AccessorMockAllExpectation ¶
type AccessorMockAllExpectation struct {
// contains filtered or unexported fields
}
type AccessorMockAllInput ¶
type AccessorMockAllInput struct {
// contains filtered or unexported fields
}
type AccessorMockAllResult ¶
type AccessorMockAllResult struct {
// contains filtered or unexported fields
}
type AccessorMockInRoleExpectation ¶
type AccessorMockInRoleExpectation struct {
// contains filtered or unexported fields
}
type AccessorMockInRoleInput ¶
type AccessorMockInRoleInput struct {
// contains filtered or unexported fields
}
type AccessorMockInRoleResult ¶
type AccessorMockInRoleResult struct {
// contains filtered or unexported fields
}
type Setter ¶
type Setter interface { Set(pulse core.PulseNumber, nodes []insolar.Node) error Delete(pulse core.PulseNumber) }
Setter provides methods for setting active nodes.
type SetterMock ¶
type SetterMock struct { DeleteFunc func(p core.PulseNumber) DeleteCounter uint64 DeletePreCounter uint64 DeleteMock mSetterMockDelete SetFunc func(p core.PulseNumber, p1 []insolar.Node) (r error) SetCounter uint64 SetPreCounter uint64 SetMock mSetterMockSet // contains filtered or unexported fields }
SetterMock implements github.com/insolar/insolar/ledger/storage/nodes.Setter
func NewSetterMock ¶
func NewSetterMock(t minimock.Tester) *SetterMock
NewSetterMock returns a mock for github.com/insolar/insolar/ledger/storage/nodes.Setter
func (*SetterMock) AllMocksCalled ¶
func (m *SetterMock) 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 (*SetterMock) CheckMocksCalled ¶
func (m *SetterMock) 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 (*SetterMock) Delete ¶
func (m *SetterMock) Delete(p core.PulseNumber)
Delete implements github.com/insolar/insolar/ledger/storage/nodes.Setter interface
func (*SetterMock) DeleteFinished ¶
func (m *SetterMock) DeleteFinished() bool
DeleteFinished returns true if mock invocations count is ok
func (*SetterMock) DeleteMinimockCounter ¶
func (m *SetterMock) DeleteMinimockCounter() uint64
DeleteMinimockCounter returns a count of SetterMock.DeleteFunc invocations
func (*SetterMock) DeleteMinimockPreCounter ¶
func (m *SetterMock) DeleteMinimockPreCounter() uint64
DeleteMinimockPreCounter returns the value of SetterMock.Delete invocations
func (*SetterMock) Finish ¶
func (m *SetterMock) 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 (*SetterMock) MinimockFinish ¶
func (m *SetterMock) MinimockFinish()
MinimockFinish checks that all mocked methods of the interface have been called at least once
func (*SetterMock) MinimockWait ¶
func (m *SetterMock) MinimockWait(timeout time.Duration)
MinimockWait waits for all mocked methods to be called at least once this method is called by minimock.Controller
func (*SetterMock) Set ¶
func (m *SetterMock) Set(p core.PulseNumber, p1 []insolar.Node) (r error)
Set implements github.com/insolar/insolar/ledger/storage/nodes.Setter interface
func (*SetterMock) SetFinished ¶
func (m *SetterMock) SetFinished() bool
SetFinished returns true if mock invocations count is ok
func (*SetterMock) SetMinimockCounter ¶
func (m *SetterMock) SetMinimockCounter() uint64
SetMinimockCounter returns a count of SetterMock.SetFunc invocations
func (*SetterMock) SetMinimockPreCounter ¶
func (m *SetterMock) SetMinimockPreCounter() uint64
SetMinimockPreCounter returns the value of SetterMock.Set invocations
func (*SetterMock) ValidateCallCounters ¶
func (m *SetterMock) 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 (*SetterMock) Wait ¶
func (m *SetterMock) 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 SetterMockDeleteExpectation ¶
type SetterMockDeleteExpectation struct {
// contains filtered or unexported fields
}
type SetterMockDeleteInput ¶
type SetterMockDeleteInput struct {
// contains filtered or unexported fields
}
type SetterMockSetExpectation ¶
type SetterMockSetExpectation struct {
// contains filtered or unexported fields
}
func (*SetterMockSetExpectation) Return ¶
func (e *SetterMockSetExpectation) Return(r error)
type SetterMockSetInput ¶
type SetterMockSetInput struct {
// contains filtered or unexported fields
}
type SetterMockSetResult ¶
type SetterMockSetResult struct {
// contains filtered or unexported fields
}
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an in-memory active node storage for each pulse. It's required to calculate node roles for past pulses to locate data. It should only contain previous N pulses. It should be stored on disk.
func (*Storage) Delete ¶
func (a *Storage) Delete(pulse core.PulseNumber)
Delete erases nodes for specified pulse.
func (*Storage) InRole ¶
func (a *Storage) InRole(pulse core.PulseNumber, role core.StaticRole) ([]insolar.Node, error)
InRole return active nodes for specified pulse and role.