Changelog
v0.58.0 - 2020-08-23
Summary
Adds template functions:
newUUID
- Generates a new UUID for each invocation.
randomString
- Generates a new random string for each incovation. Accepts a length parameter. If the argument is <= 0
then a ranom string is generated with a random length between length of 2
and 16
.
Example usage with data:
-d '{"order_id":"{{newUUID}}", "item_id":"{{newUUID}}", "sku":"{{randomString 8 }}", "product_name":"{{ranomdString 0}}"}'
Would result in data with JSON representation:
{
"order_id": "3974e7b3-5946-4df5-bed3-8c3dc9a0be19",
"item_id": "cd9c2604-cd9b-43a8-9cbb-d1ad26ca93a4",
"sku": "HlFTAxcm",
"product_name": "xg3NEC"
}
Also adds WithTemplateFuncs()
API option.
Addresses #213.