Documentation
¶
Index ¶
Constants ¶
const TrustOne = TrustValue(1)
TrustOne is a trust value equal to one.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerID ¶
type PeerID [peerIDLength]byte
PeerID represents identifier of reputation system participant.
func PeerIDFromBytes ¶
PeerIDFromBytes restores PeerID from []byte.
type Trust ¶
type Trust struct {
// contains filtered or unexported fields
}
Trust represents peer's trust (reputation).
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) String ¶
func (v TrustValue) String() string