executor

package
v0.9.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

executor contains internal business logic object for light executor.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWaiterNotLocked = errors.New("unlocked waiter unlock attempt")
	ErrWriteClosed     = errors.New("requested pulse is closed for writing")
)

Functions

This section is empty.

Types

type ChannelWaiter

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

ChannelWaiter implements methods for locking and unlocking a certain jet id.

func NewChannelWaiter

func NewChannelWaiter() *ChannelWaiter

NewChannelWaiter creates new waiter instance.

func (*ChannelWaiter) CloseAllUntil

func (w *ChannelWaiter) CloseAllUntil(ctx context.Context, pulse insolar.PulseNumber)

CloseAllUntil raises timeouts on all waiters until pulse.

func (*ChannelWaiter) IsReceived

func (w *ChannelWaiter) IsReceived(ctx context.Context, jetID insolar.JetID, pn insolar.PulseNumber) (bool, error)

func (*ChannelWaiter) Unlock

func (w *ChannelWaiter) Unlock(ctx context.Context, pulse insolar.PulseNumber, jetID insolar.JetID) error

Unlock raises hotDataChannel

func (*ChannelWaiter) Wait

func (w *ChannelWaiter) Wait(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) error

Wait waits for the raising one of two channels. If hotDataChannel or timeoutChannel was raised, the method returns error Either nil or ErrHotDataTimeout

type Cleaner

type Cleaner interface {
	// NotifyAboutPulse notifies a component about a pulse
	NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

	Stop()
}

Cleaner is an interface that represents a cleaner-component It's supposed, that all the process of cleaning data from LME will be doing by it

type CleanerMock

type CleanerMock struct {
	NotifyAboutPulseMock mCleanerMockNotifyAboutPulse

	StopMock mCleanerMockStop
	// contains filtered or unexported fields
}

CleanerMock implements Cleaner

func NewCleanerMock

func NewCleanerMock(t minimock.Tester) *CleanerMock

NewCleanerMock returns a mock for Cleaner

func (*CleanerMock) MinimockFinish

func (m *CleanerMock) MinimockFinish()

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

func (*CleanerMock) MinimockNotifyAboutPulseDone

func (m *CleanerMock) MinimockNotifyAboutPulseDone() bool

MinimockNotifyAboutPulseDone returns true if the count of the NotifyAboutPulse invocations corresponds the number of defined expectations

func (*CleanerMock) MinimockNotifyAboutPulseInspect

func (m *CleanerMock) MinimockNotifyAboutPulseInspect()

MinimockNotifyAboutPulseInspect logs each unmet expectation

func (*CleanerMock) MinimockStopDone

func (m *CleanerMock) MinimockStopDone() bool

MinimockStopDone returns true if the count of the Stop invocations corresponds the number of defined expectations

func (*CleanerMock) MinimockStopInspect

func (m *CleanerMock) MinimockStopInspect()

MinimockStopInspect logs each unmet expectation

func (*CleanerMock) MinimockWait

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

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

func (*CleanerMock) NotifyAboutPulse

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse implements Cleaner

func (*CleanerMock) NotifyAboutPulseAfterCounter

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulseAfterCounter() uint64

NotifyAboutPulseAfterCounter returns a count of finished CleanerMock.NotifyAboutPulse invocations

func (*CleanerMock) NotifyAboutPulseBeforeCounter

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulseBeforeCounter() uint64

NotifyAboutPulseBeforeCounter returns a count of CleanerMock.NotifyAboutPulse invocations

func (*CleanerMock) Stop

func (mmStop *CleanerMock) Stop()

Stop implements Cleaner

func (*CleanerMock) StopAfterCounter

func (mmStop *CleanerMock) StopAfterCounter() uint64

StopAfterCounter returns a count of finished CleanerMock.Stop invocations

func (*CleanerMock) StopBeforeCounter

func (mmStop *CleanerMock) StopBeforeCounter() uint64

StopBeforeCounter returns a count of CleanerMock.Stop invocations

type CleanerMockNotifyAboutPulseExpectation

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

CleanerMockNotifyAboutPulseExpectation specifies expectation struct of the Cleaner.NotifyAboutPulse

type CleanerMockNotifyAboutPulseParams

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

CleanerMockNotifyAboutPulseParams contains parameters of the Cleaner.NotifyAboutPulse

type CleanerMockStopExpectation

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

CleanerMockStopExpectation specifies expectation struct of the Cleaner.Stop

type FilamentCalculator

type FilamentCalculator interface {
	// Requests returns request records for objectID's chain, starts from provided id until provided pulse.
	// TODO: remove calcPulse param
	Requests(
		ctx context.Context,
		objectID, from insolar.ID,
		readUntil insolar.PulseNumber,
	) ([]record.CompositeFilamentRecord, error)

	// OpenedRequests returns all opened requests of object for provided pulse.
	OpenedRequests(
		ctx context.Context,
		pulse insolar.PulseNumber,
		objectID insolar.ID,
		pendingOnly bool,
	) ([]record.CompositeFilamentRecord, error)

	// RequestDuplicate searches two records on objectID chain:
	// First one with same ID as requestID param.
	// Second is the Result record Request field of which equals requestID param.
	// Uses request parameter to check if Reason is not empty and to set pulse for scan limit.
	RequestDuplicate(
		ctx context.Context,
		objectID, requestID insolar.ID,
		request record.Request,
	) (
		foundRequest *record.CompositeFilamentRecord,
		foundResult *record.CompositeFilamentRecord,
		err error,
	)

	ResultDuplicate(
		ctx context.Context,
		objectID, resultID insolar.ID,
		result record.Result,
	) (
		foundResult *record.CompositeFilamentRecord,
		err error,
	)

	// RequestInfo is searching for request and result by objectID, requestID and pulse number
	RequestInfo(
		ctx context.Context,
		objectID insolar.ID,
		requestID insolar.ID,
		pulse insolar.PulseNumber,
	) (
		foundRequest *record.CompositeFilamentRecord,
		foundResult *record.CompositeFilamentRecord,
		err error,
	)
}

type FilamentCalculatorDefault

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

func NewFilamentCalculator

func NewFilamentCalculator(
	indexes object.IndexAccessor,
	records object.RecordAccessor,
	coordinator jet.Coordinator,
	jetFetcher JetFetcher,
	sender bus.Sender,
	pulses pulse.Calculator,
) *FilamentCalculatorDefault

func (*FilamentCalculatorDefault) Clear

func (c *FilamentCalculatorDefault) Clear(objID insolar.ID)

func (*FilamentCalculatorDefault) OpenedRequests

func (c *FilamentCalculatorDefault) OpenedRequests(ctx context.Context, pulse insolar.PulseNumber, objectID insolar.ID, pendingOnly bool) ([]record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) RequestDuplicate

func (c *FilamentCalculatorDefault) RequestDuplicate(
	ctx context.Context, objectID, requestID insolar.ID, request record.Request,
) (*record.CompositeFilamentRecord, *record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) RequestInfo

func (*FilamentCalculatorDefault) Requests

func (c *FilamentCalculatorDefault) Requests(
	ctx context.Context,
	objectID,
	from insolar.ID,
	readUntil insolar.PulseNumber,
) ([]record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) ResultDuplicate

func (c *FilamentCalculatorDefault) ResultDuplicate(
	ctx context.Context, objectID, resultID insolar.ID, result record.Result,
) (*record.CompositeFilamentRecord, error)

type FilamentCalculatorMock

type FilamentCalculatorMock struct {
	OpenedRequestsMock mFilamentCalculatorMockOpenedRequests

	RequestDuplicateMock mFilamentCalculatorMockRequestDuplicate

	RequestInfoMock mFilamentCalculatorMockRequestInfo

	RequestsMock mFilamentCalculatorMockRequests

	ResultDuplicateMock mFilamentCalculatorMockResultDuplicate
	// contains filtered or unexported fields
}

FilamentCalculatorMock implements FilamentCalculator

func NewFilamentCalculatorMock

func NewFilamentCalculatorMock(t minimock.Tester) *FilamentCalculatorMock

NewFilamentCalculatorMock returns a mock for FilamentCalculator

func (*FilamentCalculatorMock) MinimockFinish

func (m *FilamentCalculatorMock) MinimockFinish()

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

func (*FilamentCalculatorMock) MinimockOpenedRequestsDone

func (m *FilamentCalculatorMock) MinimockOpenedRequestsDone() bool

MinimockOpenedRequestsDone returns true if the count of the OpenedRequests invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockOpenedRequestsInspect

func (m *FilamentCalculatorMock) MinimockOpenedRequestsInspect()

MinimockOpenedRequestsInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestDuplicateDone

func (m *FilamentCalculatorMock) MinimockRequestDuplicateDone() bool

MinimockRequestDuplicateDone returns true if the count of the RequestDuplicate invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestDuplicateInspect

func (m *FilamentCalculatorMock) MinimockRequestDuplicateInspect()

MinimockRequestDuplicateInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestInfoDone

func (m *FilamentCalculatorMock) MinimockRequestInfoDone() bool

MinimockRequestInfoDone returns true if the count of the RequestInfo invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestInfoInspect

func (m *FilamentCalculatorMock) MinimockRequestInfoInspect()

MinimockRequestInfoInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestsDone

func (m *FilamentCalculatorMock) MinimockRequestsDone() bool

MinimockRequestsDone returns true if the count of the Requests invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestsInspect

func (m *FilamentCalculatorMock) MinimockRequestsInspect()

MinimockRequestsInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockResultDuplicateDone

func (m *FilamentCalculatorMock) MinimockResultDuplicateDone() bool

MinimockResultDuplicateDone returns true if the count of the ResultDuplicate invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockResultDuplicateInspect

func (m *FilamentCalculatorMock) MinimockResultDuplicateInspect()

MinimockResultDuplicateInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockWait

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

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

func (*FilamentCalculatorMock) OpenedRequests

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequests(ctx context.Context, pulse insolar.PulseNumber, objectID insolar.ID, pendingOnly bool) (ca1 []record.CompositeFilamentRecord, err error)

OpenedRequests implements FilamentCalculator

func (*FilamentCalculatorMock) OpenedRequestsAfterCounter

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequestsAfterCounter() uint64

OpenedRequestsAfterCounter returns a count of finished FilamentCalculatorMock.OpenedRequests invocations

func (*FilamentCalculatorMock) OpenedRequestsBeforeCounter

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequestsBeforeCounter() uint64

OpenedRequestsBeforeCounter returns a count of FilamentCalculatorMock.OpenedRequests invocations

func (*FilamentCalculatorMock) RequestDuplicate

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicate(ctx context.Context, objectID insolar.ID, requestID insolar.ID, request record.Request) (foundRequest *record.CompositeFilamentRecord, foundResult *record.CompositeFilamentRecord, err error)

RequestDuplicate implements FilamentCalculator

func (*FilamentCalculatorMock) RequestDuplicateAfterCounter

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicateAfterCounter() uint64

RequestDuplicateAfterCounter returns a count of finished FilamentCalculatorMock.RequestDuplicate invocations

func (*FilamentCalculatorMock) RequestDuplicateBeforeCounter

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicateBeforeCounter() uint64

RequestDuplicateBeforeCounter returns a count of FilamentCalculatorMock.RequestDuplicate invocations

func (*FilamentCalculatorMock) RequestInfo

func (mmRequestInfo *FilamentCalculatorMock) RequestInfo(ctx context.Context, objectID insolar.ID, requestID insolar.ID, pulse insolar.PulseNumber) (foundRequest *record.CompositeFilamentRecord, foundResult *record.CompositeFilamentRecord, err error)

RequestInfo implements FilamentCalculator

func (*FilamentCalculatorMock) RequestInfoAfterCounter

func (mmRequestInfo *FilamentCalculatorMock) RequestInfoAfterCounter() uint64

RequestInfoAfterCounter returns a count of finished FilamentCalculatorMock.RequestInfo invocations

func (*FilamentCalculatorMock) RequestInfoBeforeCounter

func (mmRequestInfo *FilamentCalculatorMock) RequestInfoBeforeCounter() uint64

RequestInfoBeforeCounter returns a count of FilamentCalculatorMock.RequestInfo invocations

func (*FilamentCalculatorMock) Requests

func (mmRequests *FilamentCalculatorMock) Requests(ctx context.Context, objectID insolar.ID, from insolar.ID, readUntil insolar.PulseNumber) (ca1 []record.CompositeFilamentRecord, err error)

Requests implements FilamentCalculator

func (*FilamentCalculatorMock) RequestsAfterCounter

func (mmRequests *FilamentCalculatorMock) RequestsAfterCounter() uint64

RequestsAfterCounter returns a count of finished FilamentCalculatorMock.Requests invocations

func (*FilamentCalculatorMock) RequestsBeforeCounter

func (mmRequests *FilamentCalculatorMock) RequestsBeforeCounter() uint64

RequestsBeforeCounter returns a count of FilamentCalculatorMock.Requests invocations

func (*FilamentCalculatorMock) ResultDuplicate

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicate(ctx context.Context, objectID insolar.ID, resultID insolar.ID, result record.Result) (foundResult *record.CompositeFilamentRecord, err error)

ResultDuplicate implements FilamentCalculator

func (*FilamentCalculatorMock) ResultDuplicateAfterCounter

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicateAfterCounter() uint64

ResultDuplicateAfterCounter returns a count of finished FilamentCalculatorMock.ResultDuplicate invocations

func (*FilamentCalculatorMock) ResultDuplicateBeforeCounter

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicateBeforeCounter() uint64

ResultDuplicateBeforeCounter returns a count of FilamentCalculatorMock.ResultDuplicate invocations

type FilamentCalculatorMockOpenedRequestsExpectation

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

FilamentCalculatorMockOpenedRequestsExpectation specifies expectation struct of the FilamentCalculator.OpenedRequests

func (*FilamentCalculatorMockOpenedRequestsExpectation) Then

Then sets up FilamentCalculator.OpenedRequests return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockOpenedRequestsParams

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

FilamentCalculatorMockOpenedRequestsParams contains parameters of the FilamentCalculator.OpenedRequests

type FilamentCalculatorMockOpenedRequestsResults

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

FilamentCalculatorMockOpenedRequestsResults contains results of the FilamentCalculator.OpenedRequests

type FilamentCalculatorMockRequestDuplicateExpectation

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

FilamentCalculatorMockRequestDuplicateExpectation specifies expectation struct of the FilamentCalculator.RequestDuplicate

func (*FilamentCalculatorMockRequestDuplicateExpectation) Then

Then sets up FilamentCalculator.RequestDuplicate return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestDuplicateParams

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

FilamentCalculatorMockRequestDuplicateParams contains parameters of the FilamentCalculator.RequestDuplicate

type FilamentCalculatorMockRequestDuplicateResults

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

FilamentCalculatorMockRequestDuplicateResults contains results of the FilamentCalculator.RequestDuplicate

type FilamentCalculatorMockRequestInfoExpectation

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

FilamentCalculatorMockRequestInfoExpectation specifies expectation struct of the FilamentCalculator.RequestInfo

func (*FilamentCalculatorMockRequestInfoExpectation) Then

Then sets up FilamentCalculator.RequestInfo return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestInfoParams

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

FilamentCalculatorMockRequestInfoParams contains parameters of the FilamentCalculator.RequestInfo

type FilamentCalculatorMockRequestInfoResults

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

FilamentCalculatorMockRequestInfoResults contains results of the FilamentCalculator.RequestInfo

type FilamentCalculatorMockRequestsExpectation

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

FilamentCalculatorMockRequestsExpectation specifies expectation struct of the FilamentCalculator.Requests

func (*FilamentCalculatorMockRequestsExpectation) Then

Then sets up FilamentCalculator.Requests return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestsParams

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

FilamentCalculatorMockRequestsParams contains parameters of the FilamentCalculator.Requests

type FilamentCalculatorMockRequestsResults

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

FilamentCalculatorMockRequestsResults contains results of the FilamentCalculator.Requests

type FilamentCalculatorMockResultDuplicateExpectation

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

FilamentCalculatorMockResultDuplicateExpectation specifies expectation struct of the FilamentCalculator.ResultDuplicate

func (*FilamentCalculatorMockResultDuplicateExpectation) Then

Then sets up FilamentCalculator.ResultDuplicate return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockResultDuplicateParams

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

FilamentCalculatorMockResultDuplicateParams contains parameters of the FilamentCalculator.ResultDuplicate

type FilamentCalculatorMockResultDuplicateResults

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

FilamentCalculatorMockResultDuplicateResults contains results of the FilamentCalculator.ResultDuplicate

type FilamentCleaner

type FilamentCleaner interface {
	Clear(objID insolar.ID)
}

type FilamentCleanerMock

type FilamentCleanerMock struct {
	ClearMock mFilamentCleanerMockClear
	// contains filtered or unexported fields
}

FilamentCleanerMock implements FilamentCleaner

func NewFilamentCleanerMock

func NewFilamentCleanerMock(t minimock.Tester) *FilamentCleanerMock

NewFilamentCleanerMock returns a mock for FilamentCleaner

func (*FilamentCleanerMock) Clear

func (mmClear *FilamentCleanerMock) Clear(objID insolar.ID)

Clear implements FilamentCleaner

func (*FilamentCleanerMock) ClearAfterCounter

func (mmClear *FilamentCleanerMock) ClearAfterCounter() uint64

ClearAfterCounter returns a count of finished FilamentCleanerMock.Clear invocations

func (*FilamentCleanerMock) ClearBeforeCounter

func (mmClear *FilamentCleanerMock) ClearBeforeCounter() uint64

ClearBeforeCounter returns a count of FilamentCleanerMock.Clear invocations

func (*FilamentCleanerMock) MinimockClearDone

func (m *FilamentCleanerMock) MinimockClearDone() bool

MinimockClearDone returns true if the count of the Clear invocations corresponds the number of defined expectations

func (*FilamentCleanerMock) MinimockClearInspect

func (m *FilamentCleanerMock) MinimockClearInspect()

MinimockClearInspect logs each unmet expectation

func (*FilamentCleanerMock) MinimockFinish

func (m *FilamentCleanerMock) MinimockFinish()

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

func (*FilamentCleanerMock) MinimockWait

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

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

type FilamentCleanerMockClearExpectation

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

FilamentCleanerMockClearExpectation specifies expectation struct of the FilamentCleaner.Clear

type FilamentCleanerMockClearParams

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

FilamentCleanerMockClearParams contains parameters of the FilamentCleaner.Clear

type HotDataStatusChecker

type HotDataStatusChecker interface {
	IsReceived(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (bool, error)
}

HotDataStatusChecker provides methods for checking receiving status of hot data.

type HotSender

type HotSender interface {
	SendHot(ctx context.Context, old, new insolar.PulseNumber, jets []insolar.JetID) error
}

HotSender provides sending hot records send for provided pulse.

type HotSenderDefault

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

HotSenderDefault implements HotSender.

func NewHotSender

func NewHotSender(
	dropAccessor drop.Accessor,
	indexAccessor object.IndexAccessor,
	pulseCalculator pulse.Calculator,
	jetAccessor jet.Accessor,
	lightChainLimit int,
	sender bus.Sender,
) *HotSenderDefault

NewHotSender returns a new instance of a default HotSender implementation.

func (*HotSenderDefault) SendHot

func (m *HotSenderDefault) SendHot(
	ctx context.Context, currentPulse, newPulse insolar.PulseNumber, jets []insolar.JetID,
) error

SendHot send hot records from oldPulse to all jets in newPulse.

type JetCalculator

type JetCalculator interface {
	// MineForPulse returns current node's jets for a provided pulse
	MineForPulse(ctx context.Context, pn insolar.PulseNumber) ([]insolar.JetID, error)
}

JetCalculator provides get jets method for provided pulse.

type JetCalculatorDefault

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

JetCalculatorDefault implements JetCalculator.

func NewJetCalculator

func NewJetCalculator(jetCoordinator jet.Coordinator, jetAccessor jet.Accessor) *JetCalculatorDefault

NewJetCalculator returns a new instance of a default jet calculator implementation.

func (*JetCalculatorDefault) MineForPulse

func (c *JetCalculatorDefault) MineForPulse(ctx context.Context, pn insolar.PulseNumber) ([]insolar.JetID, error)

MineForPulse returns current node's jets for a provided pulse.

type JetCalculatorMock

type JetCalculatorMock struct {
	MineForPulseMock mJetCalculatorMockMineForPulse
	// contains filtered or unexported fields
}

JetCalculatorMock implements JetCalculator

func NewJetCalculatorMock

func NewJetCalculatorMock(t minimock.Tester) *JetCalculatorMock

NewJetCalculatorMock returns a mock for JetCalculator

func (*JetCalculatorMock) MineForPulse

func (mmMineForPulse *JetCalculatorMock) MineForPulse(ctx context.Context, pn insolar.PulseNumber) (ja1 []insolar.JetID, err error)

MineForPulse implements JetCalculator

func (*JetCalculatorMock) MineForPulseAfterCounter

func (mmMineForPulse *JetCalculatorMock) MineForPulseAfterCounter() uint64

MineForPulseAfterCounter returns a count of finished JetCalculatorMock.MineForPulse invocations

func (*JetCalculatorMock) MineForPulseBeforeCounter

func (mmMineForPulse *JetCalculatorMock) MineForPulseBeforeCounter() uint64

MineForPulseBeforeCounter returns a count of JetCalculatorMock.MineForPulse invocations

func (*JetCalculatorMock) MinimockFinish

func (m *JetCalculatorMock) MinimockFinish()

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

func (*JetCalculatorMock) MinimockMineForPulseDone

func (m *JetCalculatorMock) MinimockMineForPulseDone() bool

MinimockMineForPulseDone returns true if the count of the MineForPulse invocations corresponds the number of defined expectations

func (*JetCalculatorMock) MinimockMineForPulseInspect

func (m *JetCalculatorMock) MinimockMineForPulseInspect()

MinimockMineForPulseInspect logs each unmet expectation

func (*JetCalculatorMock) MinimockWait

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

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

type JetCalculatorMockMineForPulseExpectation

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

JetCalculatorMockMineForPulseExpectation specifies expectation struct of the JetCalculator.MineForPulse

func (*JetCalculatorMockMineForPulseExpectation) Then

Then sets up JetCalculator.MineForPulse return parameters for the expectation previously defined by the When method

type JetCalculatorMockMineForPulseParams

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

JetCalculatorMockMineForPulseParams contains parameters of the JetCalculator.MineForPulse

type JetCalculatorMockMineForPulseResults

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

JetCalculatorMockMineForPulseResults contains results of the JetCalculator.MineForPulse

type JetFetcher

type JetFetcher interface {
	Fetch(ctx context.Context, target insolar.ID, pulse insolar.PulseNumber) (*insolar.ID, error)
	Release(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber)
}

JetFetcher can be used to get actual jets. It involves fetching jet from other nodes via network and updating local jet tree.

func NewFetcher

func NewFetcher(
	ans node.Accessor,
	js jet.Storage,
	s bus.Sender,
	jc jet.Coordinator,
) JetFetcher

NewFetcher creates new fetcher instance.

type JetFetcherMock

type JetFetcherMock struct {
	FetchMock mJetFetcherMockFetch

	ReleaseMock mJetFetcherMockRelease
	// contains filtered or unexported fields
}

JetFetcherMock implements JetFetcher

func NewJetFetcherMock

func NewJetFetcherMock(t minimock.Tester) *JetFetcherMock

NewJetFetcherMock returns a mock for JetFetcher

func (*JetFetcherMock) Fetch

func (mmFetch *JetFetcherMock) Fetch(ctx context.Context, target insolar.ID, pulse insolar.PulseNumber) (ip1 *insolar.ID, err error)

Fetch implements JetFetcher

func (*JetFetcherMock) FetchAfterCounter

func (mmFetch *JetFetcherMock) FetchAfterCounter() uint64

FetchAfterCounter returns a count of finished JetFetcherMock.Fetch invocations

func (*JetFetcherMock) FetchBeforeCounter

func (mmFetch *JetFetcherMock) FetchBeforeCounter() uint64

FetchBeforeCounter returns a count of JetFetcherMock.Fetch invocations

func (*JetFetcherMock) MinimockFetchDone

func (m *JetFetcherMock) MinimockFetchDone() bool

MinimockFetchDone returns true if the count of the Fetch invocations corresponds the number of defined expectations

func (*JetFetcherMock) MinimockFetchInspect

func (m *JetFetcherMock) MinimockFetchInspect()

MinimockFetchInspect logs each unmet expectation

func (*JetFetcherMock) MinimockFinish

func (m *JetFetcherMock) MinimockFinish()

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

func (*JetFetcherMock) MinimockReleaseDone

func (m *JetFetcherMock) MinimockReleaseDone() bool

MinimockReleaseDone returns true if the count of the Release invocations corresponds the number of defined expectations

func (*JetFetcherMock) MinimockReleaseInspect

func (m *JetFetcherMock) MinimockReleaseInspect()

MinimockReleaseInspect logs each unmet expectation

func (*JetFetcherMock) MinimockWait

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

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

func (*JetFetcherMock) Release

func (mmRelease *JetFetcherMock) Release(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber)

Release implements JetFetcher

func (*JetFetcherMock) ReleaseAfterCounter

func (mmRelease *JetFetcherMock) ReleaseAfterCounter() uint64

ReleaseAfterCounter returns a count of finished JetFetcherMock.Release invocations

func (*JetFetcherMock) ReleaseBeforeCounter

func (mmRelease *JetFetcherMock) ReleaseBeforeCounter() uint64

ReleaseBeforeCounter returns a count of JetFetcherMock.Release invocations

type JetFetcherMockFetchExpectation

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

JetFetcherMockFetchExpectation specifies expectation struct of the JetFetcher.Fetch

func (*JetFetcherMockFetchExpectation) Then

Then sets up JetFetcher.Fetch return parameters for the expectation previously defined by the When method

type JetFetcherMockFetchParams

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

JetFetcherMockFetchParams contains parameters of the JetFetcher.Fetch

type JetFetcherMockFetchResults

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

JetFetcherMockFetchResults contains results of the JetFetcher.Fetch

type JetFetcherMockReleaseExpectation

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

JetFetcherMockReleaseExpectation specifies expectation struct of the JetFetcher.Release

type JetFetcherMockReleaseParams

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

JetFetcherMockReleaseParams contains parameters of the JetFetcher.Release

type JetInfo

type JetInfo struct {
	ID insolar.JetID
	// SplitIntent indicates what jet has intention to do split in next pulse.
	SplitIntent bool
	// MustSplit indicates what jet should be split in current pulse.
	MustSplit bool
}

JetInfo holds info about jet.

type JetReleaser

type JetReleaser interface {
	Unlock(ctx context.Context, pulse insolar.PulseNumber, jetID insolar.JetID) error
	CloseAllUntil(ctx context.Context, pulse insolar.PulseNumber)
}

JetReleaser provides methods for releasing jet waiters.

type JetSplitter

type JetSplitter interface {
	// Do performs jets processing, it decides which jets to split and returns list of resulting jets).
	Do(
		ctx context.Context,
		ended insolar.PulseNumber,
		new insolar.PulseNumber,
		jets []insolar.JetID,
		createDrops bool,
	) ([]insolar.JetID, error)
}

JetSplitter provides method for processing and splitting jets.

type JetSplitterDefault

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

JetSplitterDefault implements JetSplitter.

func NewJetSplitter

func NewJetSplitter(
	cfg configuration.JetSplit,
	jetCalculator JetCalculator,
	jetAccessor jet.Accessor,
	jetModifier jet.Modifier,
	dropAccessor drop.Accessor,
	dropModifier drop.Modifier,
	pulseCalculator pulse.Calculator,
	recordsAccessor object.RecordCollectionAccessor,
) *JetSplitterDefault

NewJetSplitter returns a new instance of a default jet splitter implementation.

func (*JetSplitterDefault) Do

func (js *JetSplitterDefault) Do(
	ctx context.Context,
	endedPulse insolar.PulseNumber,
	newPulse insolar.PulseNumber,
	jets []insolar.JetID,
	createDrops bool,
) ([]insolar.JetID, error)

Do performs jets processing, it decides which jets to split and returns list of resulting jets.

type JetWaiter

type JetWaiter interface {
	Wait(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) error
}

JetWaiter provides method for locking on jet id.

type LightCleaner

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

LightCleaner is an implementation of Cleaner interface

func NewCleaner

func NewCleaner(
	jetCleaner jet.Cleaner,
	nodeModifier node.Modifier,
	dropCleaner drop.Cleaner,
	recCleaner object.RecordCleaner,
	indexCleaner object.IndexCleaner,
	pulseShifter pulse.Shifter,
	pulseCalculator pulse.Calculator,
	indexAccessor object.IndexAccessor,
	filamentCleaner FilamentCleaner,
	lightChainLimit int,
	cleanerDelay int,
) *LightCleaner

NewCleaner creates a new instance of LightCleaner

func (*LightCleaner) NotifyAboutPulse

func (c *LightCleaner) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse cleans a light's data. When it's called, it tries to fetch pulse, which is backwards by a size of lightChainLimit. If a pulse is fetched successfully, all the data for it will be cleaned

func (*LightCleaner) Stop

func (c *LightCleaner) Stop()

type LightReplicator

type LightReplicator interface {
	// NotifyAboutPulse is method for notifying a sync component about new pulse
	NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

	// Stop stops the component
	Stop()
}

LightReplicator is a base interface for a sync component

type LightReplicatorDefault

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

LightReplicatorDefault is a base impl of LightReplicator

func NewReplicatorDefault

func NewReplicatorDefault(
	jetCalculator JetCalculator,
	cleaner Cleaner,
	sender bus.Sender,
	calculator pulse.Calculator,
	dropAccessor drop.Accessor,
	recsAccessor object.RecordCollectionAccessor,
	idxAccessor object.IndexAccessor,
	jetAccessor jet.Accessor,
) *LightReplicatorDefault

NewReplicatorDefault creates new instance of LightReplicator

func (*LightReplicatorDefault) NotifyAboutPulse

func (lr *LightReplicatorDefault) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse is method for notifying a sync component about new pulse When it's called, a provided pulse is added to a channel. There is a special gorutine that is reading that channel. When a new pulse is being received, the routine starts to gather data (with using of LightDataGatherer). After gathering all the data, it attempts to send it to the heavy. After sending a heavy payload to a heavy, data is deleted with help of Cleaner

func (*LightReplicatorDefault) Stop

func (lr *LightReplicatorDefault) Stop()

type PulseManager

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

PulseManager implements insolar.PulseManager.

func NewPulseManager

func NewPulseManager(
	nodeNet network.NodeNetwork,
	disp dispatcher.Dispatcher,
	nodeSetter node.Modifier,
	pulseAccessor pulse.Accessor,
	pulseAppender pulse.Appender,
	jetReleaser JetReleaser,
	jetSplitter JetSplitter,
	lightReplicator LightReplicator,
	hotSender HotSender,
	writeManager WriteManager,
	stateIniter StateIniter,
	hotStatusChecker HotDataStatusChecker,
) *PulseManager

NewPulseManager creates PulseManager instance.

func (*PulseManager) Set

func (m *PulseManager) Set(ctx context.Context, newPulse insolar.Pulse) error

Set set's new pulse and closes current jet drop.

type RequestChecker

type RequestChecker interface {
	CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) error
}

type RequestCheckerDefault

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

func NewRequestChecker

func NewRequestChecker(
	fc FilamentCalculator,
	c jet.Coordinator,
	jf JetFetcher,
	hasher hash.Hash,
	sender bus.Sender,
) *RequestCheckerDefault

func (*RequestCheckerDefault) CheckRequest

func (c *RequestCheckerDefault) CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) error

type RequestCheckerMock

type RequestCheckerMock struct {
	CheckRequestMock mRequestCheckerMockCheckRequest
	// contains filtered or unexported fields
}

RequestCheckerMock implements RequestChecker

func NewRequestCheckerMock

func NewRequestCheckerMock(t minimock.Tester) *RequestCheckerMock

NewRequestCheckerMock returns a mock for RequestChecker

func (*RequestCheckerMock) CheckRequest

func (mmCheckRequest *RequestCheckerMock) CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) (err error)

CheckRequest implements RequestChecker

func (*RequestCheckerMock) CheckRequestAfterCounter

func (mmCheckRequest *RequestCheckerMock) CheckRequestAfterCounter() uint64

CheckRequestAfterCounter returns a count of finished RequestCheckerMock.CheckRequest invocations

func (*RequestCheckerMock) CheckRequestBeforeCounter

func (mmCheckRequest *RequestCheckerMock) CheckRequestBeforeCounter() uint64

CheckRequestBeforeCounter returns a count of RequestCheckerMock.CheckRequest invocations

func (*RequestCheckerMock) MinimockCheckRequestDone

func (m *RequestCheckerMock) MinimockCheckRequestDone() bool

MinimockCheckRequestDone returns true if the count of the CheckRequest invocations corresponds the number of defined expectations

func (*RequestCheckerMock) MinimockCheckRequestInspect

func (m *RequestCheckerMock) MinimockCheckRequestInspect()

MinimockCheckRequestInspect logs each unmet expectation

func (*RequestCheckerMock) MinimockFinish

func (m *RequestCheckerMock) MinimockFinish()

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

func (*RequestCheckerMock) MinimockWait

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

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

type RequestCheckerMockCheckRequestExpectation

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

RequestCheckerMockCheckRequestExpectation specifies expectation struct of the RequestChecker.CheckRequest

func (*RequestCheckerMockCheckRequestExpectation) Then

Then sets up RequestChecker.CheckRequest return parameters for the expectation previously defined by the When method

type RequestCheckerMockCheckRequestParams

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

RequestCheckerMockCheckRequestParams contains parameters of the RequestChecker.CheckRequest

type RequestCheckerMockCheckRequestResults

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

RequestCheckerMockCheckRequestResults contains results of the RequestChecker.CheckRequest

type StateIniter

type StateIniter interface {
	// PrepareState prepares actual data to get the light started.
	// Fetch necessary jets and drops from heavy.
	PrepareState(ctx context.Context, pulse insolar.PulseNumber) (justJoined bool, jets []insolar.JetID, err error)
}

type StateIniterDefault

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

StateIniterDefault implements StateIniter.

func NewStateIniter

func NewStateIniter(
	jetModifier jet.Modifier,
	jetReleaser JetReleaser,
	drops drop.Modifier,
	nodes node.Accessor,
	sender bus.Sender,
	pulseAppender pulse.Appender,
	pulseAccessor pulse.Accessor,
	calc JetCalculator,
	indexes object.MemoryIndexModifier,
) *StateIniterDefault

NewStateIniter creates StateIniterDefault with all required components.

func (*StateIniterDefault) PrepareState

func (s *StateIniterDefault) PrepareState(
	ctx context.Context,
	forPulse insolar.PulseNumber,
) (bool, []insolar.JetID, error)

type StateIniterMock

type StateIniterMock struct {
	PrepareStateMock mStateIniterMockPrepareState
	// contains filtered or unexported fields
}

StateIniterMock implements StateIniter

func NewStateIniterMock

func NewStateIniterMock(t minimock.Tester) *StateIniterMock

NewStateIniterMock returns a mock for StateIniter

func (*StateIniterMock) MinimockFinish

func (m *StateIniterMock) MinimockFinish()

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

func (*StateIniterMock) MinimockPrepareStateDone

func (m *StateIniterMock) MinimockPrepareStateDone() bool

MinimockPrepareStateDone returns true if the count of the PrepareState invocations corresponds the number of defined expectations

func (*StateIniterMock) MinimockPrepareStateInspect

func (m *StateIniterMock) MinimockPrepareStateInspect()

MinimockPrepareStateInspect logs each unmet expectation

func (*StateIniterMock) MinimockWait

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

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

func (*StateIniterMock) PrepareState

func (mmPrepareState *StateIniterMock) PrepareState(ctx context.Context, pulse insolar.PulseNumber) (justJoined bool, jets []insolar.JetID, err error)

PrepareState implements StateIniter

func (*StateIniterMock) PrepareStateAfterCounter

func (mmPrepareState *StateIniterMock) PrepareStateAfterCounter() uint64

PrepareStateAfterCounter returns a count of finished StateIniterMock.PrepareState invocations

func (*StateIniterMock) PrepareStateBeforeCounter

func (mmPrepareState *StateIniterMock) PrepareStateBeforeCounter() uint64

PrepareStateBeforeCounter returns a count of StateIniterMock.PrepareState invocations

type StateIniterMockPrepareStateExpectation

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

StateIniterMockPrepareStateExpectation specifies expectation struct of the StateIniter.PrepareState

func (*StateIniterMockPrepareStateExpectation) Then

Then sets up StateIniter.PrepareState return parameters for the expectation previously defined by the When method

type StateIniterMockPrepareStateParams

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

StateIniterMockPrepareStateParams contains parameters of the StateIniter.PrepareState

type StateIniterMockPrepareStateResults

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

StateIniterMockPrepareStateResults contains results of the StateIniter.PrepareState

type WriteAccessor

type WriteAccessor interface {
	// Begin requests writing access for pulse number. If requested pulse is closed, ErrWriteClosed will be returned.
	// The caller must call returned "done" function when finished writing.
	Begin(context.Context, insolar.PulseNumber) (done func(), err error)
}

type WriteAccessorMock

type WriteAccessorMock struct {
	BeginMock mWriteAccessorMockBegin
	// contains filtered or unexported fields
}

WriteAccessorMock implements WriteAccessor

func NewWriteAccessorMock

func NewWriteAccessorMock(t minimock.Tester) *WriteAccessorMock

NewWriteAccessorMock returns a mock for WriteAccessor

func (*WriteAccessorMock) Begin

func (mmBegin *WriteAccessorMock) Begin(ctx context.Context, p1 insolar.PulseNumber) (done func(), err error)

Begin implements WriteAccessor

func (*WriteAccessorMock) BeginAfterCounter

func (mmBegin *WriteAccessorMock) BeginAfterCounter() uint64

BeginAfterCounter returns a count of finished WriteAccessorMock.Begin invocations

func (*WriteAccessorMock) BeginBeforeCounter

func (mmBegin *WriteAccessorMock) BeginBeforeCounter() uint64

BeginBeforeCounter returns a count of WriteAccessorMock.Begin invocations

func (*WriteAccessorMock) MinimockBeginDone

func (m *WriteAccessorMock) MinimockBeginDone() bool

MinimockBeginDone returns true if the count of the Begin invocations corresponds the number of defined expectations

func (*WriteAccessorMock) MinimockBeginInspect

func (m *WriteAccessorMock) MinimockBeginInspect()

MinimockBeginInspect logs each unmet expectation

func (*WriteAccessorMock) MinimockFinish

func (m *WriteAccessorMock) MinimockFinish()

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

func (*WriteAccessorMock) MinimockWait

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

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

type WriteAccessorMockBeginExpectation

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

WriteAccessorMockBeginExpectation specifies expectation struct of the WriteAccessor.Begin

func (*WriteAccessorMockBeginExpectation) Then

func (e *WriteAccessorMockBeginExpectation) Then(done func(), err error) *WriteAccessorMock

Then sets up WriteAccessor.Begin return parameters for the expectation previously defined by the When method

type WriteAccessorMockBeginParams

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

WriteAccessorMockBeginParams contains parameters of the WriteAccessor.Begin

type WriteAccessorMockBeginResults

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

WriteAccessorMockBeginResults contains results of the WriteAccessor.Begin

type WriteController

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

func NewWriteController

func NewWriteController() *WriteController

func (*WriteController) Begin

func (m *WriteController) Begin(ctx context.Context, pulse insolar.PulseNumber) (func(), error)

func (*WriteController) CloseAndWait

func (m *WriteController) CloseAndWait(ctx context.Context, pulse insolar.PulseNumber) error

func (*WriteController) Open

type WriteManager

type WriteManager interface {
	// Open marks pulse number as opened for writing. It can be used later by Begin from accessor.
	Open(context.Context, insolar.PulseNumber) error
	// CloseAndWait immediately marks pulse number as closed for writing and blocks until all writes are done.
	CloseAndWait(context.Context, insolar.PulseNumber) error
}

type WriteManagerMock

type WriteManagerMock struct {
	CloseAndWaitMock mWriteManagerMockCloseAndWait

	OpenMock mWriteManagerMockOpen
	// contains filtered or unexported fields
}

WriteManagerMock implements WriteManager

func NewWriteManagerMock

func NewWriteManagerMock(t minimock.Tester) *WriteManagerMock

NewWriteManagerMock returns a mock for WriteManager

func (*WriteManagerMock) CloseAndWait

func (mmCloseAndWait *WriteManagerMock) CloseAndWait(ctx context.Context, p1 insolar.PulseNumber) (err error)

CloseAndWait implements WriteManager

func (*WriteManagerMock) CloseAndWaitAfterCounter

func (mmCloseAndWait *WriteManagerMock) CloseAndWaitAfterCounter() uint64

CloseAndWaitAfterCounter returns a count of finished WriteManagerMock.CloseAndWait invocations

func (*WriteManagerMock) CloseAndWaitBeforeCounter

func (mmCloseAndWait *WriteManagerMock) CloseAndWaitBeforeCounter() uint64

CloseAndWaitBeforeCounter returns a count of WriteManagerMock.CloseAndWait invocations

func (*WriteManagerMock) MinimockCloseAndWaitDone

func (m *WriteManagerMock) MinimockCloseAndWaitDone() bool

MinimockCloseAndWaitDone returns true if the count of the CloseAndWait invocations corresponds the number of defined expectations

func (*WriteManagerMock) MinimockCloseAndWaitInspect

func (m *WriteManagerMock) MinimockCloseAndWaitInspect()

MinimockCloseAndWaitInspect logs each unmet expectation

func (*WriteManagerMock) MinimockFinish

func (m *WriteManagerMock) MinimockFinish()

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

func (*WriteManagerMock) MinimockOpenDone

func (m *WriteManagerMock) MinimockOpenDone() bool

MinimockOpenDone returns true if the count of the Open invocations corresponds the number of defined expectations

func (*WriteManagerMock) MinimockOpenInspect

func (m *WriteManagerMock) MinimockOpenInspect()

MinimockOpenInspect logs each unmet expectation

func (*WriteManagerMock) MinimockWait

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

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

func (*WriteManagerMock) Open

func (mmOpen *WriteManagerMock) Open(ctx context.Context, p1 insolar.PulseNumber) (err error)

Open implements WriteManager

func (*WriteManagerMock) OpenAfterCounter

func (mmOpen *WriteManagerMock) OpenAfterCounter() uint64

OpenAfterCounter returns a count of finished WriteManagerMock.Open invocations

func (*WriteManagerMock) OpenBeforeCounter

func (mmOpen *WriteManagerMock) OpenBeforeCounter() uint64

OpenBeforeCounter returns a count of WriteManagerMock.Open invocations

type WriteManagerMockCloseAndWaitExpectation

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

WriteManagerMockCloseAndWaitExpectation specifies expectation struct of the WriteManager.CloseAndWait

func (*WriteManagerMockCloseAndWaitExpectation) Then

Then sets up WriteManager.CloseAndWait return parameters for the expectation previously defined by the When method

type WriteManagerMockCloseAndWaitParams

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

WriteManagerMockCloseAndWaitParams contains parameters of the WriteManager.CloseAndWait

type WriteManagerMockCloseAndWaitResults

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

WriteManagerMockCloseAndWaitResults contains results of the WriteManager.CloseAndWait

type WriteManagerMockOpenExpectation

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

WriteManagerMockOpenExpectation specifies expectation struct of the WriteManager.Open

func (*WriteManagerMockOpenExpectation) Then

Then sets up WriteManager.Open return parameters for the expectation previously defined by the When method

type WriteManagerMockOpenParams

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

WriteManagerMockOpenParams contains parameters of the WriteManager.Open

type WriteManagerMockOpenResults

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

WriteManagerMockOpenResults contains results of the WriteManager.Open

Jump to

Keyboard shortcuts

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