Skip to content

Commit

Permalink
random string docs
Browse files Browse the repository at this point in the history
  • Loading branch information
evisdrenova committed Nov 13, 2023
1 parent 69861f4 commit bab645d
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 3 deletions.
9 changes: 7 additions & 2 deletions docs/docs/transformers/system/random-int.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Depending on your validations, you may want to configure the output integer. The
},
{
data: [
'Int Length',
'Integer Length',
'Specifies how many digits you want the integer to be. This has a max of 18 digits. ',
'4',
'7',
Expand All @@ -63,7 +63,12 @@ Depending on your validations, you may want to configure the output integer. The
There are several ways you can mix-and-match configurations to get different potential random integer formats. Here are some possible combinations:

<DocsTable
headers={['PreserveLength', 'Int Length', 'Example Input', 'Example Output']}
headers={[
'PreserveLength',
'Integer Length',
'Example Input',
'Example Output',
]}
rowData={[
{
data: ['false', '5', '87242', '23324'],
Expand Down
83 changes: 83 additions & 0 deletions docs/docs/transformers/system/random-string.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: Random String
id: random-string
hide_title: true
slug: /transformers/system/random-string
---

import { TransformerPageHeader } from '@site/src/CustomComponents/TransformerPageHeader.tsx';

import { DocsTable } from '@site/src/CustomComponents/DocsTable.tsx';

<TransformerPageHeader
title="Random String"
type="string"
apiRef="https://github.com/nucleuscloud/neosync/blob/main/worker/internal/benthos/transformers/random_string.go"
/>

## Definition

The random string transformer generates a random string of alphanumeric characters.

For example:
`h2983hf28h92`

By default, the random string transformer generates a string of 10 characters long.

## Configurations

Depending on your validations, you may want to configure the output string. The random string transformer has the following configurations:

<DocsTable
headers={[
'Name',
'Description',
'Default',
'Example Input',
'Example Output',
]}
rowData={[
{
data: [
'Preserve Length',
'Preserves the length of the input integer to the output integer.',
'false',
'hello',
'9Fau3',
],
},
{
data: [
'String Length',
'Specifies how many digits you want the string to be. There is no defined max length that a string can be. ',
'10',
'6',
'noIB8a',
],
},
]}
/>

## Examples

There are several ways you can mix-and-match configurations to get different potential random integer formats. Here are some possible combinations:

<DocsTable
headers={[
'PreserveLength',
'String Length',
'Example Input',
'Example Output',
]}
rowData={[
{
data: ['false', '5', 'bill', 'je7R6'],
},
{
data: ['true', 'N/A', 'lorem', 'i1NMe'],
},
{
data: ['false', 'N/A', 'ipsum', 'Hinw2'],
},
]}
/>
5 changes: 5 additions & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ const sidebars = {
id: 'transformers/system/random-int',
label: 'Random Integer',
},
{
type: 'doc',
id: 'transformers/system/random-string',
label: 'Random String',
},
],
},
{
Expand Down
8 changes: 7 additions & 1 deletion docs/src/theme/DocSidebarItem/Link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ import { GrMysql } from 'react-icons/gr';
import { IoBuildOutline } from 'react-icons/io5';
import { MdPassword } from 'react-icons/md';
import { PiArrowsSplitLight, PiFlaskLight } from 'react-icons/pi';
import { RxAvatar, RxComponentBoolean } from 'react-icons/rx';
import {
RxAvatar,
RxComponentBoolean,
RxLetterCaseCapitalize,
} from 'react-icons/rx';
import { SiKubernetes } from 'react-icons/si';
import { TbDecimal } from 'react-icons/tb';
import { TiSortNumerically } from 'react-icons/ti';
Expand Down Expand Up @@ -148,6 +152,8 @@ export const RenderIcon = (name) => {
return <TbDecimal />;
case 'Random Integer':
return <TiSortNumerically />;
case 'Random String':
return <RxLetterCaseCapitalize />;
default:
return <LayersIcon />;
}
Expand Down

0 comments on commit bab645d

Please sign in to comment.