Skip to content

Commit

Permalink
scenario random functions: docs
Browse files Browse the repository at this point in the history
c31b364c1b102d10dc59f1e2092fac3637101de1
  • Loading branch information
oke11o committed Apr 23, 2024
1 parent 44bc369 commit 86931b5
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 18 deletions.
44 changes: 35 additions & 9 deletions docs/eng/scenario/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,53 @@ functions can be found at [Go template functions](https://pkg.go.dev/text/templa

### uuid

`{{ uuid }}`
```gotemplate
{% raw %}{{ uuid }}{% endraw %}
```

### randInt

`{{ randInt }}`
no arguments
```gotemplate
{% raw %}{{ randInt }}{% endraw %}
```

`{{ randInt 10 }}`
1 argument
```gotemplate
{% raw %}{{ randInt 10 }}{% endraw %}
```

`{{ randInt 100 200 }}`
2 arguments
```gotemplate
{% raw %}{{ randInt 100 200 }}{% endraw %}
```

`{{ randInt 200 .source.global.max_rand_int }}`
2 arguments using source variable
```gotemplate
{% raw %}{{ randInt 200 .source.global.max_rand_int }}{% endraw %}
```

### randString

`{{ randString }}`
no arguments
```gotemplate
{% raw %}{{ randString }}{% endraw %}
```

`{{ randString 10 }}`
1 argument
```gotemplate
{% raw %}{{ randString 10 }}{% endraw %}
```

`{{ randString 10 abcde }}`
2 arguments
```gotemplate
{% raw %}{{ randString 10 abcde }}{% endraw %}
```

`{{ randString 20 .source.global.letters }}`
2 arguments using source variable
```gotemplate
{% raw %}{{ randString 20 .source.global.letters }}{% endraw %}
```

## In the Data Source - variables

Expand Down
44 changes: 35 additions & 9 deletions docs/rus/scenario/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,53 @@ https://pkg.go.dev/text/template#hdr-Functions

### uuid

`{{ uuid }}`
```gotemplate
{% raw %}{{ uuid }}{% endraw %}
```

### randInt

`{{ randInt }}`
без аргументов
```gotemplate
{% raw %}{{ randInt }}{% endraw %}
```

`{{ randInt 10 }}`
1 аргумент
```gotemplate
{% raw %}{{ randInt 10 }}{% endraw %}
```

`{{ randInt 100 200 }}`
2 аргумента
```gotemplate
{% raw %}{{ randInt 100 200 }}{% endraw %}
```

`{{ randInt 200 .source.global.max_rand_int }}`
2 аргумента используем из источника переменных
```gotemplate
{% raw %}{{ randInt 200 .source.global.max_rand_int }}{% endraw %}
```

### randString

`{{ randString }}`
без аргументов
```gotemplate
{% raw %}{{ randString }}{% endraw %}
```

`{{ randString 10 }}`
1 аргумент
```gotemplate
{% raw %}{{ randString 10 }}{% endraw %}
```

`{{ randString 10 abcde }}`
2 аргумента
```gotemplate
{% raw %}{{ randString 10 abcde }}{% endraw %}
```

`{{ randString 20 .source.global.letters }}`
2 аргумента используем из источника переменных
```gotemplate
{% raw %}{{ randString 20 .source.global.letters }}{% endraw %}
```

## В источник данных - variables

Expand Down

0 comments on commit 86931b5

Please sign in to comment.