forked from TrueCloudLab/frostfs-node
[#857] config: allow to parse sizes with suffix
The code is taken from viper as `cast` package that we use doesn't have needed converter. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
b8ba677c85
commit
a0abf10c8e
4 changed files with 100 additions and 0 deletions
|
@ -46,5 +46,15 @@
|
|||
"correct": true,
|
||||
"correct_string": "true",
|
||||
"incorrect": "not true"
|
||||
},
|
||||
|
||||
"sizes": {
|
||||
"size_kb": "1 kb",
|
||||
"size_kb_no_space": "2kb",
|
||||
"size_mb": "12m",
|
||||
"size_gb": "4g",
|
||||
"size_tb": "5 TB",
|
||||
"size_bytes": "2048b",
|
||||
"size_bytes_no_suffix": 123456
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,3 +40,12 @@ bool:
|
|||
correct: true
|
||||
correct_string: "true"
|
||||
incorrect: not true
|
||||
|
||||
sizes:
|
||||
size_kb: 1 kb
|
||||
size_kb_no_space: 2kb
|
||||
size_mb: 12m
|
||||
size_gb: 4g
|
||||
size_tb: 5 TB
|
||||
size_bytes: 2048b
|
||||
size_bytes_no_suffix: 123456
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue