Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
range: refactor, use type / check/type
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-wa committed Mar 5, 2017
1 parent a943ec1 commit 9ffa137
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 149 deletions.
16 changes: 10 additions & 6 deletions src/plugins/range/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@ The range plugin checks if a Key value is within a given range.

The plugin checks every Key in the Keyset for the Metakey `check/range` which contains either a single range with the syntax `[-]min-[-]max`, or a list of ranges separated by `,` and tests if the Key value is within the range(s).

`check/range/type` can be used to specify the datatype. If not specified otherwise the default value is `INT`
`check/type` or `type` can be used to specify the datatype. If not specified otherwise the default value is `INT`

Possible values:

* `INT`
* `short`, `long`, `long long`

for integer values
for signed integer values

* `FLOAT`
* `unsigned short`, `unsigned long`, `unsigned long long`

for unsigned integer values

* `float`, `double`, `long double`

for floating point values

* `HEX`

for hexadecimal values

* `CHAR`
* `char`

for characters

Expand All @@ -51,7 +55,7 @@ sudo kdb mount range.ecf /examples/range range dump

# should succeed
kdb set /examples/range/value 5
kdb setmeta user/examples/range/value check/range "1-10"
kdb setmeta /examples/range/value check/range "1-10"
# RET: 0

# should fail
Expand Down
Loading

0 comments on commit 9ffa137

Please sign in to comment.