forked from TrueCloudLab/frostfs-node
[#493] node/config: Implement integer casters
Implement `Int` / `Uint` functions which casts value to `int64` / `uint64`. Implement safe functions `IntSafe` / `UintSafe`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
efcd12c71e
commit
2bbd4d0ee3
4 changed files with 107 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
|||
"section": {
|
||||
"any": "thing"
|
||||
},
|
||||
|
||||
"string_slice": {
|
||||
"empty": [],
|
||||
"filled": [
|
||||
|
@ -18,5 +19,12 @@
|
|||
"duration": {
|
||||
"correct": "15m",
|
||||
"incorrect": "some string"
|
||||
},
|
||||
"number": {
|
||||
"int_pos": 1,
|
||||
"int_neg": -1,
|
||||
"fract_pos": 2.5,
|
||||
"fract_neg": -2.5,
|
||||
"incorrect": "some string"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,11 @@ string:
|
|||
|
||||
duration:
|
||||
correct: 15m
|
||||
incorrect: some string
|
||||
incorrect: some string
|
||||
|
||||
number:
|
||||
int_pos: 1
|
||||
int_neg: -1
|
||||
fract_pos: 2.5
|
||||
fract_neg: -2.5
|
||||
incorrect: some string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue