forked from TrueCloudLab/frostfs-node
[#1343] go.mod: Update api-go
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
882c068410
commit
98fe24cdb7
13 changed files with 180 additions and 206 deletions
|
@ -61,7 +61,7 @@ func listShards(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
}
|
||||
|
||||
func prettyPrintShardsJSON(cmd *cobra.Command, ii []*control.ShardInfo) {
|
||||
func prettyPrintShardsJSON(cmd *cobra.Command, ii []control.ShardInfo) {
|
||||
out := make([]map[string]any, 0, len(ii))
|
||||
for _, i := range ii {
|
||||
out = append(out, map[string]any{
|
||||
|
@ -83,7 +83,7 @@ func prettyPrintShardsJSON(cmd *cobra.Command, ii []*control.ShardInfo) {
|
|||
cmd.Print(buf.String()) // pretty printer emits newline, so no need for Println
|
||||
}
|
||||
|
||||
func prettyPrintShards(cmd *cobra.Command, ii []*control.ShardInfo) {
|
||||
func prettyPrintShards(cmd *cobra.Command, ii []control.ShardInfo) {
|
||||
for _, i := range ii {
|
||||
pathPrinter := func(name, path string) string {
|
||||
if path == "" {
|
||||
|
@ -121,7 +121,7 @@ func shardModeToString(m control.ShardMode) string {
|
|||
return "unknown"
|
||||
}
|
||||
|
||||
func sortShardsByID(ii []*control.ShardInfo) {
|
||||
func sortShardsByID(ii []control.ShardInfo) {
|
||||
sort.Slice(ii, func(i, j int) bool {
|
||||
return bytes.Compare(ii[i].GetShard_ID(), ii[j].GetShard_ID()) < 0
|
||||
})
|
||||
|
|
|
@ -77,13 +77,13 @@ func add(cmd *cobra.Command, _ []string) {
|
|||
cmd.Println("Node ID: ", resp.GetBody().GetNodeId())
|
||||
}
|
||||
|
||||
func parseMeta(cmd *cobra.Command) ([]*tree.KeyValue, error) {
|
||||
func parseMeta(cmd *cobra.Command) ([]tree.KeyValue, error) {
|
||||
raws, _ := cmd.Flags().GetStringSlice(metaFlagKey)
|
||||
if len(raws) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
pairs := make([]*tree.KeyValue, 0, len(raws))
|
||||
pairs := make([]tree.KeyValue, 0, len(raws))
|
||||
for i := range raws {
|
||||
k, v, found := strings.Cut(raws[i], "=")
|
||||
if !found {
|
||||
|
@ -94,7 +94,7 @@ func parseMeta(cmd *cobra.Command) ([]*tree.KeyValue, error) {
|
|||
pair.Key = k
|
||||
pair.Value = []byte(v)
|
||||
|
||||
pairs = append(pairs, &pair)
|
||||
pairs = append(pairs, pair)
|
||||
}
|
||||
|
||||
return pairs, nil
|
||||
|
|
|
@ -75,7 +75,7 @@ func move(cmd *cobra.Command, _ []string) {
|
|||
resp, err := cli.GetSubTree(ctx, subTreeReq)
|
||||
commonCmd.ExitOnErr(cmd, "rpc call: %w", err)
|
||||
|
||||
var meta []*tree.KeyValue
|
||||
var meta []tree.KeyValue
|
||||
subtreeResp, err := resp.Recv()
|
||||
for ; err == nil; subtreeResp, err = resp.Recv() {
|
||||
meta = subtreeResp.GetBody().GetMeta()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue