[#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:
Dmitrii Stepanov 2023-04-05 10:44:40 +03:00 committed by Gitea
parent 469e8a6e59
commit 7ebbfa3358
24 changed files with 203 additions and 238 deletions

View file

@ -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
}