forked from TrueCloudLab/frostfs-node
[#212] reputationsvc: Resolve linters and rename
Resolved containedctx linters. Renamed context structs and interfaces to more understandble names. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
469e8a6e59
commit
7ebbfa3358
24 changed files with 203 additions and 238 deletions
|
@ -1,8 +1,6 @@
|
|||
package eigentrust
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/reputation"
|
||||
)
|
||||
|
||||
|
@ -36,22 +34,11 @@ type IterationTrust struct {
|
|||
reputation.Trust
|
||||
}
|
||||
|
||||
// IterContext aggregates context and data required for
|
||||
// iterations.
|
||||
// nolint: containedctx
|
||||
type IterContext struct {
|
||||
context.Context
|
||||
EpochIteration
|
||||
}
|
||||
|
||||
func NewIterContext(ctx context.Context, epoch uint64, iter uint32) *IterContext {
|
||||
func NewEpochIteration(epoch uint64, iter uint32) *EpochIteration {
|
||||
ei := EpochIteration{}
|
||||
|
||||
ei.SetI(iter)
|
||||
ei.SetEpoch(epoch)
|
||||
|
||||
return &IterContext{
|
||||
Context: ctx,
|
||||
EpochIteration: ei,
|
||||
}
|
||||
return &ei
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue