Documentation ¶
Index ¶
Constants ¶
const ( // TrustOne is a trust value equal to one. TrustOne = TrustValue(1) // TrustZero is a trust value equal to zero. TrustZero = TrustValue(0) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trust ¶
type Trust struct {
// contains filtered or unexported fields
}
Trust represents peer's trust (reputation).
func (*Trust) SetTrustingPeer ¶ added in v0.19.0
func (t *Trust) SetTrustingPeer(id reputation.PeerID)
SetTrustingPeer sets trusting peer ID.
func (Trust) TrustingPeer ¶ added in v0.19.0
func (t Trust) TrustingPeer() reputation.PeerID
TrustingPeer returns trusting peer ID.
type TrustHandler ¶
TrustHandler describes the signature of the reputation.Trust value handling function.
Termination of processing without failures is usually signaled with a zero error, while a specific value may describe the reason for failure.
type TrustValue ¶
type TrustValue float64
TrustValue represents the numeric value of the node's trust.
func TrustValueFromFloat64 ¶
func TrustValueFromFloat64(v float64) TrustValue
TrustValueFromFloat64 converts float64 to TrustValue.
func TrustValueFromInt ¶
func TrustValueFromInt(v int) TrustValue
TrustValueFromInt converts int to TrustValue.
func (TrustValue) Div ¶
func (v TrustValue) Div(v2 TrustValue) TrustValue
Div returns the result of dividing v by v2.
func (TrustValue) Float64 ¶
func (v TrustValue) Float64() float64
Float64 converts TrustValue to float64.
func (TrustValue) IsZero ¶
func (v TrustValue) IsZero() bool
IsZero returns true if v equal to zero.
func (*TrustValue) Mul ¶ added in v0.19.0
func (v *TrustValue) Mul(v2 TrustValue)
Mul multiplies v by v2.
func (TrustValue) String ¶
func (v TrustValue) String() string