Evgenii Stratonikov
e3487d5af5
All checks were successful
Tests and linters / Run gofumpt (push) Successful in 2m10s
Tests and linters / Staticcheck (push) Successful in 2m52s
Vulncheck / Vulncheck (push) Successful in 2m50s
Build / Build Components (push) Successful in 3m23s
Pre-commit hooks / Pre-commit (push) Successful in 3m33s
Tests and linters / gopls check (push) Successful in 4m8s
Tests and linters / Lint (push) Successful in 4m16s
Tests and linters / Tests (push) Successful in 4m19s
Tests and linters / Tests with -race (push) Successful in 5m1s
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
22 lines
541 B
Go
22 lines
541 B
Go
package netmap
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client"
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap"
|
|
)
|
|
|
|
// GetNetMap calls "snapshot" method and decodes netmap.NetMap from the response.
|
|
func (c *Client) GetNetMap(diff uint64) (*netmap.NetMap, error) {
|
|
prm := client.TestInvokePrm{}
|
|
prm.SetMethod(snapshotMethod)
|
|
prm.SetArgs(diff)
|
|
|
|
res, err := c.client.TestInvoke(prm)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("test invoke (%s): %w", snapshotMethod, err)
|
|
}
|
|
|
|
return DecodeNetMap(res)
|
|
}
|