Dmitrii Stepanov
7ebbfa3358
Resolved containedctx linters. Renamed context structs and interfaces to more understandble names. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
44 lines
632 B
Go
44 lines
632 B
Go
package eigentrust
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/reputation"
|
|
)
|
|
|
|
type EpochIteration struct {
|
|
e uint64
|
|
i uint32
|
|
}
|
|
|
|
func (x EpochIteration) Epoch() uint64 {
|
|
return x.e
|
|
}
|
|
|
|
func (x *EpochIteration) SetEpoch(e uint64) {
|
|
x.e = e
|
|
}
|
|
|
|
func (x EpochIteration) I() uint32 {
|
|
return x.i
|
|
}
|
|
|
|
func (x *EpochIteration) SetI(i uint32) {
|
|
x.i = i
|
|
}
|
|
|
|
func (x *EpochIteration) Increment() {
|
|
x.i++
|
|
}
|
|
|
|
type IterationTrust struct {
|
|
EpochIteration
|
|
reputation.Trust
|
|
}
|
|
|
|
func NewEpochIteration(epoch uint64, iter uint32) *EpochIteration {
|
|
ei := EpochIteration{}
|
|
|
|
ei.SetI(iter)
|
|
ei.SetEpoch(epoch)
|
|
|
|
return &ei
|
|
}
|