Comments (4)
Some suggestions:
In this context, "generator" is a list, so I suggest using the plural form:
generators:
-
-
Or this the generator (singular) that is defined with a list of masks ?
Make the git support explicit in the URL scheme:
version: "1"
load:
- "http://domain.org/mylibrary"
- "https+git://github.com/repo/[email protected]"
- "file://mylocalibrary"
from pimo.
To embed the generator in a binary and expose it using the "pimo://" scheme, consider the following example:
version: "1"
load:
- "http://domain.org/mylibrary"
- "https+git://github.com/repo/[email protected]"
- "file://mylocalibrary"
- "pimo://embedded_generator"
This way, you can include the generator within the pimo
binary and access it using the "pimo://" scheme.
from pimo.
Or this the generator (singular) that is defined with a list of masks ?
Yes, the generator is defined by the whole list
from pimo.
Note: first post updated
A generator could also be defined like this
filename : nir.yml
masking:
- selector:
jsonpath: "gender" #if present then gender is used a parameter
masks:
- add: true #add parameter if not present
- randomChoice: [1, 2]
preserve: "value" #preserve parameter value if present
# other parameters ...
- selector:
jsonpath: "nir"
masks:
- add: true #in this example, the result will be created in a new subfield
- template: '{{if eq .gender "M" }}1{{else}}2{{end}}{{.birth_date | substr 8 10}}{{.birth_date | substr 3 5}}{{.department_code | printf "%02d"}}{{.city_code | printf "%03d"}}{{.order | printf "%03d"}}'
- template: '{{ sub 97 (mod (int64 .nir_start) 97)}}'
This is a normal masking definition except for the preserve "value" option that does not exist yet.
The call to the generator :
- selector:
jsonpath: "nir"
mask:
generate:
using: "nir"
with:
gender: # this field is of type MaskType
- constant: 2
MaskType :
Line 167 in 8daf79d
This way, generator can use other generators, for example
person.yml
version: "1"
masking:
- selector:
jsonpath: "first_name"
mask:
- add: true
- generate:
using: "first_name_fr_FR"
- selector:
jsonpath: "last_name"
mask:
- add: true
- generate:
using: "last_name_fr_FR"
- selector:
jsonpath: "." # generate in the current document
mask:
- add: true
- generate:
using: "nir"
person-with-coherence.yml
version: "1"
masking:
- selector:
jsonpath: "."
mask:
- add: true
- generate:
using: "person"
seed: "."
from pimo.
Related Issues (20)
- Add `field` option to Markov mask for selecting a specific field in a CSV
- Add emptyValueProbability option to randomChoiceInUri mask for handling empty values
- [BUG] Mask with seed from field and global seed HOT 1
- [PROPOSAL] Random Choice in CSV
- [BUG] hashInUri on Windows
- BUG : protect wasm against panic
- [TEST] Venom test has a chance to fail
- [PROPOSAL] FF1 Improvements
- pipe : no randomization HOT 1
- [PROPOSAL] Switch case mask
- [PROPOSAL] findInCSV mask for data masking HOT 1
- [Proposal] : New Feature XML Mask
- [PROPOSAL] New `pimo serve` command for a dynamic API feature
- [Dependency] GoRegen
- feat: timeline generation
- Feature Request: Adding 'median' Parameter to RandomInt Mask
- feat(ff1): preserve domain
- feat(ff1): log field value as WARN when an error occurs
- feat(template): generate id sequence
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pimo.