Documentation ¶
Index ¶
- func SplitNFromMany(ctx context.Context, n int, qs ...RequestsQueue) ([]*common.Transcript, []*common.Transcript)
- type RequestSource
- type RequestsQueue
- type RequestsQueueMock
- func (mmAppend *RequestsQueueMock) Append(ctx context.Context, from RequestSource, transcripts ...*common.Transcript)
- func (mmAppend *RequestsQueueMock) AppendAfterCounter() uint64
- func (mmAppend *RequestsQueueMock) AppendBeforeCounter() uint64
- func (mmClean *RequestsQueueMock) Clean(ctx context.Context) (tpa1 []*common.Transcript)
- func (mmClean *RequestsQueueMock) CleanAfterCounter() uint64
- func (mmClean *RequestsQueueMock) CleanBeforeCounter() uint64
- func (mmLength *RequestsQueueMock) Length() (i1 int)
- func (mmLength *RequestsQueueMock) LengthAfterCounter() uint64
- func (mmLength *RequestsQueueMock) LengthBeforeCounter() uint64
- func (m *RequestsQueueMock) MinimockAppendDone() bool
- func (m *RequestsQueueMock) MinimockAppendInspect()
- func (m *RequestsQueueMock) MinimockCleanDone() bool
- func (m *RequestsQueueMock) MinimockCleanInspect()
- func (m *RequestsQueueMock) MinimockFinish()
- func (m *RequestsQueueMock) MinimockLengthDone() bool
- func (m *RequestsQueueMock) MinimockLengthInspect()
- func (m *RequestsQueueMock) MinimockNumberOfOldDone() bool
- func (m *RequestsQueueMock) MinimockNumberOfOldInspect()
- func (m *RequestsQueueMock) MinimockTakeAllOriginatedFromDone() bool
- func (m *RequestsQueueMock) MinimockTakeAllOriginatedFromInspect()
- func (m *RequestsQueueMock) MinimockTakeFirstDone() bool
- func (m *RequestsQueueMock) MinimockTakeFirstInspect()
- func (m *RequestsQueueMock) MinimockWait(timeout mm_time.Duration)
- func (mmNumberOfOld *RequestsQueueMock) NumberOfOld(ctx context.Context) (i1 int)
- func (mmNumberOfOld *RequestsQueueMock) NumberOfOldAfterCounter() uint64
- func (mmNumberOfOld *RequestsQueueMock) NumberOfOldBeforeCounter() uint64
- func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFrom(ctx context.Context, from RequestSource) (tpa1 []*common.Transcript)
- func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFromAfterCounter() uint64
- func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFromBeforeCounter() uint64
- func (mmTakeFirst *RequestsQueueMock) TakeFirst(ctx context.Context) (tp1 *common.Transcript)
- func (mmTakeFirst *RequestsQueueMock) TakeFirstAfterCounter() uint64
- func (mmTakeFirst *RequestsQueueMock) TakeFirstBeforeCounter() uint64
- type RequestsQueueMockAppendExpectation
- type RequestsQueueMockAppendParams
- type RequestsQueueMockCleanExpectation
- type RequestsQueueMockCleanParams
- type RequestsQueueMockCleanResults
- type RequestsQueueMockLengthExpectation
- type RequestsQueueMockLengthResults
- type RequestsQueueMockNumberOfOldExpectation
- type RequestsQueueMockNumberOfOldParams
- type RequestsQueueMockNumberOfOldResults
- type RequestsQueueMockTakeAllOriginatedFromExpectation
- type RequestsQueueMockTakeAllOriginatedFromParams
- type RequestsQueueMockTakeAllOriginatedFromResults
- type RequestsQueueMockTakeFirstExpectation
- type RequestsQueueMockTakeFirstParams
- type RequestsQueueMockTakeFirstResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitNFromMany ¶ added in v0.9.5
func SplitNFromMany(ctx context.Context, n int, qs ...RequestsQueue) ([]*common.Transcript, []*common.Transcript)
SplitNFromMany utility function that extracts from multiple queues slits to no more than N elements and rest.
Types ¶
type RequestSource ¶
type RequestSource int
const ( FromLedger RequestSource = iota FromPreviousExecutor FromThisPulse )
type RequestsQueue ¶
type RequestsQueue interface { // Append adds request(s) from provided source to the queue Append(ctx context.Context, from RequestSource, transcripts ...*common.Transcript) // TakeFirst extracts first for processing request from the queue, prioritizing // requests from ledger, previous executor and only after those fresh requests TakeFirst(ctx context.Context) *common.Transcript // TakeAllOriginatedFrom extracts all requests that originated from particular source TakeAllOriginatedFrom(ctx context.Context, from RequestSource) []*common.Transcript // NumberOfOld returns quantity of requests from ledger and previous executor // (e.g not fresh, aka old) NumberOfOld(ctx context.Context) int // Number of elements in queue Length() int // Clean cleans queue Clean(ctx context.Context) []*common.Transcript }
func New ¶
func New() RequestsQueue
type RequestsQueueMock ¶
type RequestsQueueMock struct { AppendMock mRequestsQueueMockAppend CleanMock mRequestsQueueMockClean LengthMock mRequestsQueueMockLength NumberOfOldMock mRequestsQueueMockNumberOfOld TakeAllOriginatedFromMock mRequestsQueueMockTakeAllOriginatedFrom TakeFirstMock mRequestsQueueMockTakeFirst // contains filtered or unexported fields }
RequestsQueueMock implements RequestsQueue
func NewRequestsQueueMock ¶
func NewRequestsQueueMock(t minimock.Tester) *RequestsQueueMock
NewRequestsQueueMock returns a mock for RequestsQueue
func (*RequestsQueueMock) Append ¶
func (mmAppend *RequestsQueueMock) Append(ctx context.Context, from RequestSource, transcripts ...*common.Transcript)
Append implements RequestsQueue
func (*RequestsQueueMock) AppendAfterCounter ¶
func (mmAppend *RequestsQueueMock) AppendAfterCounter() uint64
AppendAfterCounter returns a count of finished RequestsQueueMock.Append invocations
func (*RequestsQueueMock) AppendBeforeCounter ¶
func (mmAppend *RequestsQueueMock) AppendBeforeCounter() uint64
AppendBeforeCounter returns a count of RequestsQueueMock.Append invocations
func (*RequestsQueueMock) Clean ¶
func (mmClean *RequestsQueueMock) Clean(ctx context.Context) (tpa1 []*common.Transcript)
Clean implements RequestsQueue
func (*RequestsQueueMock) CleanAfterCounter ¶
func (mmClean *RequestsQueueMock) CleanAfterCounter() uint64
CleanAfterCounter returns a count of finished RequestsQueueMock.Clean invocations
func (*RequestsQueueMock) CleanBeforeCounter ¶
func (mmClean *RequestsQueueMock) CleanBeforeCounter() uint64
CleanBeforeCounter returns a count of RequestsQueueMock.Clean invocations
func (*RequestsQueueMock) Length ¶ added in v0.9.3
func (mmLength *RequestsQueueMock) Length() (i1 int)
Length implements RequestsQueue
func (*RequestsQueueMock) LengthAfterCounter ¶ added in v0.9.3
func (mmLength *RequestsQueueMock) LengthAfterCounter() uint64
LengthAfterCounter returns a count of finished RequestsQueueMock.Length invocations
func (*RequestsQueueMock) LengthBeforeCounter ¶ added in v0.9.3
func (mmLength *RequestsQueueMock) LengthBeforeCounter() uint64
LengthBeforeCounter returns a count of RequestsQueueMock.Length invocations
func (*RequestsQueueMock) MinimockAppendDone ¶
func (m *RequestsQueueMock) MinimockAppendDone() bool
MinimockAppendDone returns true if the count of the Append invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockAppendInspect ¶
func (m *RequestsQueueMock) MinimockAppendInspect()
MinimockAppendInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockCleanDone ¶
func (m *RequestsQueueMock) MinimockCleanDone() bool
MinimockCleanDone returns true if the count of the Clean invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockCleanInspect ¶
func (m *RequestsQueueMock) MinimockCleanInspect()
MinimockCleanInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockFinish ¶
func (m *RequestsQueueMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*RequestsQueueMock) MinimockLengthDone ¶ added in v0.9.3
func (m *RequestsQueueMock) MinimockLengthDone() bool
MinimockLengthDone returns true if the count of the Length invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockLengthInspect ¶ added in v0.9.3
func (m *RequestsQueueMock) MinimockLengthInspect()
MinimockLengthInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockNumberOfOldDone ¶
func (m *RequestsQueueMock) MinimockNumberOfOldDone() bool
MinimockNumberOfOldDone returns true if the count of the NumberOfOld invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockNumberOfOldInspect ¶
func (m *RequestsQueueMock) MinimockNumberOfOldInspect()
MinimockNumberOfOldInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockTakeAllOriginatedFromDone ¶
func (m *RequestsQueueMock) MinimockTakeAllOriginatedFromDone() bool
MinimockTakeAllOriginatedFromDone returns true if the count of the TakeAllOriginatedFrom invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockTakeAllOriginatedFromInspect ¶
func (m *RequestsQueueMock) MinimockTakeAllOriginatedFromInspect()
MinimockTakeAllOriginatedFromInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockTakeFirstDone ¶
func (m *RequestsQueueMock) MinimockTakeFirstDone() bool
MinimockTakeFirstDone returns true if the count of the TakeFirst invocations corresponds the number of defined expectations
func (*RequestsQueueMock) MinimockTakeFirstInspect ¶
func (m *RequestsQueueMock) MinimockTakeFirstInspect()
MinimockTakeFirstInspect logs each unmet expectation
func (*RequestsQueueMock) MinimockWait ¶
func (m *RequestsQueueMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*RequestsQueueMock) NumberOfOld ¶
func (mmNumberOfOld *RequestsQueueMock) NumberOfOld(ctx context.Context) (i1 int)
NumberOfOld implements RequestsQueue
func (*RequestsQueueMock) NumberOfOldAfterCounter ¶
func (mmNumberOfOld *RequestsQueueMock) NumberOfOldAfterCounter() uint64
NumberOfOldAfterCounter returns a count of finished RequestsQueueMock.NumberOfOld invocations
func (*RequestsQueueMock) NumberOfOldBeforeCounter ¶
func (mmNumberOfOld *RequestsQueueMock) NumberOfOldBeforeCounter() uint64
NumberOfOldBeforeCounter returns a count of RequestsQueueMock.NumberOfOld invocations
func (*RequestsQueueMock) TakeAllOriginatedFrom ¶
func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFrom(ctx context.Context, from RequestSource) (tpa1 []*common.Transcript)
TakeAllOriginatedFrom implements RequestsQueue
func (*RequestsQueueMock) TakeAllOriginatedFromAfterCounter ¶
func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFromAfterCounter() uint64
TakeAllOriginatedFromAfterCounter returns a count of finished RequestsQueueMock.TakeAllOriginatedFrom invocations
func (*RequestsQueueMock) TakeAllOriginatedFromBeforeCounter ¶
func (mmTakeAllOriginatedFrom *RequestsQueueMock) TakeAllOriginatedFromBeforeCounter() uint64
TakeAllOriginatedFromBeforeCounter returns a count of RequestsQueueMock.TakeAllOriginatedFrom invocations
func (*RequestsQueueMock) TakeFirst ¶
func (mmTakeFirst *RequestsQueueMock) TakeFirst(ctx context.Context) (tp1 *common.Transcript)
TakeFirst implements RequestsQueue
func (*RequestsQueueMock) TakeFirstAfterCounter ¶
func (mmTakeFirst *RequestsQueueMock) TakeFirstAfterCounter() uint64
TakeFirstAfterCounter returns a count of finished RequestsQueueMock.TakeFirst invocations
func (*RequestsQueueMock) TakeFirstBeforeCounter ¶
func (mmTakeFirst *RequestsQueueMock) TakeFirstBeforeCounter() uint64
TakeFirstBeforeCounter returns a count of RequestsQueueMock.TakeFirst invocations
type RequestsQueueMockAppendExpectation ¶
type RequestsQueueMockAppendExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockAppendExpectation specifies expectation struct of the RequestsQueue.Append
type RequestsQueueMockAppendParams ¶
type RequestsQueueMockAppendParams struct {
// contains filtered or unexported fields
}
RequestsQueueMockAppendParams contains parameters of the RequestsQueue.Append
type RequestsQueueMockCleanExpectation ¶
type RequestsQueueMockCleanExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockCleanExpectation specifies expectation struct of the RequestsQueue.Clean
func (*RequestsQueueMockCleanExpectation) Then ¶ added in v0.9.11
func (e *RequestsQueueMockCleanExpectation) Then(tpa1 []*common.Transcript) *RequestsQueueMock
Then sets up RequestsQueue.Clean return parameters for the expectation previously defined by the When method
type RequestsQueueMockCleanParams ¶
type RequestsQueueMockCleanParams struct {
// contains filtered or unexported fields
}
RequestsQueueMockCleanParams contains parameters of the RequestsQueue.Clean
type RequestsQueueMockCleanResults ¶ added in v0.9.11
type RequestsQueueMockCleanResults struct {
// contains filtered or unexported fields
}
RequestsQueueMockCleanResults contains results of the RequestsQueue.Clean
type RequestsQueueMockLengthExpectation ¶ added in v0.9.3
type RequestsQueueMockLengthExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockLengthExpectation specifies expectation struct of the RequestsQueue.Length
type RequestsQueueMockLengthResults ¶ added in v0.9.3
type RequestsQueueMockLengthResults struct {
// contains filtered or unexported fields
}
RequestsQueueMockLengthResults contains results of the RequestsQueue.Length
type RequestsQueueMockNumberOfOldExpectation ¶
type RequestsQueueMockNumberOfOldExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockNumberOfOldExpectation specifies expectation struct of the RequestsQueue.NumberOfOld
func (*RequestsQueueMockNumberOfOldExpectation) Then ¶
func (e *RequestsQueueMockNumberOfOldExpectation) Then(i1 int) *RequestsQueueMock
Then sets up RequestsQueue.NumberOfOld return parameters for the expectation previously defined by the When method
type RequestsQueueMockNumberOfOldParams ¶
type RequestsQueueMockNumberOfOldParams struct {
// contains filtered or unexported fields
}
RequestsQueueMockNumberOfOldParams contains parameters of the RequestsQueue.NumberOfOld
type RequestsQueueMockNumberOfOldResults ¶
type RequestsQueueMockNumberOfOldResults struct {
// contains filtered or unexported fields
}
RequestsQueueMockNumberOfOldResults contains results of the RequestsQueue.NumberOfOld
type RequestsQueueMockTakeAllOriginatedFromExpectation ¶
type RequestsQueueMockTakeAllOriginatedFromExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockTakeAllOriginatedFromExpectation specifies expectation struct of the RequestsQueue.TakeAllOriginatedFrom
func (*RequestsQueueMockTakeAllOriginatedFromExpectation) Then ¶
func (e *RequestsQueueMockTakeAllOriginatedFromExpectation) Then(tpa1 []*common.Transcript) *RequestsQueueMock
Then sets up RequestsQueue.TakeAllOriginatedFrom return parameters for the expectation previously defined by the When method
type RequestsQueueMockTakeAllOriginatedFromParams ¶
type RequestsQueueMockTakeAllOriginatedFromParams struct {
// contains filtered or unexported fields
}
RequestsQueueMockTakeAllOriginatedFromParams contains parameters of the RequestsQueue.TakeAllOriginatedFrom
type RequestsQueueMockTakeAllOriginatedFromResults ¶
type RequestsQueueMockTakeAllOriginatedFromResults struct {
// contains filtered or unexported fields
}
RequestsQueueMockTakeAllOriginatedFromResults contains results of the RequestsQueue.TakeAllOriginatedFrom
type RequestsQueueMockTakeFirstExpectation ¶
type RequestsQueueMockTakeFirstExpectation struct { Counter uint64 // contains filtered or unexported fields }
RequestsQueueMockTakeFirstExpectation specifies expectation struct of the RequestsQueue.TakeFirst
func (*RequestsQueueMockTakeFirstExpectation) Then ¶
func (e *RequestsQueueMockTakeFirstExpectation) Then(tp1 *common.Transcript) *RequestsQueueMock
Then sets up RequestsQueue.TakeFirst return parameters for the expectation previously defined by the When method
type RequestsQueueMockTakeFirstParams ¶
type RequestsQueueMockTakeFirstParams struct {
// contains filtered or unexported fields
}
RequestsQueueMockTakeFirstParams contains parameters of the RequestsQueue.TakeFirst
type RequestsQueueMockTakeFirstResults ¶
type RequestsQueueMockTakeFirstResults struct {
// contains filtered or unexported fields
}
RequestsQueueMockTakeFirstResults contains results of the RequestsQueue.TakeFirst