jet

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package jet provides objects and interfaces for working with Jet objects.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthJet = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowJet   = fmt.Errorf("proto: integer overflow")
)

Functions

func NewIDFromString

func NewIDFromString(s string) insolar.JetID

NewIDFromString creates new JetID from string represents binary prefix.

"0" -> prefix=[0..0], depth=1 "1" -> prefix=[1..0], depth=1 "1010" -> prefix=[1010..0], depth=4

func Parent

func Parent(id insolar.JetID) insolar.JetID

Parent returns a parent of the jet or jet itself if depth of provided JetID is zero.

func Siblings

func Siblings(id insolar.JetID) (insolar.JetID, insolar.JetID)

Siblings calculates left and right siblings for provided jet.

Types

type Accessor

type Accessor interface {
	// All returns all jet from jet tree for provided pulse.
	All(ctx context.Context, pulse insolar.PulseNumber) []insolar.JetID
	// ForID finds jet in jet tree for provided pulse and object.
	// Always returns jet id and activity flag for this jet.
	ForID(ctx context.Context, pulse insolar.PulseNumber, recordID insolar.ID) (insolar.JetID, bool)
}

Accessor provides an interface for accessing jet IDs.

type AccessorMock

type AccessorMock struct {
	AllMock mAccessorMockAll

	ForIDMock mAccessorMockForID
	// contains filtered or unexported fields
}

AccessorMock implements Accessor

func NewAccessorMock

func NewAccessorMock(t minimock.Tester) *AccessorMock

NewAccessorMock returns a mock for Accessor

func (*AccessorMock) All

func (mmAll *AccessorMock) All(ctx context.Context, pulse insolar.PulseNumber) (ja1 []insolar.JetID)

All implements Accessor

func (*AccessorMock) AllAfterCounter

func (mmAll *AccessorMock) AllAfterCounter() uint64

AllAfterCounter returns a count of finished AccessorMock.All invocations

func (*AccessorMock) AllBeforeCounter

func (mmAll *AccessorMock) AllBeforeCounter() uint64

AllBeforeCounter returns a count of AccessorMock.All invocations

func (*AccessorMock) ForID

func (mmForID *AccessorMock) ForID(ctx context.Context, pulse insolar.PulseNumber, recordID insolar.ID) (j1 insolar.JetID, b1 bool)

ForID implements Accessor

func (*AccessorMock) ForIDAfterCounter

func (mmForID *AccessorMock) ForIDAfterCounter() uint64

ForIDAfterCounter returns a count of finished AccessorMock.ForID invocations

func (*AccessorMock) ForIDBeforeCounter

func (mmForID *AccessorMock) ForIDBeforeCounter() uint64

ForIDBeforeCounter returns a count of AccessorMock.ForID invocations

func (*AccessorMock) MinimockAllDone

func (m *AccessorMock) MinimockAllDone() bool

MinimockAllDone returns true if the count of the All invocations corresponds the number of defined expectations

func (*AccessorMock) MinimockAllInspect

func (m *AccessorMock) MinimockAllInspect()

MinimockAllInspect logs each unmet expectation

func (*AccessorMock) MinimockFinish

func (m *AccessorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*AccessorMock) MinimockForIDDone

func (m *AccessorMock) MinimockForIDDone() bool

MinimockForIDDone returns true if the count of the ForID invocations corresponds the number of defined expectations

func (*AccessorMock) MinimockForIDInspect

func (m *AccessorMock) MinimockForIDInspect()

MinimockForIDInspect logs each unmet expectation

func (*AccessorMock) MinimockWait

func (m *AccessorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type AccessorMockAllExpectation

type AccessorMockAllExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AccessorMockAllExpectation specifies expectation struct of the Accessor.All

func (*AccessorMockAllExpectation) Then

Then sets up Accessor.All return parameters for the expectation previously defined by the When method

type AccessorMockAllParams

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

AccessorMockAllParams contains parameters of the Accessor.All

type AccessorMockAllResults

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

AccessorMockAllResults contains results of the Accessor.All

type AccessorMockForIDExpectation

type AccessorMockForIDExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

AccessorMockForIDExpectation specifies expectation struct of the Accessor.ForID

func (*AccessorMockForIDExpectation) Then

Then sets up Accessor.ForID return parameters for the expectation previously defined by the When method

type AccessorMockForIDParams

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

AccessorMockForIDParams contains parameters of the Accessor.ForID

type AccessorMockForIDResults

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

AccessorMockForIDResults contains results of the Accessor.ForID

type Cleaner

type Cleaner interface {
	// Delete jets for pulse (concurrent safe).
	DeleteForPN(ctx context.Context, pulse insolar.PulseNumber)
}

Cleaner provides an interface for removing jet.Tree from a storage.

type CleanerMock

type CleanerMock struct {
	DeleteForPNFunc       func(p context.Context, p1 insolar.PulseNumber)
	DeleteForPNCounter    uint64
	DeleteForPNPreCounter uint64
	DeleteForPNMock       mCleanerMockDeleteForPN
	// contains filtered or unexported fields
}

CleanerMock implements github.com/insolar/insolar/insolar/jet.Cleaner

func NewCleanerMock

func NewCleanerMock(t minimock.Tester) *CleanerMock

NewCleanerMock returns a mock for github.com/insolar/insolar/insolar/jet.Cleaner

func (*CleanerMock) AllMocksCalled

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

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

func (m *CleanerMock) DeleteForPN(p context.Context, p1 insolar.PulseNumber)

DeleteForPN implements github.com/insolar/insolar/insolar/jet.Cleaner interface

func (*CleanerMock) DeleteForPNFinished

func (m *CleanerMock) DeleteForPNFinished() bool

DeleteForPNFinished returns true if mock invocations count is ok

func (*CleanerMock) DeleteForPNMinimockCounter

func (m *CleanerMock) DeleteForPNMinimockCounter() uint64

DeleteForPNMinimockCounter returns a count of CleanerMock.DeleteForPNFunc invocations

func (*CleanerMock) DeleteForPNMinimockPreCounter

func (m *CleanerMock) DeleteForPNMinimockPreCounter() uint64

DeleteForPNMinimockPreCounter returns the value of CleanerMock.DeleteForPN invocations

func (*CleanerMock) Finish

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

func (m *CleanerMock) MinimockFinish()

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

func (*CleanerMock) MinimockWait

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

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

func (*CleanerMock) ValidateCallCounters

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

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 CleanerMockDeleteForPNExpectation

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

type CleanerMockDeleteForPNInput

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

type Coordinator

type Coordinator interface {
	// Me returns current node.
	Me() insolar.Reference

	// IsAuthorized checks for role on concrete pulse for the address.
	IsAuthorized(ctx context.Context, role insolar.DynamicRole, obj insolar.ID, pulse insolar.PulseNumber, node insolar.Reference) (bool, error)

	// IsMeAuthorizedNow checks role of the current node in the current pulse for the address. Sugar for IsAuthorized.
	IsMeAuthorizedNow(ctx context.Context, role insolar.DynamicRole, obj insolar.ID) (bool, error)

	// QueryRole returns node refs responsible for role bound operations for given object and pulse.
	QueryRole(ctx context.Context, role insolar.DynamicRole, obj insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)

	VirtualExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
	VirtualValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)

	LightExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
	LightValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)
	// LightExecutorForJet calculates light material executor for provided jet.
	LightExecutorForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) (*insolar.Reference, error)
	LightValidatorsForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) ([]insolar.Reference, error)

	Heavy(ctx context.Context) (*insolar.Reference, error)

	IsBeyondLimit(ctx context.Context, targetPN insolar.PulseNumber) (bool, error)
	NodeForJet(ctx context.Context, jetID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)

	// NodeForObject calculates a node (LME or heavy) for a specific jet for a specific pulseNumber
	NodeForObject(ctx context.Context, objectID insolar.ID, targetPN insolar.PulseNumber) (*insolar.Reference, error)
}

Coordinator provides methods for calculating Jet affinity (e.g. to which Jet a message should be sent).

type CoordinatorMock

type CoordinatorMock struct {
	HeavyMock mCoordinatorMockHeavy

	IsAuthorizedMock mCoordinatorMockIsAuthorized

	IsBeyondLimitMock mCoordinatorMockIsBeyondLimit

	IsMeAuthorizedNowMock mCoordinatorMockIsMeAuthorizedNow

	LightExecutorForJetMock mCoordinatorMockLightExecutorForJet

	LightExecutorForObjectMock mCoordinatorMockLightExecutorForObject

	LightValidatorsForJetMock mCoordinatorMockLightValidatorsForJet

	LightValidatorsForObjectMock mCoordinatorMockLightValidatorsForObject

	MeMock mCoordinatorMockMe

	NodeForJetMock mCoordinatorMockNodeForJet

	NodeForObjectMock mCoordinatorMockNodeForObject

	QueryRoleMock mCoordinatorMockQueryRole

	VirtualExecutorForObjectMock mCoordinatorMockVirtualExecutorForObject

	VirtualValidatorsForObjectMock mCoordinatorMockVirtualValidatorsForObject
	// contains filtered or unexported fields
}

CoordinatorMock implements Coordinator

func NewCoordinatorMock

func NewCoordinatorMock(t minimock.Tester) *CoordinatorMock

NewCoordinatorMock returns a mock for Coordinator

func (*CoordinatorMock) Heavy

func (mmHeavy *CoordinatorMock) Heavy(ctx context.Context) (rp1 *insolar.Reference, err error)

Heavy implements Coordinator

func (*CoordinatorMock) HeavyAfterCounter

func (mmHeavy *CoordinatorMock) HeavyAfterCounter() uint64

HeavyAfterCounter returns a count of finished CoordinatorMock.Heavy invocations

func (*CoordinatorMock) HeavyBeforeCounter

func (mmHeavy *CoordinatorMock) HeavyBeforeCounter() uint64

HeavyBeforeCounter returns a count of CoordinatorMock.Heavy invocations

func (*CoordinatorMock) IsAuthorized

func (mmIsAuthorized *CoordinatorMock) IsAuthorized(ctx context.Context, role insolar.DynamicRole, obj insolar.ID, pulse insolar.PulseNumber, node insolar.Reference) (b1 bool, err error)

IsAuthorized implements Coordinator

func (*CoordinatorMock) IsAuthorizedAfterCounter

func (mmIsAuthorized *CoordinatorMock) IsAuthorizedAfterCounter() uint64

IsAuthorizedAfterCounter returns a count of finished CoordinatorMock.IsAuthorized invocations

func (*CoordinatorMock) IsAuthorizedBeforeCounter

func (mmIsAuthorized *CoordinatorMock) IsAuthorizedBeforeCounter() uint64

IsAuthorizedBeforeCounter returns a count of CoordinatorMock.IsAuthorized invocations

func (*CoordinatorMock) IsBeyondLimit

func (mmIsBeyondLimit *CoordinatorMock) IsBeyondLimit(ctx context.Context, targetPN insolar.PulseNumber) (b1 bool, err error)

IsBeyondLimit implements Coordinator

func (*CoordinatorMock) IsBeyondLimitAfterCounter

func (mmIsBeyondLimit *CoordinatorMock) IsBeyondLimitAfterCounter() uint64

IsBeyondLimitAfterCounter returns a count of finished CoordinatorMock.IsBeyondLimit invocations

func (*CoordinatorMock) IsBeyondLimitBeforeCounter

func (mmIsBeyondLimit *CoordinatorMock) IsBeyondLimitBeforeCounter() uint64

IsBeyondLimitBeforeCounter returns a count of CoordinatorMock.IsBeyondLimit invocations

func (*CoordinatorMock) IsMeAuthorizedNow

func (mmIsMeAuthorizedNow *CoordinatorMock) IsMeAuthorizedNow(ctx context.Context, role insolar.DynamicRole, obj insolar.ID) (b1 bool, err error)

IsMeAuthorizedNow implements Coordinator

func (*CoordinatorMock) IsMeAuthorizedNowAfterCounter

func (mmIsMeAuthorizedNow *CoordinatorMock) IsMeAuthorizedNowAfterCounter() uint64

IsMeAuthorizedNowAfterCounter returns a count of finished CoordinatorMock.IsMeAuthorizedNow invocations

func (*CoordinatorMock) IsMeAuthorizedNowBeforeCounter

func (mmIsMeAuthorizedNow *CoordinatorMock) IsMeAuthorizedNowBeforeCounter() uint64

IsMeAuthorizedNowBeforeCounter returns a count of CoordinatorMock.IsMeAuthorizedNow invocations

func (*CoordinatorMock) LightExecutorForJet

func (mmLightExecutorForJet *CoordinatorMock) LightExecutorForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) (rp1 *insolar.Reference, err error)

LightExecutorForJet implements Coordinator

func (*CoordinatorMock) LightExecutorForJetAfterCounter

func (mmLightExecutorForJet *CoordinatorMock) LightExecutorForJetAfterCounter() uint64

LightExecutorForJetAfterCounter returns a count of finished CoordinatorMock.LightExecutorForJet invocations

func (*CoordinatorMock) LightExecutorForJetBeforeCounter

func (mmLightExecutorForJet *CoordinatorMock) LightExecutorForJetBeforeCounter() uint64

LightExecutorForJetBeforeCounter returns a count of CoordinatorMock.LightExecutorForJet invocations

func (*CoordinatorMock) LightExecutorForObject

func (mmLightExecutorForObject *CoordinatorMock) LightExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (rp1 *insolar.Reference, err error)

LightExecutorForObject implements Coordinator

func (*CoordinatorMock) LightExecutorForObjectAfterCounter

func (mmLightExecutorForObject *CoordinatorMock) LightExecutorForObjectAfterCounter() uint64

LightExecutorForObjectAfterCounter returns a count of finished CoordinatorMock.LightExecutorForObject invocations

func (*CoordinatorMock) LightExecutorForObjectBeforeCounter

func (mmLightExecutorForObject *CoordinatorMock) LightExecutorForObjectBeforeCounter() uint64

LightExecutorForObjectBeforeCounter returns a count of CoordinatorMock.LightExecutorForObject invocations

func (*CoordinatorMock) LightValidatorsForJet

func (mmLightValidatorsForJet *CoordinatorMock) LightValidatorsForJet(ctx context.Context, jetID insolar.ID, pulse insolar.PulseNumber) (ra1 []insolar.Reference, err error)

LightValidatorsForJet implements Coordinator

func (*CoordinatorMock) LightValidatorsForJetAfterCounter

func (mmLightValidatorsForJet *CoordinatorMock) LightValidatorsForJetAfterCounter() uint64

LightValidatorsForJetAfterCounter returns a count of finished CoordinatorMock.LightValidatorsForJet invocations

func (*CoordinatorMock) LightValidatorsForJetBeforeCounter

func (mmLightValidatorsForJet *CoordinatorMock) LightValidatorsForJetBeforeCounter() uint64

LightValidatorsForJetBeforeCounter returns a count of CoordinatorMock.LightValidatorsForJet invocations

func (*CoordinatorMock) LightValidatorsForObject

func (mmLightValidatorsForObject *CoordinatorMock) LightValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (ra1 []insolar.Reference, err error)

LightValidatorsForObject implements Coordinator

func (*CoordinatorMock) LightValidatorsForObjectAfterCounter

func (mmLightValidatorsForObject *CoordinatorMock) LightValidatorsForObjectAfterCounter() uint64

LightValidatorsForObjectAfterCounter returns a count of finished CoordinatorMock.LightValidatorsForObject invocations

func (*CoordinatorMock) LightValidatorsForObjectBeforeCounter

func (mmLightValidatorsForObject *CoordinatorMock) LightValidatorsForObjectBeforeCounter() uint64

LightValidatorsForObjectBeforeCounter returns a count of CoordinatorMock.LightValidatorsForObject invocations

func (*CoordinatorMock) Me

func (mmMe *CoordinatorMock) Me() (r1 insolar.Reference)

Me implements Coordinator

func (*CoordinatorMock) MeAfterCounter

func (mmMe *CoordinatorMock) MeAfterCounter() uint64

MeAfterCounter returns a count of finished CoordinatorMock.Me invocations

func (*CoordinatorMock) MeBeforeCounter

func (mmMe *CoordinatorMock) MeBeforeCounter() uint64

MeBeforeCounter returns a count of CoordinatorMock.Me invocations

func (*CoordinatorMock) MinimockFinish

func (m *CoordinatorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*CoordinatorMock) MinimockHeavyDone

func (m *CoordinatorMock) MinimockHeavyDone() bool

MinimockHeavyDone returns true if the count of the Heavy invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockHeavyInspect

func (m *CoordinatorMock) MinimockHeavyInspect()

MinimockHeavyInspect logs each unmet expectation

func (*CoordinatorMock) MinimockIsAuthorizedDone

func (m *CoordinatorMock) MinimockIsAuthorizedDone() bool

MinimockIsAuthorizedDone returns true if the count of the IsAuthorized invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockIsAuthorizedInspect

func (m *CoordinatorMock) MinimockIsAuthorizedInspect()

MinimockIsAuthorizedInspect logs each unmet expectation

func (*CoordinatorMock) MinimockIsBeyondLimitDone

func (m *CoordinatorMock) MinimockIsBeyondLimitDone() bool

MinimockIsBeyondLimitDone returns true if the count of the IsBeyondLimit invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockIsBeyondLimitInspect

func (m *CoordinatorMock) MinimockIsBeyondLimitInspect()

MinimockIsBeyondLimitInspect logs each unmet expectation

func (*CoordinatorMock) MinimockIsMeAuthorizedNowDone

func (m *CoordinatorMock) MinimockIsMeAuthorizedNowDone() bool

MinimockIsMeAuthorizedNowDone returns true if the count of the IsMeAuthorizedNow invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockIsMeAuthorizedNowInspect

func (m *CoordinatorMock) MinimockIsMeAuthorizedNowInspect()

MinimockIsMeAuthorizedNowInspect logs each unmet expectation

func (*CoordinatorMock) MinimockLightExecutorForJetDone

func (m *CoordinatorMock) MinimockLightExecutorForJetDone() bool

MinimockLightExecutorForJetDone returns true if the count of the LightExecutorForJet invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockLightExecutorForJetInspect

func (m *CoordinatorMock) MinimockLightExecutorForJetInspect()

MinimockLightExecutorForJetInspect logs each unmet expectation

func (*CoordinatorMock) MinimockLightExecutorForObjectDone

func (m *CoordinatorMock) MinimockLightExecutorForObjectDone() bool

MinimockLightExecutorForObjectDone returns true if the count of the LightExecutorForObject invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockLightExecutorForObjectInspect

func (m *CoordinatorMock) MinimockLightExecutorForObjectInspect()

MinimockLightExecutorForObjectInspect logs each unmet expectation

func (*CoordinatorMock) MinimockLightValidatorsForJetDone

func (m *CoordinatorMock) MinimockLightValidatorsForJetDone() bool

MinimockLightValidatorsForJetDone returns true if the count of the LightValidatorsForJet invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockLightValidatorsForJetInspect

func (m *CoordinatorMock) MinimockLightValidatorsForJetInspect()

MinimockLightValidatorsForJetInspect logs each unmet expectation

func (*CoordinatorMock) MinimockLightValidatorsForObjectDone

func (m *CoordinatorMock) MinimockLightValidatorsForObjectDone() bool

MinimockLightValidatorsForObjectDone returns true if the count of the LightValidatorsForObject invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockLightValidatorsForObjectInspect

func (m *CoordinatorMock) MinimockLightValidatorsForObjectInspect()

MinimockLightValidatorsForObjectInspect logs each unmet expectation

func (*CoordinatorMock) MinimockMeDone

func (m *CoordinatorMock) MinimockMeDone() bool

MinimockMeDone returns true if the count of the Me invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockMeInspect

func (m *CoordinatorMock) MinimockMeInspect()

MinimockMeInspect logs each unmet expectation

func (*CoordinatorMock) MinimockNodeForJetDone

func (m *CoordinatorMock) MinimockNodeForJetDone() bool

MinimockNodeForJetDone returns true if the count of the NodeForJet invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockNodeForJetInspect

func (m *CoordinatorMock) MinimockNodeForJetInspect()

MinimockNodeForJetInspect logs each unmet expectation

func (*CoordinatorMock) MinimockNodeForObjectDone

func (m *CoordinatorMock) MinimockNodeForObjectDone() bool

MinimockNodeForObjectDone returns true if the count of the NodeForObject invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockNodeForObjectInspect

func (m *CoordinatorMock) MinimockNodeForObjectInspect()

MinimockNodeForObjectInspect logs each unmet expectation

func (*CoordinatorMock) MinimockQueryRoleDone

func (m *CoordinatorMock) MinimockQueryRoleDone() bool

MinimockQueryRoleDone returns true if the count of the QueryRole invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockQueryRoleInspect

func (m *CoordinatorMock) MinimockQueryRoleInspect()

MinimockQueryRoleInspect logs each unmet expectation

func (*CoordinatorMock) MinimockVirtualExecutorForObjectDone

func (m *CoordinatorMock) MinimockVirtualExecutorForObjectDone() bool

MinimockVirtualExecutorForObjectDone returns true if the count of the VirtualExecutorForObject invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockVirtualExecutorForObjectInspect

func (m *CoordinatorMock) MinimockVirtualExecutorForObjectInspect()

MinimockVirtualExecutorForObjectInspect logs each unmet expectation

func (*CoordinatorMock) MinimockVirtualValidatorsForObjectDone

func (m *CoordinatorMock) MinimockVirtualValidatorsForObjectDone() bool

MinimockVirtualValidatorsForObjectDone returns true if the count of the VirtualValidatorsForObject invocations corresponds the number of defined expectations

func (*CoordinatorMock) MinimockVirtualValidatorsForObjectInspect

func (m *CoordinatorMock) MinimockVirtualValidatorsForObjectInspect()

MinimockVirtualValidatorsForObjectInspect logs each unmet expectation

func (*CoordinatorMock) MinimockWait

func (m *CoordinatorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*CoordinatorMock) NodeForJet

func (mmNodeForJet *CoordinatorMock) NodeForJet(ctx context.Context, jetID insolar.ID, targetPN insolar.PulseNumber) (rp1 *insolar.Reference, err error)

NodeForJet implements Coordinator

func (*CoordinatorMock) NodeForJetAfterCounter

func (mmNodeForJet *CoordinatorMock) NodeForJetAfterCounter() uint64

NodeForJetAfterCounter returns a count of finished CoordinatorMock.NodeForJet invocations

func (*CoordinatorMock) NodeForJetBeforeCounter

func (mmNodeForJet *CoordinatorMock) NodeForJetBeforeCounter() uint64

NodeForJetBeforeCounter returns a count of CoordinatorMock.NodeForJet invocations

func (*CoordinatorMock) NodeForObject

func (mmNodeForObject *CoordinatorMock) NodeForObject(ctx context.Context, objectID insolar.ID, targetPN insolar.PulseNumber) (rp1 *insolar.Reference, err error)

NodeForObject implements Coordinator

func (*CoordinatorMock) NodeForObjectAfterCounter

func (mmNodeForObject *CoordinatorMock) NodeForObjectAfterCounter() uint64

NodeForObjectAfterCounter returns a count of finished CoordinatorMock.NodeForObject invocations

func (*CoordinatorMock) NodeForObjectBeforeCounter

func (mmNodeForObject *CoordinatorMock) NodeForObjectBeforeCounter() uint64

NodeForObjectBeforeCounter returns a count of CoordinatorMock.NodeForObject invocations

func (*CoordinatorMock) QueryRole

func (mmQueryRole *CoordinatorMock) QueryRole(ctx context.Context, role insolar.DynamicRole, obj insolar.ID, pulse insolar.PulseNumber) (ra1 []insolar.Reference, err error)

QueryRole implements Coordinator

func (*CoordinatorMock) QueryRoleAfterCounter

func (mmQueryRole *CoordinatorMock) QueryRoleAfterCounter() uint64

QueryRoleAfterCounter returns a count of finished CoordinatorMock.QueryRole invocations

func (*CoordinatorMock) QueryRoleBeforeCounter

func (mmQueryRole *CoordinatorMock) QueryRoleBeforeCounter() uint64

QueryRoleBeforeCounter returns a count of CoordinatorMock.QueryRole invocations

func (*CoordinatorMock) VirtualExecutorForObject

func (mmVirtualExecutorForObject *CoordinatorMock) VirtualExecutorForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (rp1 *insolar.Reference, err error)

VirtualExecutorForObject implements Coordinator

func (*CoordinatorMock) VirtualExecutorForObjectAfterCounter

func (mmVirtualExecutorForObject *CoordinatorMock) VirtualExecutorForObjectAfterCounter() uint64

VirtualExecutorForObjectAfterCounter returns a count of finished CoordinatorMock.VirtualExecutorForObject invocations

func (*CoordinatorMock) VirtualExecutorForObjectBeforeCounter

func (mmVirtualExecutorForObject *CoordinatorMock) VirtualExecutorForObjectBeforeCounter() uint64

VirtualExecutorForObjectBeforeCounter returns a count of CoordinatorMock.VirtualExecutorForObject invocations

func (*CoordinatorMock) VirtualValidatorsForObject

func (mmVirtualValidatorsForObject *CoordinatorMock) VirtualValidatorsForObject(ctx context.Context, objID insolar.ID, pulse insolar.PulseNumber) (ra1 []insolar.Reference, err error)

VirtualValidatorsForObject implements Coordinator

func (*CoordinatorMock) VirtualValidatorsForObjectAfterCounter

func (mmVirtualValidatorsForObject *CoordinatorMock) VirtualValidatorsForObjectAfterCounter() uint64

VirtualValidatorsForObjectAfterCounter returns a count of finished CoordinatorMock.VirtualValidatorsForObject invocations

func (*CoordinatorMock) VirtualValidatorsForObjectBeforeCounter

func (mmVirtualValidatorsForObject *CoordinatorMock) VirtualValidatorsForObjectBeforeCounter() uint64

VirtualValidatorsForObjectBeforeCounter returns a count of CoordinatorMock.VirtualValidatorsForObject invocations

type CoordinatorMockHeavyExpectation

type CoordinatorMockHeavyExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockHeavyExpectation specifies expectation struct of the Coordinator.Heavy

func (*CoordinatorMockHeavyExpectation) Then

Then sets up Coordinator.Heavy return parameters for the expectation previously defined by the When method

type CoordinatorMockHeavyParams

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

CoordinatorMockHeavyParams contains parameters of the Coordinator.Heavy

type CoordinatorMockHeavyResults

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

CoordinatorMockHeavyResults contains results of the Coordinator.Heavy

type CoordinatorMockIsAuthorizedExpectation

type CoordinatorMockIsAuthorizedExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockIsAuthorizedExpectation specifies expectation struct of the Coordinator.IsAuthorized

func (*CoordinatorMockIsAuthorizedExpectation) Then

Then sets up Coordinator.IsAuthorized return parameters for the expectation previously defined by the When method

type CoordinatorMockIsAuthorizedParams

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

CoordinatorMockIsAuthorizedParams contains parameters of the Coordinator.IsAuthorized

type CoordinatorMockIsAuthorizedResults

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

CoordinatorMockIsAuthorizedResults contains results of the Coordinator.IsAuthorized

type CoordinatorMockIsBeyondLimitExpectation

type CoordinatorMockIsBeyondLimitExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockIsBeyondLimitExpectation specifies expectation struct of the Coordinator.IsBeyondLimit

func (*CoordinatorMockIsBeyondLimitExpectation) Then

Then sets up Coordinator.IsBeyondLimit return parameters for the expectation previously defined by the When method

type CoordinatorMockIsBeyondLimitParams

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

CoordinatorMockIsBeyondLimitParams contains parameters of the Coordinator.IsBeyondLimit

type CoordinatorMockIsBeyondLimitResults

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

CoordinatorMockIsBeyondLimitResults contains results of the Coordinator.IsBeyondLimit

type CoordinatorMockIsMeAuthorizedNowExpectation

type CoordinatorMockIsMeAuthorizedNowExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockIsMeAuthorizedNowExpectation specifies expectation struct of the Coordinator.IsMeAuthorizedNow

func (*CoordinatorMockIsMeAuthorizedNowExpectation) Then

Then sets up Coordinator.IsMeAuthorizedNow return parameters for the expectation previously defined by the When method

type CoordinatorMockIsMeAuthorizedNowParams

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

CoordinatorMockIsMeAuthorizedNowParams contains parameters of the Coordinator.IsMeAuthorizedNow

type CoordinatorMockIsMeAuthorizedNowResults

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

CoordinatorMockIsMeAuthorizedNowResults contains results of the Coordinator.IsMeAuthorizedNow

type CoordinatorMockLightExecutorForJetExpectation

type CoordinatorMockLightExecutorForJetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockLightExecutorForJetExpectation specifies expectation struct of the Coordinator.LightExecutorForJet

func (*CoordinatorMockLightExecutorForJetExpectation) Then

Then sets up Coordinator.LightExecutorForJet return parameters for the expectation previously defined by the When method

type CoordinatorMockLightExecutorForJetParams

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

CoordinatorMockLightExecutorForJetParams contains parameters of the Coordinator.LightExecutorForJet

type CoordinatorMockLightExecutorForJetResults

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

CoordinatorMockLightExecutorForJetResults contains results of the Coordinator.LightExecutorForJet

type CoordinatorMockLightExecutorForObjectExpectation

type CoordinatorMockLightExecutorForObjectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockLightExecutorForObjectExpectation specifies expectation struct of the Coordinator.LightExecutorForObject

func (*CoordinatorMockLightExecutorForObjectExpectation) Then

Then sets up Coordinator.LightExecutorForObject return parameters for the expectation previously defined by the When method

type CoordinatorMockLightExecutorForObjectParams

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

CoordinatorMockLightExecutorForObjectParams contains parameters of the Coordinator.LightExecutorForObject

type CoordinatorMockLightExecutorForObjectResults

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

CoordinatorMockLightExecutorForObjectResults contains results of the Coordinator.LightExecutorForObject

type CoordinatorMockLightValidatorsForJetExpectation

type CoordinatorMockLightValidatorsForJetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockLightValidatorsForJetExpectation specifies expectation struct of the Coordinator.LightValidatorsForJet

func (*CoordinatorMockLightValidatorsForJetExpectation) Then

Then sets up Coordinator.LightValidatorsForJet return parameters for the expectation previously defined by the When method

type CoordinatorMockLightValidatorsForJetParams

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

CoordinatorMockLightValidatorsForJetParams contains parameters of the Coordinator.LightValidatorsForJet

type CoordinatorMockLightValidatorsForJetResults

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

CoordinatorMockLightValidatorsForJetResults contains results of the Coordinator.LightValidatorsForJet

type CoordinatorMockLightValidatorsForObjectExpectation

type CoordinatorMockLightValidatorsForObjectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockLightValidatorsForObjectExpectation specifies expectation struct of the Coordinator.LightValidatorsForObject

func (*CoordinatorMockLightValidatorsForObjectExpectation) Then

Then sets up Coordinator.LightValidatorsForObject return parameters for the expectation previously defined by the When method

type CoordinatorMockLightValidatorsForObjectParams

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

CoordinatorMockLightValidatorsForObjectParams contains parameters of the Coordinator.LightValidatorsForObject

type CoordinatorMockLightValidatorsForObjectResults

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

CoordinatorMockLightValidatorsForObjectResults contains results of the Coordinator.LightValidatorsForObject

type CoordinatorMockMeExpectation

type CoordinatorMockMeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockMeExpectation specifies expectation struct of the Coordinator.Me

type CoordinatorMockMeResults

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

CoordinatorMockMeResults contains results of the Coordinator.Me

type CoordinatorMockNodeForJetExpectation

type CoordinatorMockNodeForJetExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockNodeForJetExpectation specifies expectation struct of the Coordinator.NodeForJet

func (*CoordinatorMockNodeForJetExpectation) Then

Then sets up Coordinator.NodeForJet return parameters for the expectation previously defined by the When method

type CoordinatorMockNodeForJetParams

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

CoordinatorMockNodeForJetParams contains parameters of the Coordinator.NodeForJet

type CoordinatorMockNodeForJetResults

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

CoordinatorMockNodeForJetResults contains results of the Coordinator.NodeForJet

type CoordinatorMockNodeForObjectExpectation

type CoordinatorMockNodeForObjectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockNodeForObjectExpectation specifies expectation struct of the Coordinator.NodeForObject

func (*CoordinatorMockNodeForObjectExpectation) Then

Then sets up Coordinator.NodeForObject return parameters for the expectation previously defined by the When method

type CoordinatorMockNodeForObjectParams

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

CoordinatorMockNodeForObjectParams contains parameters of the Coordinator.NodeForObject

type CoordinatorMockNodeForObjectResults

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

CoordinatorMockNodeForObjectResults contains results of the Coordinator.NodeForObject

type CoordinatorMockQueryRoleExpectation

type CoordinatorMockQueryRoleExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockQueryRoleExpectation specifies expectation struct of the Coordinator.QueryRole

func (*CoordinatorMockQueryRoleExpectation) Then

Then sets up Coordinator.QueryRole return parameters for the expectation previously defined by the When method

type CoordinatorMockQueryRoleParams

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

CoordinatorMockQueryRoleParams contains parameters of the Coordinator.QueryRole

type CoordinatorMockQueryRoleResults

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

CoordinatorMockQueryRoleResults contains results of the Coordinator.QueryRole

type CoordinatorMockVirtualExecutorForObjectExpectation

type CoordinatorMockVirtualExecutorForObjectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockVirtualExecutorForObjectExpectation specifies expectation struct of the Coordinator.VirtualExecutorForObject

func (*CoordinatorMockVirtualExecutorForObjectExpectation) Then

Then sets up Coordinator.VirtualExecutorForObject return parameters for the expectation previously defined by the When method

type CoordinatorMockVirtualExecutorForObjectParams

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

CoordinatorMockVirtualExecutorForObjectParams contains parameters of the Coordinator.VirtualExecutorForObject

type CoordinatorMockVirtualExecutorForObjectResults

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

CoordinatorMockVirtualExecutorForObjectResults contains results of the Coordinator.VirtualExecutorForObject

type CoordinatorMockVirtualValidatorsForObjectExpectation

type CoordinatorMockVirtualValidatorsForObjectExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CoordinatorMockVirtualValidatorsForObjectExpectation specifies expectation struct of the Coordinator.VirtualValidatorsForObject

func (*CoordinatorMockVirtualValidatorsForObjectExpectation) Then

Then sets up Coordinator.VirtualValidatorsForObject return parameters for the expectation previously defined by the When method

type CoordinatorMockVirtualValidatorsForObjectParams

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

CoordinatorMockVirtualValidatorsForObjectParams contains parameters of the Coordinator.VirtualValidatorsForObject

type CoordinatorMockVirtualValidatorsForObjectResults

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

CoordinatorMockVirtualValidatorsForObjectResults contains results of the Coordinator.VirtualValidatorsForObject

type DBStore

type DBStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDBStore

func NewDBStore(db store.DB) *DBStore

func (*DBStore) All

func (s *DBStore) All(ctx context.Context, pulse insolar.PulseNumber) []insolar.JetID

func (*DBStore) Clone

func (s *DBStore) Clone(ctx context.Context, from, to insolar.PulseNumber, keepActual bool) error

func (*DBStore) ForID

func (s *DBStore) ForID(ctx context.Context, pulse insolar.PulseNumber, recordID insolar.ID) (insolar.JetID, bool)

func (*DBStore) Split

func (*DBStore) TruncateHead

func (s *DBStore) TruncateHead(ctx context.Context, from insolar.PulseNumber) error

TruncateHead remove all records after lastPulse

func (*DBStore) Update

func (s *DBStore) Update(ctx context.Context, pulse insolar.PulseNumber, actual bool, ids ...insolar.JetID) error

type Jet

type Jet struct {
	Polymorph int32 `protobuf:"varint,16,opt,name=polymorph,proto3" json:"polymorph,omitempty"`
	Actual    bool  `protobuf:"varint,20,opt,name=Actual,proto3" json:"Actual,omitempty"`
	Left      *Jet  `protobuf:"bytes,21,opt,name=Left,proto3" json:"Left,omitempty"`
	Right     *Jet  `protobuf:"bytes,22,opt,name=Right,proto3" json:"Right,omitempty"`
}

func (*Jet) Clone

func (j *Jet) Clone(keep bool) *Jet

Clone clones tree either keeping actuality state or resetting it to false.

func (*Jet) Descriptor

func (*Jet) Descriptor() ([]byte, []int)

func (*Jet) Equal

func (this *Jet) Equal(that interface{}) bool

func (*Jet) ExtractLeafIDs

func (j *Jet) ExtractLeafIDs(ids *[]insolar.JetID, path []byte, depth uint8)

func (*Jet) Find

func (j *Jet) Find(val []byte, depth uint8) (*Jet, uint8)

Find returns jet for provided reference.

func (*Jet) GoString

func (this *Jet) GoString() string

func (*Jet) Marshal

func (m *Jet) Marshal() (dAtA []byte, err error)

func (*Jet) MarshalTo

func (m *Jet) MarshalTo(dAtA []byte) (int, error)

func (*Jet) ProtoMessage

func (*Jet) ProtoMessage()

func (*Jet) Reset

func (m *Jet) Reset()

func (*Jet) Size

func (m *Jet) Size() (n int)

func (*Jet) String

func (this *Jet) String() string

func (*Jet) Unmarshal

func (m *Jet) Unmarshal(dAtA []byte) error

func (*Jet) Update

func (j *Jet) Update(prefix []byte, setActual bool, maxDepth, depth uint8)

Update add missing tree branches for provided prefix.

func (*Jet) XXX_DiscardUnknown

func (m *Jet) XXX_DiscardUnknown()

func (*Jet) XXX_Marshal

func (m *Jet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Jet) XXX_Merge

func (m *Jet) XXX_Merge(src proto.Message)

func (*Jet) XXX_Size

func (m *Jet) XXX_Size() int

func (*Jet) XXX_Unmarshal

func (m *Jet) XXX_Unmarshal(b []byte) error

type Modifier

type Modifier interface {
	// Update updates jet tree for specified pulse.
	Update(ctx context.Context, pulse insolar.PulseNumber, actual bool, ids ...insolar.JetID) error
	// Split performs jet split and returns resulting jet ids. Always set Active flag to true for leafs.
	Split(ctx context.Context, pulse insolar.PulseNumber, id insolar.JetID) (insolar.JetID, insolar.JetID, error)
	// Clone copies tree from one pulse to another. Use it to copy the past tree into new pulse.
	Clone(ctx context.Context, from, to insolar.PulseNumber, keepActual bool) error
}

Modifier provides an interface for modifying jet IDs.

type ModifierMock

type ModifierMock struct {
	CloneMock mModifierMockClone

	SplitMock mModifierMockSplit

	UpdateMock mModifierMockUpdate
	// contains filtered or unexported fields
}

ModifierMock implements Modifier

func NewModifierMock

func NewModifierMock(t minimock.Tester) *ModifierMock

NewModifierMock returns a mock for Modifier

func (*ModifierMock) Clone

func (mmClone *ModifierMock) Clone(ctx context.Context, from insolar.PulseNumber, to insolar.PulseNumber, keepActual bool) (err error)

Clone implements Modifier

func (*ModifierMock) CloneAfterCounter

func (mmClone *ModifierMock) CloneAfterCounter() uint64

CloneAfterCounter returns a count of finished ModifierMock.Clone invocations

func (*ModifierMock) CloneBeforeCounter

func (mmClone *ModifierMock) CloneBeforeCounter() uint64

CloneBeforeCounter returns a count of ModifierMock.Clone invocations

func (*ModifierMock) MinimockCloneDone

func (m *ModifierMock) MinimockCloneDone() bool

MinimockCloneDone returns true if the count of the Clone invocations corresponds the number of defined expectations

func (*ModifierMock) MinimockCloneInspect

func (m *ModifierMock) MinimockCloneInspect()

MinimockCloneInspect logs each unmet expectation

func (*ModifierMock) MinimockFinish

func (m *ModifierMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*ModifierMock) MinimockSplitDone

func (m *ModifierMock) MinimockSplitDone() bool

MinimockSplitDone returns true if the count of the Split invocations corresponds the number of defined expectations

func (*ModifierMock) MinimockSplitInspect

func (m *ModifierMock) MinimockSplitInspect()

MinimockSplitInspect logs each unmet expectation

func (*ModifierMock) MinimockUpdateDone

func (m *ModifierMock) MinimockUpdateDone() bool

MinimockUpdateDone returns true if the count of the Update invocations corresponds the number of defined expectations

func (*ModifierMock) MinimockUpdateInspect

func (m *ModifierMock) MinimockUpdateInspect()

MinimockUpdateInspect logs each unmet expectation

func (*ModifierMock) MinimockWait

func (m *ModifierMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*ModifierMock) Split

func (mmSplit *ModifierMock) Split(ctx context.Context, pulse insolar.PulseNumber, id insolar.JetID) (j1 insolar.JetID, j2 insolar.JetID, err error)

Split implements Modifier

func (*ModifierMock) SplitAfterCounter

func (mmSplit *ModifierMock) SplitAfterCounter() uint64

SplitAfterCounter returns a count of finished ModifierMock.Split invocations

func (*ModifierMock) SplitBeforeCounter

func (mmSplit *ModifierMock) SplitBeforeCounter() uint64

SplitBeforeCounter returns a count of ModifierMock.Split invocations

func (*ModifierMock) Update

func (mmUpdate *ModifierMock) Update(ctx context.Context, pulse insolar.PulseNumber, actual bool, ids ...insolar.JetID) (err error)

Update implements Modifier

func (*ModifierMock) UpdateAfterCounter

func (mmUpdate *ModifierMock) UpdateAfterCounter() uint64

UpdateAfterCounter returns a count of finished ModifierMock.Update invocations

func (*ModifierMock) UpdateBeforeCounter

func (mmUpdate *ModifierMock) UpdateBeforeCounter() uint64

UpdateBeforeCounter returns a count of ModifierMock.Update invocations

type ModifierMockCloneExpectation

type ModifierMockCloneExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ModifierMockCloneExpectation specifies expectation struct of the Modifier.Clone

func (*ModifierMockCloneExpectation) Then

Then sets up Modifier.Clone return parameters for the expectation previously defined by the When method

type ModifierMockCloneParams

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

ModifierMockCloneParams contains parameters of the Modifier.Clone

type ModifierMockCloneResults

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

ModifierMockCloneResults contains results of the Modifier.Clone

type ModifierMockSplitExpectation

type ModifierMockSplitExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ModifierMockSplitExpectation specifies expectation struct of the Modifier.Split

func (*ModifierMockSplitExpectation) Then

Then sets up Modifier.Split return parameters for the expectation previously defined by the When method

type ModifierMockSplitParams

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

ModifierMockSplitParams contains parameters of the Modifier.Split

type ModifierMockSplitResults

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

ModifierMockSplitResults contains results of the Modifier.Split

type ModifierMockUpdateExpectation

type ModifierMockUpdateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ModifierMockUpdateExpectation specifies expectation struct of the Modifier.Update

func (*ModifierMockUpdateExpectation) Then

Then sets up Modifier.Update return parameters for the expectation previously defined by the When method

type ModifierMockUpdateParams

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

ModifierMockUpdateParams contains parameters of the Modifier.Update

type ModifierMockUpdateResults

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

ModifierMockUpdateResults contains results of the Modifier.Update

type Storage

type Storage interface {
	Accessor
	Modifier
}

Storage composes Accessor and Modifier interfaces.

type StorageMock

type StorageMock struct {
	AllMock mStorageMockAll

	CloneMock mStorageMockClone

	ForIDMock mStorageMockForID

	SplitMock mStorageMockSplit

	UpdateMock mStorageMockUpdate
	// contains filtered or unexported fields
}

StorageMock implements Storage

func NewStorageMock

func NewStorageMock(t minimock.Tester) *StorageMock

NewStorageMock returns a mock for Storage

func (*StorageMock) All

func (mmAll *StorageMock) All(ctx context.Context, pulse insolar.PulseNumber) (ja1 []insolar.JetID)

All implements Storage

func (*StorageMock) AllAfterCounter

func (mmAll *StorageMock) AllAfterCounter() uint64

AllAfterCounter returns a count of finished StorageMock.All invocations

func (*StorageMock) AllBeforeCounter

func (mmAll *StorageMock) AllBeforeCounter() uint64

AllBeforeCounter returns a count of StorageMock.All invocations

func (*StorageMock) Clone

func (mmClone *StorageMock) Clone(ctx context.Context, from insolar.PulseNumber, to insolar.PulseNumber, keepActual bool) (err error)

Clone implements Storage

func (*StorageMock) CloneAfterCounter

func (mmClone *StorageMock) CloneAfterCounter() uint64

CloneAfterCounter returns a count of finished StorageMock.Clone invocations

func (*StorageMock) CloneBeforeCounter

func (mmClone *StorageMock) CloneBeforeCounter() uint64

CloneBeforeCounter returns a count of StorageMock.Clone invocations

func (*StorageMock) ForID

func (mmForID *StorageMock) ForID(ctx context.Context, pulse insolar.PulseNumber, recordID insolar.ID) (j1 insolar.JetID, b1 bool)

ForID implements Storage

func (*StorageMock) ForIDAfterCounter

func (mmForID *StorageMock) ForIDAfterCounter() uint64

ForIDAfterCounter returns a count of finished StorageMock.ForID invocations

func (*StorageMock) ForIDBeforeCounter

func (mmForID *StorageMock) ForIDBeforeCounter() uint64

ForIDBeforeCounter returns a count of StorageMock.ForID invocations

func (*StorageMock) MinimockAllDone

func (m *StorageMock) MinimockAllDone() bool

MinimockAllDone returns true if the count of the All invocations corresponds the number of defined expectations

func (*StorageMock) MinimockAllInspect

func (m *StorageMock) MinimockAllInspect()

MinimockAllInspect logs each unmet expectation

func (*StorageMock) MinimockCloneDone

func (m *StorageMock) MinimockCloneDone() bool

MinimockCloneDone returns true if the count of the Clone invocations corresponds the number of defined expectations

func (*StorageMock) MinimockCloneInspect

func (m *StorageMock) MinimockCloneInspect()

MinimockCloneInspect logs each unmet expectation

func (*StorageMock) MinimockFinish

func (m *StorageMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*StorageMock) MinimockForIDDone

func (m *StorageMock) MinimockForIDDone() bool

MinimockForIDDone returns true if the count of the ForID invocations corresponds the number of defined expectations

func (*StorageMock) MinimockForIDInspect

func (m *StorageMock) MinimockForIDInspect()

MinimockForIDInspect logs each unmet expectation

func (*StorageMock) MinimockSplitDone

func (m *StorageMock) MinimockSplitDone() bool

MinimockSplitDone returns true if the count of the Split invocations corresponds the number of defined expectations

func (*StorageMock) MinimockSplitInspect

func (m *StorageMock) MinimockSplitInspect()

MinimockSplitInspect logs each unmet expectation

func (*StorageMock) MinimockUpdateDone

func (m *StorageMock) MinimockUpdateDone() bool

MinimockUpdateDone returns true if the count of the Update invocations corresponds the number of defined expectations

func (*StorageMock) MinimockUpdateInspect

func (m *StorageMock) MinimockUpdateInspect()

MinimockUpdateInspect logs each unmet expectation

func (*StorageMock) MinimockWait

func (m *StorageMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*StorageMock) Split

func (mmSplit *StorageMock) Split(ctx context.Context, pulse insolar.PulseNumber, id insolar.JetID) (j1 insolar.JetID, j2 insolar.JetID, err error)

Split implements Storage

func (*StorageMock) SplitAfterCounter

func (mmSplit *StorageMock) SplitAfterCounter() uint64

SplitAfterCounter returns a count of finished StorageMock.Split invocations

func (*StorageMock) SplitBeforeCounter

func (mmSplit *StorageMock) SplitBeforeCounter() uint64

SplitBeforeCounter returns a count of StorageMock.Split invocations

func (*StorageMock) Update

func (mmUpdate *StorageMock) Update(ctx context.Context, pulse insolar.PulseNumber, actual bool, ids ...insolar.JetID) (err error)

Update implements Storage

func (*StorageMock) UpdateAfterCounter

func (mmUpdate *StorageMock) UpdateAfterCounter() uint64

UpdateAfterCounter returns a count of finished StorageMock.Update invocations

func (*StorageMock) UpdateBeforeCounter

func (mmUpdate *StorageMock) UpdateBeforeCounter() uint64

UpdateBeforeCounter returns a count of StorageMock.Update invocations

type StorageMockAllExpectation

type StorageMockAllExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StorageMockAllExpectation specifies expectation struct of the Storage.All

func (*StorageMockAllExpectation) Then

Then sets up Storage.All return parameters for the expectation previously defined by the When method

type StorageMockAllParams

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

StorageMockAllParams contains parameters of the Storage.All

type StorageMockAllResults

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

StorageMockAllResults contains results of the Storage.All

type StorageMockCloneExpectation

type StorageMockCloneExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StorageMockCloneExpectation specifies expectation struct of the Storage.Clone

func (*StorageMockCloneExpectation) Then

Then sets up Storage.Clone return parameters for the expectation previously defined by the When method

type StorageMockCloneParams

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

StorageMockCloneParams contains parameters of the Storage.Clone

type StorageMockCloneResults

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

StorageMockCloneResults contains results of the Storage.Clone

type StorageMockForIDExpectation

type StorageMockForIDExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StorageMockForIDExpectation specifies expectation struct of the Storage.ForID

func (*StorageMockForIDExpectation) Then

Then sets up Storage.ForID return parameters for the expectation previously defined by the When method

type StorageMockForIDParams

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

StorageMockForIDParams contains parameters of the Storage.ForID

type StorageMockForIDResults

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

StorageMockForIDResults contains results of the Storage.ForID

type StorageMockSplitExpectation

type StorageMockSplitExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StorageMockSplitExpectation specifies expectation struct of the Storage.Split

func (*StorageMockSplitExpectation) Then

Then sets up Storage.Split return parameters for the expectation previously defined by the When method

type StorageMockSplitParams

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

StorageMockSplitParams contains parameters of the Storage.Split

type StorageMockSplitResults

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

StorageMockSplitResults contains results of the Storage.Split

type StorageMockUpdateExpectation

type StorageMockUpdateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StorageMockUpdateExpectation specifies expectation struct of the Storage.Update

func (*StorageMockUpdateExpectation) Then

Then sets up Storage.Update return parameters for the expectation previously defined by the When method

type StorageMockUpdateParams

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

StorageMockUpdateParams contains parameters of the Storage.Update

type StorageMockUpdateResults

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

StorageMockUpdateResults contains results of the Storage.Update

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store stores jet trees per pulse. It provides methods for querying and modification this trees.

func NewStore

func NewStore() *Store

NewStore creates new Store instance.

func (*Store) All

func (s *Store) All(ctx context.Context, pulse insolar.PulseNumber) []insolar.JetID

All returns all jet from jet tree for provided pulse.

func (*Store) Clone

func (s *Store) Clone(
	ctx context.Context, from, to insolar.PulseNumber, keepActual bool,
) error

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

func (*Store) DeleteForPN

func (s *Store) DeleteForPN(
	ctx context.Context, pulse insolar.PulseNumber,
)

Delete jets for pulse (concurrent safe).

func (*Store) ForID

func (s *Store) ForID(ctx context.Context, pulse insolar.PulseNumber, recordID insolar.ID) (insolar.JetID, bool)

ForID finds jet in jet tree for provided pulse and object. Always returns jet id and activity flag for this jet.

func (*Store) Split

func (s *Store) Split(
	ctx context.Context, pulse insolar.PulseNumber, id insolar.JetID,
) (insolar.JetID, insolar.JetID, error)

func (*Store) Update

func (s *Store) Update(ctx context.Context, pulse insolar.PulseNumber, setActual bool, ids ...insolar.JetID) error

Update updates jet tree for specified pulse.

type Tree

type Tree struct {
	Polymorph int32 `protobuf:"varint,16,opt,name=polymorph,proto3" json:"polymorph,omitempty"`
	Head      *Jet  `protobuf:"bytes,20,opt,name=Head,proto3" json:"Head,omitempty"`
}

func NewTree

func NewTree(isActual bool) *Tree

NewTree creates new tree.

func (*Tree) Clone

func (t *Tree) Clone(keep bool) *Tree

Clone clones the tree keeping actuality or setting everything to false

func (*Tree) Descriptor

func (*Tree) Descriptor() ([]byte, []int)

func (*Tree) Equal

func (this *Tree) Equal(that interface{}) bool

func (*Tree) Find

func (t *Tree) Find(recordID insolar.ID) (insolar.JetID, bool)

Find returns jet for provided record ID. If found jet is actual, the second argument will be true.

func (*Tree) GoString

func (this *Tree) GoString() string

func (*Tree) LeafIDs

func (t *Tree) LeafIDs() []insolar.JetID

func (*Tree) Marshal

func (m *Tree) Marshal() (dAtA []byte, err error)

func (*Tree) MarshalTo

func (m *Tree) MarshalTo(dAtA []byte) (int, error)

func (*Tree) ProtoMessage

func (*Tree) ProtoMessage()

func (*Tree) Reset

func (m *Tree) Reset()

func (*Tree) Size

func (m *Tree) Size() (n int)

func (*Tree) Split

func (t *Tree) Split(id insolar.JetID) (insolar.JetID, insolar.JetID, error)

Split looks for provided jet and creates (and returns) two branches for it. If provided jet is not found, an error will be returned.

func (Tree) String

func (t Tree) String() string

String visualizes Jet's tree.

func (*Tree) Unmarshal

func (m *Tree) Unmarshal(dAtA []byte) error

func (*Tree) Update

func (t *Tree) Update(id insolar.JetID, setActual bool)

Update add missing tree branches for provided prefix. If 'setActual' is set, all encountered nodes will be marked as actual.

func (*Tree) XXX_DiscardUnknown

func (m *Tree) XXX_DiscardUnknown()

func (*Tree) XXX_Marshal

func (m *Tree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Tree) XXX_Merge

func (m *Tree) XXX_Merge(src proto.Message)

func (*Tree) XXX_Size

func (m *Tree) XXX_Size() int

func (*Tree) XXX_Unmarshal

func (m *Tree) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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