forked from TrueCloudLab/frostfs-node
1db6d316c2
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru> Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
47 lines
890 B
Go
47 lines
890 B
Go
package container
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
|
)
|
|
|
|
type StartEstimation struct {
|
|
epoch int64
|
|
}
|
|
|
|
func (e *StartEstimation) SetEpoch(v int64) {
|
|
e.epoch = v
|
|
}
|
|
|
|
type StopEstimation struct {
|
|
epoch int64
|
|
}
|
|
|
|
func (e *StopEstimation) SetEpoch(v int64) {
|
|
e.epoch = v
|
|
}
|
|
|
|
func (c *Client) StartEstimation(args StartEstimation) error {
|
|
prm := client.InvokePrm{}
|
|
|
|
prm.SetMethod(c.startEstimation)
|
|
prm.SetArgs(args.epoch)
|
|
|
|
if err := c.client.Invoke(prm); err != nil {
|
|
return fmt.Errorf("could not invoke method (%s): %w", c.startEstimation, err)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (c *Client) StopEstimation(args StopEstimation) error {
|
|
prm := client.InvokePrm{}
|
|
|
|
prm.SetMethod(c.stopEstimation)
|
|
prm.SetArgs(args.epoch)
|
|
|
|
if err := c.client.Invoke(prm); err != nil {
|
|
return fmt.Errorf("could not invoke method (%s): %w", c.stopEstimation, err)
|
|
}
|
|
return nil
|
|
}
|