Skip to content

Template custom functions

Within Greenmask, custom functions play a crucial role, providing a wide array of options for implementing diverse logic. Under the hood, the custom functions are based on the sprig Go's template functions. Greenmask enhances this capability by introducing additional functions and transformation functions. These extensions mirror the logic found in the standard transformers but offer you the flexibility to implement intricate and comprehensive logic tailored to your specific needs.

Currently, you can use template custom functions for the advanced transformers:

Custom functions are arbitrarily divided into 2 groups:

  • Core functions — custom functions that vary in purpose and include PostgreSQL driver, JSON output, testing, and transformation functions.
  • Faker functions — custom function of a faker type which generate synthetic data.