forked from TrueCloudLab/frostfs-node
[#484] cmd/reputation: split it into subpackages
Split cmd/reputation into subpackages for future refactoring. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
7acfc85f8a
commit
ff7a8ae677
5 changed files with 432 additions and 287 deletions
45
cmd/neofs-node/reputation/local/util.go
Normal file
45
cmd/neofs-node/reputation/local/util.go
Normal file
|
@ -0,0 +1,45 @@
|
|||
package local
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
|
||||
)
|
||||
|
||||
type EpochContext struct {
|
||||
context.Context
|
||||
E uint64
|
||||
}
|
||||
|
||||
func (ctx *EpochContext) Epoch() uint64 {
|
||||
return ctx.E
|
||||
}
|
||||
|
||||
type NopReputationWriter struct{}
|
||||
|
||||
func (NopReputationWriter) Write(reputation.Trust) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (NopReputationWriter) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type OnlyKeyRemoteServerInfo struct {
|
||||
Key []byte
|
||||
}
|
||||
|
||||
func (i *OnlyKeyRemoteServerInfo) PublicKey() []byte {
|
||||
return i.Key
|
||||
}
|
||||
|
||||
func (*OnlyKeyRemoteServerInfo) Address() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
const invalidPrmValFmt = "invalid parameter %s (%T):%v"
|
||||
|
||||
func panicOnPrmValue(n string, v interface{}) {
|
||||
panic(fmt.Sprintf(invalidPrmValFmt, n, v, v))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue