Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPositiveTrust = errors.New("no positive trust")
ErrNoPositiveTrust is returned by iterator when there is no positive number of successful transactions.
Functions ¶
This section is empty.
Types ¶
type EpochTrustValueStorage ¶
type EpochTrustValueStorage struct {
// contains filtered or unexported fields
}
EpochTrustValueStorage represents storage of the trust values by particular epoch.
func (*EpochTrustValueStorage) Iterate ¶
func (s *EpochTrustValueStorage) Iterate(h reputation.TrustHandler) (err error)
Iterate iterates over normalized trust values and passes them to parameterized handler.
Values are normalized according to http://ilpubs.stanford.edu:8090/562/1/2002-56.pdf Chapter 4.5. If divisor in formula is zero, ErrNoPositiveTrust returns.
type Prm ¶
type Prm struct{}
Prm groups the required parameters of the Storage's constructor.
All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents in-memory storage of local reputation values.
Storage provides access to normalized local trust values through iterator interface.
For correct operation, Storage must be created using the constructor (New) based on the required parameters and optional components. After successful creation, Storage is immediately ready to work through API.
func New ¶
New creates a new instance of the Storage.
The created Storage does not require additional initialization and is completely ready for work.
func (*Storage) DataForEpoch ¶
func (s *Storage) DataForEpoch(epoch uint64) (*EpochTrustValueStorage, error)
DataForEpoch returns EpochValueStorage for epoch.
If there is no data for the epoch, ErrNoPositiveTrust returns.
type UpdatePrm ¶
type UpdatePrm struct {
// contains filtered or unexported fields
}
UpdatePrm groups the parameters of Storage's Update operation.
func (*UpdatePrm) SetPeer ¶
func (p *UpdatePrm) SetPeer(id apireputation.PeerID)
SetPeer sets identifier of the peer with which the local node interacted.
func (*UpdatePrm) SetSatisfactory ¶
SetSatisfactory sets successful completion status.