提交 7f4eafc9 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

update resource

上级 9c579a37
无法预览此类型文件
......@@ -93,6 +93,12 @@ fields:
format: "passwd%02d" # 用%02d补零,使密码整体保持8位。
postfix: "\t"
- field: field_length # 指定宽度。
range: 1-9 # 001,002,003..., 099,100
width: 3 # 包含前后缀的宽度。
leftpad: 0 # 宽度不够时,补充的字符。
postfix: "\t"
- field: field_text # 从一个文件中随机读取。
range: users.txt:R # 相对当前文件路径。
postfix: "\t"
......@@ -106,7 +112,7 @@ fields:
postfix: "\t"
- field: field_use_ranges # 引用內置的定义文件,该文件定义了多个range,他们共享了一些field层面的属性。
from: zentao.number.v1.yaml # 引用yaml/zentao/number/v1.yaml文件里面的ranges定义。
from: zentao.number.v1.yaml # 引用yaml/jenkins/number/v1.yaml文件里面的ranges定义。
use: medium # 使用该文件中定义的medium分组。
postfix: "\t"
......
......@@ -78,10 +78,6 @@ fields:
range: 1-10:R # 1,5,8...
postfix: "\t"
- field: field_file # Read a list from a file and set it as random.
range: users.txt:R # Using the lines of users.txt as range and set it as random.
postfix: "\t"
- field: field_loop # Self-loop field.
range: a-z # a_b_c | d_e_f | g_h_i
loop: 3 # Loop three times.
......@@ -96,39 +92,42 @@ fields:
range: 1-10 # passwd 1,passwd 2,passwd 3 ... passwd10。
format: "passwd%02d"
postfix: "\t"
- field: field_length # Fixed length field.
range: 1-100 # 001,002,003..., 099,100
length: 3 # the length in Byte.
width: 3 # the length in Byte including prefix and postfix.
leftpad: 0 # Using 0 to pad.
postfix: "\t"
- field: field_text # Read a list from a file and set it as random.
range: users.txt:R # Using the lines of users.txt as range and set it as random.
postfix: "\t"
- field: field_yaml # use another yaml file's data.
range: test/test-nested2.yaml{3} # related path.
postfix: "\t"
- field: field_use_another_file # Other definition file can be referred.
- field: field_use_config # Other definition file can be referred.
config: number.yaml # Refer to the definition in number.yaml of the current directory.
postfix: "\t"
- field: field_use_ranges # Other definition file can be referred, in which more than one ranges are defined.
from: custom.test.number.v1.yaml # Refer to the ranges in data/custom/number/v1.yaml.
from: zentao.number.v1.yaml # Refer to the ranges in yaml/zentao/number/v1.yaml.
use: medium # use medium range.
postfix: "\t"
- field: field_use_instance # Refer to other definition file which defines multiple instances.
from: system.ip.v1.yaml # Refer to data/system/ip/v1.yaml.
from: ip.v1.yaml # Refer to yaml/ip/v1.yaml.
use: privateB,privateC # Use the two instances of privateC and privateB defined in this file.
postfix: "\t"
- field: field_nested_instant # Refer to other definition file which refer another instances definition.
from: custom.ip.private.yaml # Refer to data/custom/ip/private.yaml
use: all # Use all instances defined in this file.
prefix: "{"
postfix: "}"
- field: field_use_excel # Read the data from the data source of excel.
from: system.address.v1.china # Read the book named china in data/system/address/v1.xlsx.
from: address.cn.v1.china # Read the sheet named 'china' in data/address/cn.v1.xlsx.
select: city # Query the field city.
where: cityCode = 852 # Query condition.
postfix: "\t"
- field: field_with_children # Embeded field.
- field: field_with_children # nested fields.
fields:
- field: child1
range: a-z
......
此差异已折叠。
......@@ -65,25 +65,21 @@ version: 1.0
fields:
- field: field_common # 默认的列表类型,通过逗号隔成若干区
- field: field_common # 默认的列表类型,通过逗号隔成若干区
range: 1-10, 20-25, 27, 29, 30 # 1,2,3...,10,20,21,22...,25,27,29.30
prefix: int_ # 前缀
prefix: "" # 前缀
postfix: "\t" # 后缀,特殊字符加引号,否则无法解析。
- field: field_step # 区间可以指定步长。
- field: field_step # 区间指定步长。
range: 1-10:2, 1-2:0.1 # 1,3,5,7,9,1, 1.1,1.2...,2
postfix: "\t"
- field: field_random # 通过R属性指定随机。R属性和步长不能同时出现。
- field: field_random # 区间指定随机。随机属性R同步长不能同时出现。
range: 1-10:R # 1,5,8...
postfix: "\t"
- field: field_file # 从一个文件中读取列表,并指定随机。
range: users.txt:R # 该文件中一行作为一个元素,并随机。
postfix: "\t"
- field: field_loop # 自循环的字段。
range: a-z # a_b_c | d_e_f | g_h_i
range: a-z # a|b|c ...
loop: 3 # 循环三次
loopfix: _ # 每次循环的连接符。
postfix: "\t"
......@@ -94,36 +90,44 @@ fields:
- field: field_format # 通过格式化字符串输出。
range: 1-10 # passwd 1,passwd 2,passwd 3 ... passwd10。
format: "passwd%02d" # 用%2d补零,使密码整体保持8位,%2d默认补空格
format: "passwd%02d" # 用%02d补零,使密码整体保持8位
postfix: "\t"
- field: field_use_another_file # 可以引用其他的定义文件。
config: number.yaml # 引用当前目录下面的number.yaml文件里面的定义。
- field: field_length # 指定宽度。
range: 1-9 # 001,002,003..., 099,100
width: 3 # 包含前后缀的宽度。
leftpad: 0 # 宽度不够时,补充的字符。
postfix: "\t"
- field: field_text # 从一个文件中随机读取。
range: users.txt:R # 相对当前文件路径。
postfix: "\t"
- field: field_yaml # 引用其他的定义文件整体内容。
range: test/test-nested2.yaml{3} # 相对当前文件路径。
postfix: "\t"
- field: field_use_config # 引用其他的config定义文件。
config: number.yaml # 相对当前文件路径,config内包含单个字段。
postfix: "\t"
- field: field_use_ranges # 引用內置的定义文件,该文件定义了多个range,他们共享了一些field层面的属性。
from: jenkins.number.v1.yaml # 引用data/custom/number/v1.yaml文件里面的ranges定义。
from: zentao.number.v1.yaml # 引用yaml/jenkins/number/v1.yaml文件里面的ranges定义。
use: medium # 使用该文件中定义的medium分组。
postfix: "\t"
- field: field_use_instance # 引用其他的定义文件,该文件定义了多个实例。
from: ip.v1.yaml # 引用data/system/ip/v1.yaml
from: ip.v1.yaml # yaml/ip/v1.yaml
use: privateC,privateB # 使用该文件中定义的privateC和privateB两个实例。
postfix: "\t"
- field: field_nested_instant # 引用其他的定义文件,且该文件引用了其他实例。
from: jenkins.ip.private.yaml # 引用data/custom/ip/private.yaml
use: all # 使用该文件中的所有实例。
prefix: "{"
postfix: "}"
- field: field_use_excel # 从excel数据源里面取数据。
from: address.cn.v1.china # 从data/system/address/v1.xlsx文件中读取名为china的工作簿。
from: address.cn.v1.china # 从data/address/v1.xlsx文件中读取名为china的工作簿。
select: city # 查询city字段。
where: state like '%山东%' # 条件是省份包含山东。
postfix: "\t"
- field: field_with_children # 嵌套字段
- field: field_with_children # 字段多层嵌套
fields:
- field: child1
range: a-z
......
......@@ -41,8 +41,8 @@ type DefField struct {
FieldBase `yaml:",inline"`
Fields []DefField `yaml:"fields,flow"`
Width int `yaml:"width"`
LeftPad string `yaml:"leftPad"`
RightPad string `yaml:"rightPad"`
LeftPad string `yaml:"leftpad"`
RightPad string `yaml:"rightpad"`
Path string
Froms []DefField `yaml:"froms,flow"`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册