Documentation ¶
Index ¶
- Variables
- func NewStorageMemory() *dropStorageMemory
- type Accessor
- type AccessorMock
- func (mmForPulse *AccessorMock) ForPulse(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (d1 Drop, err error)
- func (mmForPulse *AccessorMock) ForPulseAfterCounter() uint64
- func (mmForPulse *AccessorMock) ForPulseBeforeCounter() uint64
- func (m *AccessorMock) MinimockFinish()
- func (m *AccessorMock) MinimockForPulseDone() bool
- func (m *AccessorMock) MinimockForPulseInspect()
- func (m *AccessorMock) MinimockWait(timeout mm_time.Duration)
- type AccessorMockForPulseExpectation
- type AccessorMockForPulseParams
- type AccessorMockForPulseResults
- type Cleaner
- type CleanerMock
- func (mmDeleteForPN *CleanerMock) DeleteForPN(ctx context.Context, pulse insolar.PulseNumber)
- func (mmDeleteForPN *CleanerMock) DeleteForPNAfterCounter() uint64
- func (mmDeleteForPN *CleanerMock) DeleteForPNBeforeCounter() uint64
- func (m *CleanerMock) MinimockDeleteForPNDone() bool
- func (m *CleanerMock) MinimockDeleteForPNInspect()
- func (m *CleanerMock) MinimockFinish()
- func (m *CleanerMock) MinimockWait(timeout mm_time.Duration)
- type CleanerMockDeleteForPNExpectation
- type CleanerMockDeleteForPNParams
- type DB
- type Drop
- func (*Drop) Descriptor() ([]byte, []int)
- func (this *Drop) Equal(that interface{}) bool
- func (this *Drop) GoString() string
- func (m *Drop) Marshal() (dAtA []byte, err error)
- func (m *Drop) MarshalTo(dAtA []byte) (int, error)
- func (*Drop) ProtoMessage()
- func (m *Drop) Reset()
- func (m *Drop) Size() (n int)
- func (this *Drop) String() string
- func (m *Drop) Unmarshal(dAtA []byte) error
- func (m *Drop) XXX_DiscardUnknown()
- func (m *Drop) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Drop) XXX_Merge(src proto.Message)
- func (m *Drop) XXX_Size() int
- func (m *Drop) XXX_Unmarshal(b []byte) error
- type Modifier
- type ModifierMock
- func (m *ModifierMock) MinimockFinish()
- func (m *ModifierMock) MinimockSetDone() bool
- func (m *ModifierMock) MinimockSetInspect()
- func (m *ModifierMock) MinimockWait(timeout mm_time.Duration)
- func (mmSet *ModifierMock) Set(ctx context.Context, drop Drop) (err error)
- func (mmSet *ModifierMock) SetAfterCounter() uint64
- func (mmSet *ModifierMock) SetBeforeCounter() uint64
- type ModifierMockSetExpectation
- type ModifierMockSetParams
- type ModifierMockSetResults
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthDrop = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDrop = fmt.Errorf("proto: integer overflow") )
var ( // ErrNotFound is returned when value was not found. ErrNotFound = errors.New("value not found") // ErrOverride is returned if something tries to update existing record. ErrOverride = errors.New("records override is forbidden") )
Functions ¶
func NewStorageMemory ¶
func NewStorageMemory() *dropStorageMemory
NewStorageMemory creates a new storage, that holds data in a memory.
Types ¶
type Accessor ¶
type Accessor interface {
ForPulse(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (Drop, error)
}
Accessor provides an interface for accessing jetdrops.
type AccessorMock ¶
type AccessorMock struct { ForPulseMock mAccessorMockForPulse // contains filtered or unexported fields }
AccessorMock implements Accessor
func NewAccessorMock ¶
func NewAccessorMock(t minimock.Tester) *AccessorMock
NewAccessorMock returns a mock for Accessor
func (*AccessorMock) ForPulse ¶
func (mmForPulse *AccessorMock) ForPulse(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (d1 Drop, err error)
ForPulse implements Accessor
func (*AccessorMock) ForPulseAfterCounter ¶
func (mmForPulse *AccessorMock) ForPulseAfterCounter() uint64
ForPulseAfterCounter returns a count of finished AccessorMock.ForPulse invocations
func (*AccessorMock) ForPulseBeforeCounter ¶
func (mmForPulse *AccessorMock) ForPulseBeforeCounter() uint64
ForPulseBeforeCounter returns a count of AccessorMock.ForPulse invocations
func (*AccessorMock) MinimockFinish ¶
func (m *AccessorMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*AccessorMock) MinimockForPulseDone ¶
func (m *AccessorMock) MinimockForPulseDone() bool
MinimockForPulseDone returns true if the count of the ForPulse invocations corresponds the number of defined expectations
func (*AccessorMock) MinimockForPulseInspect ¶
func (m *AccessorMock) MinimockForPulseInspect()
MinimockForPulseInspect 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 AccessorMockForPulseExpectation ¶
type AccessorMockForPulseExpectation struct { Counter uint64 // contains filtered or unexported fields }
AccessorMockForPulseExpectation specifies expectation struct of the Accessor.ForPulse
func (*AccessorMockForPulseExpectation) Then ¶
func (e *AccessorMockForPulseExpectation) Then(d1 Drop, err error) *AccessorMock
Then sets up Accessor.ForPulse return parameters for the expectation previously defined by the When method
type AccessorMockForPulseParams ¶
type AccessorMockForPulseParams struct {
// contains filtered or unexported fields
}
AccessorMockForPulseParams contains parameters of the Accessor.ForPulse
type AccessorMockForPulseResults ¶
type AccessorMockForPulseResults struct {
// contains filtered or unexported fields
}
AccessorMockForPulseResults contains results of the Accessor.ForPulse
type Cleaner ¶
type Cleaner interface {
DeleteForPN(ctx context.Context, pulse insolar.PulseNumber)
}
Cleaner provides an interface for removing jetdrops from a storage.
type CleanerMock ¶
type CleanerMock struct { DeleteForPNMock mCleanerMockDeleteForPN // contains filtered or unexported fields }
CleanerMock implements Cleaner
func NewCleanerMock ¶
func NewCleanerMock(t minimock.Tester) *CleanerMock
NewCleanerMock returns a mock for Cleaner
func (*CleanerMock) DeleteForPN ¶
func (mmDeleteForPN *CleanerMock) DeleteForPN(ctx context.Context, pulse insolar.PulseNumber)
DeleteForPN implements Cleaner
func (*CleanerMock) DeleteForPNAfterCounter ¶
func (mmDeleteForPN *CleanerMock) DeleteForPNAfterCounter() uint64
DeleteForPNAfterCounter returns a count of finished CleanerMock.DeleteForPN invocations
func (*CleanerMock) DeleteForPNBeforeCounter ¶
func (mmDeleteForPN *CleanerMock) DeleteForPNBeforeCounter() uint64
DeleteForPNBeforeCounter returns a count of CleanerMock.DeleteForPN invocations
func (*CleanerMock) MinimockDeleteForPNDone ¶
func (m *CleanerMock) MinimockDeleteForPNDone() bool
MinimockDeleteForPNDone returns true if the count of the DeleteForPN invocations corresponds the number of defined expectations
func (*CleanerMock) MinimockDeleteForPNInspect ¶
func (m *CleanerMock) MinimockDeleteForPNInspect()
MinimockDeleteForPNInspect logs each unmet expectation
func (*CleanerMock) MinimockFinish ¶
func (m *CleanerMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
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
type CleanerMockDeleteForPNExpectation ¶
type CleanerMockDeleteForPNExpectation struct { Counter uint64 // contains filtered or unexported fields }
CleanerMockDeleteForPNExpectation specifies expectation struct of the Cleaner.DeleteForPN
type CleanerMockDeleteForPNParams ¶
type CleanerMockDeleteForPNParams struct {
// contains filtered or unexported fields
}
CleanerMockDeleteForPNParams contains parameters of the Cleaner.DeleteForPN
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) ForPulse ¶
func (ds *DB) ForPulse(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (Drop, error)
ForPulse returns a Drop for a provided pulse, that is stored in a db.
func (*DB) TruncateHead ¶
TruncateHead remove all records after lastPulse
type Drop ¶
type Drop struct { Polymorph int32 `protobuf:"varint,16,opt,name=polymorph,proto3" json:"polymorph,omitempty"` Pulse github_com_insolar_insolar_insolar.PulseNumber `protobuf:"bytes,20,opt,name=Pulse,proto3,customtype=github.com/insolar/insolar/insolar.PulseNumber" json:"Pulse"` JetID github_com_insolar_insolar_insolar.JetID `protobuf:"bytes,21,opt,name=JetID,proto3,customtype=github.com/insolar/insolar/insolar.JetID" json:"JetID"` SplitThresholdExceeded int64 `protobuf:"varint,22,opt,name=SplitThresholdExceeded,proto3" json:"SplitThresholdExceeded,omitempty"` Split bool `protobuf:"varint,23,opt,name=Split,proto3" json:"Split,omitempty"` }
func (*Drop) Descriptor ¶
func (*Drop) ProtoMessage ¶
func (*Drop) ProtoMessage()
func (*Drop) XXX_DiscardUnknown ¶
func (m *Drop) XXX_DiscardUnknown()
func (*Drop) XXX_Unmarshal ¶
type ModifierMock ¶
type ModifierMock struct { SetMock mModifierMockSet // contains filtered or unexported fields }
ModifierMock implements Modifier
func NewModifierMock ¶
func NewModifierMock(t minimock.Tester) *ModifierMock
NewModifierMock returns a mock for Modifier
func (*ModifierMock) MinimockFinish ¶
func (m *ModifierMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*ModifierMock) MinimockSetDone ¶
func (m *ModifierMock) MinimockSetDone() bool
MinimockSetDone returns true if the count of the Set invocations corresponds the number of defined expectations
func (*ModifierMock) MinimockSetInspect ¶
func (m *ModifierMock) MinimockSetInspect()
MinimockSetInspect 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) Set ¶
func (mmSet *ModifierMock) Set(ctx context.Context, drop Drop) (err error)
Set implements Modifier
func (*ModifierMock) SetAfterCounter ¶
func (mmSet *ModifierMock) SetAfterCounter() uint64
SetAfterCounter returns a count of finished ModifierMock.Set invocations
func (*ModifierMock) SetBeforeCounter ¶
func (mmSet *ModifierMock) SetBeforeCounter() uint64
SetBeforeCounter returns a count of ModifierMock.Set invocations
type ModifierMockSetExpectation ¶
type ModifierMockSetExpectation struct { Counter uint64 // contains filtered or unexported fields }
ModifierMockSetExpectation specifies expectation struct of the Modifier.Set
func (*ModifierMockSetExpectation) Then ¶
func (e *ModifierMockSetExpectation) Then(err error) *ModifierMock
Then sets up Modifier.Set return parameters for the expectation previously defined by the When method
type ModifierMockSetParams ¶
type ModifierMockSetParams struct {
// contains filtered or unexported fields
}
ModifierMockSetParams contains parameters of the Modifier.Set
type ModifierMockSetResults ¶
type ModifierMockSetResults struct {
// contains filtered or unexported fields
}
ModifierMockSetResults contains results of the Modifier.Set