summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authordoufenghu <[email protected]>2024-06-26 19:37:27 +0800
committerdoufenghu <[email protected]>2024-06-26 19:37:27 +0800
commit28ea49260d2f3990c64e5eeaae59056f028b4e80 (patch)
treeea6302370fee695981dfe89fbc316284ceb00a3c /docs
parentb1e89a9517bfba3b4954f22207ec21a8fd4db653 (diff)
[Improve][docs] Mock Connector support eval expression.
Diffstat (limited to 'docs')
-rw-r--r--docs/connector/connector.md68
1 files changed, 35 insertions, 33 deletions
diff --git a/docs/connector/connector.md b/docs/connector/connector.md
index 493edbf..ff796e6 100644
--- a/docs/connector/connector.md
+++ b/docs/connector/connector.md
@@ -70,39 +70,41 @@ schema:
## Mock Data Type
The mock data type is used to define the template of the mock data.
-| Mock Type | Parameter | Result Type | Default | Description |
-|-----------------------------------------|-------------|-----------------------|---------------------|-------------------------------------------------------------------------------------------------------------------------|
-| **[Number](#Number)** | - | **int/bigint/double** | - | **Randomly generate a number.** |
-| - | min | number | 0 | The minimum value (include). |
-| - | max | number | int32.max | The maximum value (exclusive). |
-| - | options | array of number | (none) | The optional values. If set, the random value will be selected from the options and `start` and `end` will be ignored. |
-| - | random | boolean | true | Default is random mode. If set to false, the value will be generated in order. |
-| **[Sequence](#Sequence)** | - | **bigint** | - | **Generate a sequence number based on a specific step value .** |
-| - | start | bigint | 0 | The first number in the sequence (include). |
-| - | step | bigint | 1 | The number to add to each subsequent value. |
-| **[UniqueSequence](#UniqueSequence)** | - | **bigint** | - | **Generate a global unique sequence number.** |
-| - | start | bigint | 0 | The first number in the sequence (include). |
-| **[String](#String)** | - | string | - | **Randomly generate a string.** |
-| - | regex | string | [a-zA-Z]{0,5} | The regular expression. |
-| - | options | array of string | (none) | The optional values. If set, the random value will be selected from the options and `regex` will be ignored. |
-| - | random | boolean | true | Default is random mode. If set to false, the options value will be generated in order. |
-| **[Timestamp](#Timestamp)** | - | **bigint** | - | **Generate a unix timestamp in milliseconds or seconds.** |
-| - | unit | string | second | The unit of the timestamp. The optional values are `second`, `millis`. |
-| **[FormatTimestamp](#FormatTimestamp)** | - | **string** | - | **Generate a formatted timestamp.** |
-| - | format | string | yyyy-MM-dd HH:mm:ss | The format to output. |
-| - | utc | boolean | false | Default is local time. If set to true, the time will be converted to UTC time. |
-| **[IPv4](#IPv4)** | - | **string** | - | **Randomly generate a IPv4 address.** |
-| - | start | string | 0.0.0.0 | The minimum value of the IPv4 address(include). |
-| - | end | string | 255.255.255.255 | The maximum value of the IPv4 address(include). |
-| **[Expression](#Expression)** | - | string | - | **Use library [Datafaker](https://www.datafaker.net/documentation/expressions/) expressions to generate fake data.** |
-| - | expression | string | (none) | The datafaker expression used #{expression}. |
-| **[Object](#Object)** | - | **struct/object** | - | **Generate a object data structure. It used to define the nested structure of the mock data.** |
-| - | fields | array of object | (none) | The fields of the object. |
-| **[Union](#Union)** | - | - | - | **Generate a union data structure with multiple mock data type fields.** |
-| - | unionFields | array of object | (none) | The fields of the object. |
-| - | - fields | - array of object | (none) | |
-| - | - weight | - int | 0 | The weight of the generated object. |
-| | random | boolean | true | Default is random mode. If set to false, the options value will be generated in order. |
+| Mock Type | Parameter | Result Type | Default | Description |
+|-----------------------------------------|-------------|-----------------------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------|
+| **[Number](#Number)** | - | **int/bigint/double** | - | **Randomly generate a number.** |
+| - | min | number | 0 | The minimum value (include). |
+| - | max | number | int32.max | The maximum value (exclusive). |
+| - | options | array of number | (none) | The optional values. If set, the random value will be selected from the options and `start` and `end` will be ignored. |
+| - | random | boolean | true | Default is random mode. If set to false, the value will be generated in order. |
+| **[Sequence](#Sequence)** | - | **bigint** | - | **Generate a sequence number based on a specific step value .** |
+| - | start | bigint | 0 | The first number in the sequence (include). |
+| - | step | bigint | 1 | The number to add to each subsequent value. |
+| **[UniqueSequence](#UniqueSequence)** | - | **bigint** | - | **Generate a global unique sequence number.** |
+| - | start | bigint | 0 | The first number in the sequence (include). |
+| **[String](#String)** | - | string | - | **Randomly generate a string.** |
+| - | regex | string | [a-zA-Z]{0,5} | The regular expression. |
+| - | options | array of string | (none) | The optional values. If set, the random value will be selected from the options and `regex` will be ignored. |
+| - | random | boolean | true | Default is random mode. If set to false, the options value will be generated in order. |
+| **[Timestamp](#Timestamp)** | - | **bigint** | - | **Generate a unix timestamp in milliseconds or seconds.** |
+| - | unit | string | second | The unit of the timestamp. The optional values are `second`, `millis`. |
+| **[FormatTimestamp](#FormatTimestamp)** | - | **string** | - | **Generate a formatted timestamp.** |
+| - | format | string | yyyy-MM-dd HH:mm:ss | The format to output. |
+| - | utc | boolean | false | Default is local time. If set to true, the time will be converted to UTC time. |
+| **[IPv4](#IPv4)** | - | **string** | - | **Randomly generate a IPv4 address.** |
+| - | start | string | 0.0.0.0 | The minimum value of the IPv4 address(include). |
+| - | end | string | 255.255.255.255 | The maximum value of the IPv4 address(include). |
+| **[Expression](#Expression)** | - | string | - | **Use library [Datafaker](https://www.datafaker.net/documentation/expressions/) expressions to generate fake data.** |
+| - | expression | string | (none) | The datafaker expression used #{expression}. |
+| **[Eval](#Eval)** | - | **string** | - | **Use AviatorScript value expression to generate data.** |
+| - | expression | string | (none) | Support basic arithmetic operations and function calls. More details sess [AviatorScript](https://www.yuque.com/boyan-avfmj/aviatorscript). |
+| **[Object](#Object)** | - | **struct/object** | - | **Generate a object data structure. It used to define the nested structure of the mock data.** |
+| - | fields | array of object | (none) | The fields of the object. |
+| **[Union](#Union)** | - | - | - | **Generate a union data structure with multiple mock data type fields.** |
+| - | unionFields | array of object | (none) | The fields of the object. |
+| - | - fields | - array of object | (none) | |
+| - | - weight | - int | 0 | The weight of the generated object. |
+| | random | boolean | true | Default is random mode. If set to false, the options value will be generated in order. |
### Common Parameters