MCPcopy Index your code
hub / github.com/NVIDIA/aistore / parseByteFlagToInt

Function parseByteFlagToInt

cmd/cli/commands/utils.go:1233–1241  ·  view source on GitHub ↗
(c *cli.Context, flag cli.Flag)

Source from the content-addressed store, hash-verified

1231}
1232
1233func parseByteFlagToInt(c *cli.Context, flag cli.Flag) (int64, error) {
1234 flagValue := parseStrFlag(c, flag.(cli.StringFlag))
1235 b, err := cos.S2B(flagValue)
1236 if err != nil {
1237 return 0, fmt.Errorf("%s (%s) is invalid, expected either a number or a number with a size suffix (kb, MB, GiB, ...)",
1238 flag.GetName(), flagValue)
1239 }
1240 return b, nil
1241}
1242
1243func parseChecksumFlags(c *cli.Context) []*cos.Cksum {
1244 cksums := []*cos.Cksum{}

Callers 4

genShardsHandlerFunction · 0.85
getObjectFunction · 0.85
putSingleObjectChunkedFunction · 0.85
startDownloadHandlerFunction · 0.85

Calls 2

S2BFunction · 0.92
parseStrFlagFunction · 0.85

Tested by

no test coverage detected