apache / apache/openwhisk-wskdeploy
Add support for the scalar-unit 'size' and types
- Dominant language
- Go
- Stars
- 75
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Description
```scalar-unit`` types are convenience types for declaring common scalars that have an associated unit. For example, “10 msec.”, “2 Gb”, etc.).
**Grammar**:
``` ```
In the above grammar, the pseudo values that appear in angle brackets have the following meaning:
• scalar: is a required scalar value (e.g., integer).
• unit: is a required unit value. The unit value MUST be type-compatible with the scalar value.
**Examples**:
```
inputs:
max_storage_size:
type: scalar-unit.size
default: 10 GB
archive_period:
type: scalar-unit.time
default: 30 d
```
**Requirements**
• Whitespace: any number of spaces (including zero or none) SHALL be allowed between the scalar value and the unit value.
• It SHALL be considered an error if either the scalar or unit portion is missing on a property or attribute declaration derived from any scalar-unit type.
**Recognized units for sizes** (i.e., scalar-unit.size)
Unit | Description
-- | --
B | byte
kB | kilobyte (1000 bytes)
MB | megabyte (1000000 bytes)
GB | gigabyte (1000000000 bytes)
TB[MR1] | terabyte (1000000000000 bytes)
**Recognized units for times** (i.e., scalar-unit.time)
Unit | Description
-- | --
d | days
h | hours
m | minutes
s | seconds
ms | milliseconds
us | microseconds
Contributor guide
Research direction
No files, tests, or entry points are named. Start by locating the type parsing and validation code for scalar-unit declarations, then trace how defaults and property or attribute values are checked; done means supporting the specified size and time units, optional whitespace, and errors for missing scalar or unit portions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100