Documentation ¶
Index ¶
- Constants
- Variables
- func NewCmd(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewDictTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewHashTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewJsonTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewMaskingTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewNoiseDateTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewNoiseFloatTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewNoiseIntTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomBoolTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomChoiceTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomDateTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomFloatTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomIntTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomStringTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRandomUuidTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewRegexpReplaceTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewReplaceTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewSetNullTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewTemplateRecordTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- func NewTemplateTransformer(ctx context.Context, driver *toolkit.Driver, ...) (utils.Transformer, toolkit.ValidationWarnings, error)
- type Cmd
- type Column
- type ColumnContext
- func (cc *ColumnContext) DecodeValue(v any) (any, error)
- func (cc *ColumnContext) DecodeValueByColumn(name string, v any) (any, error)
- func (cc *ColumnContext) DecodeValueByType(name string, v any) (any, error)
- func (cc *ColumnContext) EncodeValue(v any) (any, error)
- func (cc *ColumnContext) EncodeValueByColumn(name string, v any) (any, error)
- func (cc *ColumnContext) EncodeValueByType(name string, v any) (any, error)
- func (cc *ColumnContext) GetColumnRawValue(name string) (any, error)
- func (cc *ColumnContext) GetColumnType() string
- func (cc *ColumnContext) GetColumnValue(name string) (any, error)
- func (cc *ColumnContext) GetRawValue() (any, error)
- func (cc *ColumnContext) GetValue() (any, error)
- type DictTransformer
- type HashTransformer
- type JsonContext
- func (jc *JsonContext) DecodeValueByColumn(name string, v any) (any, error)
- func (jc *JsonContext) DecodeValueByType(name string, v any) (any, error)
- func (jc *JsonContext) EncodeValueByColumn(name string, v any) (any, error)
- func (jc *JsonContext) EncodeValueByType(name string, v any) (any, error)
- func (jc *JsonContext) GetColumnRawValue(name string) (any, error)
- func (jc *JsonContext) GetColumnValue(name string) (any, error)
- func (jc *JsonContext) GetOriginalValue() any
- func (jc *JsonContext) GetPath() string
- func (jc *JsonContext) OriginalValueExists() bool
- type JsonTransformer
- type MaskingTransformer
- type NoiseDateTransformer
- func (ndt *NoiseDateTransformer) Done(ctx context.Context) error
- func (ndt *NoiseDateTransformer) GetAffectedColumns() map[int]string
- func (ndt *NoiseDateTransformer) Init(ctx context.Context) error
- func (ndt *NoiseDateTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type NoiseFloatTransformer
- func (nft *NoiseFloatTransformer) Done(ctx context.Context) error
- func (nft *NoiseFloatTransformer) GetAffectedColumns() map[int]string
- func (nft *NoiseFloatTransformer) Init(ctx context.Context) error
- func (nft *NoiseFloatTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type NoiseFloatTransformerParams
- type NoiseIntTransformer
- func (nit *NoiseIntTransformer) Done(ctx context.Context) error
- func (nit *NoiseIntTransformer) GetAffectedColumns() map[int]string
- func (nit *NoiseIntTransformer) Init(ctx context.Context) error
- func (nit *NoiseIntTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type Operation
- type RandomBoolTransformer
- func (rbt *RandomBoolTransformer) Done(ctx context.Context) error
- func (rbt *RandomBoolTransformer) GetAffectedColumns() map[int]string
- func (rbt *RandomBoolTransformer) Init(ctx context.Context) error
- func (rbt *RandomBoolTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomChoiceTransformer
- func (ht *RandomChoiceTransformer) Done(ctx context.Context) error
- func (ht *RandomChoiceTransformer) GetAffectedColumns() map[int]string
- func (ht *RandomChoiceTransformer) Init(ctx context.Context) error
- func (rct *RandomChoiceTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomDateTransformer
- func (rdt *RandomDateTransformer) Done(ctx context.Context) error
- func (rdt *RandomDateTransformer) GetAffectedColumns() map[int]string
- func (rdt *RandomDateTransformer) Init(ctx context.Context) error
- func (rdt *RandomDateTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomDateTransformerParams
- type RandomFloatTransformer
- func (rft *RandomFloatTransformer) Done(ctx context.Context) error
- func (rft *RandomFloatTransformer) GetAffectedColumns() map[int]string
- func (rft *RandomFloatTransformer) Init(ctx context.Context) error
- func (rft *RandomFloatTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomIntTransformer
- func (rit *RandomIntTransformer) Done(ctx context.Context) error
- func (rit *RandomIntTransformer) GetAffectedColumns() map[int]string
- func (rit *RandomIntTransformer) Init(ctx context.Context) error
- func (rit *RandomIntTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomStringTransformer
- func (rst *RandomStringTransformer) Done(ctx context.Context) error
- func (rst *RandomStringTransformer) GetAffectedColumns() map[int]string
- func (rst *RandomStringTransformer) Init(ctx context.Context) error
- func (rst *RandomStringTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RandomUuidTransformer
- func (rut *RandomUuidTransformer) Done(ctx context.Context) error
- func (rut *RandomUuidTransformer) GetAffectedColumns() map[int]string
- func (rut *RandomUuidTransformer) Init(ctx context.Context) error
- func (rut *RandomUuidTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type RegexpReplaceTransformer
- func (rrt *RegexpReplaceTransformer) Done(ctx context.Context) error
- func (rrt *RegexpReplaceTransformer) GetAffectedColumns() map[int]string
- func (rrt *RegexpReplaceTransformer) Init(ctx context.Context) error
- func (rrt *RegexpReplaceTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type ReplaceTransformer
- type SetNullTransformer
- type TemplateRecordTransformer
- func (sut *TemplateRecordTransformer) Done(ctx context.Context) error
- func (sut *TemplateRecordTransformer) GetAffectedColumns() map[int]string
- func (sut *TemplateRecordTransformer) Init(ctx context.Context) error
- func (sut *TemplateRecordTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
- type TemplateTransformer
- func (sut *TemplateTransformer) Done(ctx context.Context) error
- func (sut *TemplateTransformer) GetAffectedColumns() map[int]string
- func (sut *TemplateTransformer) Init(ctx context.Context) error
- func (sut *TemplateTransformer) Transform(ctx context.Context, r *toolkit.Record) (*toolkit.Record, error)
Constants ¶
View Source
const ( JsonDeleteOpName = "delete" JsonSetOpName = "set" )
Variables ¶
View Source
var CmdTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( cmdTransformerName, "Transform data via external program using stdin and stdout interaction", ), NewCmd, toolkit.MustNewParameter( "columns", "affected column names. If empty use the whole tuple."+ "The structure:"+ `{`+ `"name": "type:string, required:true, description: column Name",`+ `"not_affected": "type:bool, required:false, description: is column affected in transformation", `+ `"skip_original_data": "type:bool, required:false, description: is original data required for transformer",`+ `"skip_on_null_input": "type:bool, required:false, description: skip transformation on null input"`+ `}`, ).SetDefaultValue([]byte("[]")), toolkit.MustNewParameter( "executable", "path to executable file", ).SetRequired(true), toolkit.MustNewParameter( "args", "list of parameters for executable file", ).SetDefaultValue([]byte("[]")), toolkit.MustNewParameter( "driver", "row driver with parameters that is used for interacting with cmd. The default is csv. "+ `The structure is:`+ `{"name": "text|csv|json", "params": { "format": "[text|bytes]"} }`, ).SetDefaultValue([]byte(`{"name": "csv"}`)), toolkit.MustNewParameter( "validate", "try to encode-decode data received from cmd", ).SetDefaultValue([]byte("false")), toolkit.MustNewParameter( "timeout", "timeout for sending and receiving data from cmd", ).SetDefaultValue([]byte("2s")), toolkit.MustNewParameter( "expected_exit_code", "expected exit code", ).SetDefaultValue([]byte("0")), toolkit.MustNewParameter( "skip_on_behaviour", "skip transformation call if one of the provided columns has null value (any) or each of the provided"+ " column has null values (all). This option works together with skip_on_null_input parameter on columns."+ `Possible values: "all", "any"`, ).SetDefaultValue([]byte("all")). SetRawValueValidator(cmdValidateSkipBehaviour), )
View Source
var DictTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Dict", "Replace values matched by dictionary keys", ), NewDictTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true), ).SetRequired(true), toolkit.MustNewParameter( "values", `map of value to replace in format: {"string": "string"}". The string with value "\N" supposed to be NULL value`, ).SetRequired(true), toolkit.MustNewParameter( "default", `default value if not any value has been matched with dict. The string with value "\N" supposed to be NULL value. Default is empty`, ).SetRequired(false), toolkit.MustNewParameter( "fail_not_matched", `fail if value is not matched with dict otherwise keep value`, ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("false")), toolkit.MustNewParameter( "validate", `perform encode-decode procedure using column type, ensuring that value has correct type`, ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var ErrRowTransformationTimeout = errors.New("row transformation timeout")
View Source
var HashTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Hash", "Generate hash of the text value using Scrypt hash function under the hood", ), NewHashTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("text", "varchar"), ).SetRequired(true), toolkit.MustNewParameter( "salt", "salt for hash", ), )
View Source
var JsonTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Json", "Update json document", ), NewJsonTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("json", "jsonb"), ).SetRequired(true), toolkit.MustNewParameter( "operations", "list of operations that contains editing operation", ).SetRequired(true), toolkit.MustNewParameter( "keep_null", "apply changes in value is null", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var MaskingTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Masking", "Mask a value using one of masking type", ), NewMaskingTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("text", "varchar"), ).SetRequired(true), toolkit.MustNewParameter( "type", "logical type of attribute (default, password, name, addr, email, mobile, tel, id, credit, url)", ).SetRawValueValidator(maskerTypeValidator). SetDefaultValue(toolkit.ParamsValue(MDefault)), )
View Source
var NoiseDateTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "NoiseDate", "Add some random value (shift value) in the provided interval", ), NewNoiseDateTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("date", "timestamp", "timestamptz"). SetSkipOnNull(true), ).SetRequired(true), toolkit.MustNewParameter( "ratio", "max random duration for noise", ).SetRequired(true). SetCastDbType("interval"), toolkit.MustNewParameter( "truncate", fmt.Sprintf("truncate date till the part (%s)", strings.Join(truncateParts, ", ")), ), )
View Source
var NoiseFloatTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "NoiseFloat", "Make noise float for int", ), NewNoiseFloatTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("float4", "float8"). SetSkipOnNull(true), ).SetRequired(true), toolkit.MustNewParameter( "ratio", "max random percentage for noise", ).SetDefaultValue(toolkit.ParamsValue("0.1")), toolkit.MustNewParameter( "precision", "precision of noised float value (number of digits after coma)", ).SetDefaultValue(toolkit.ParamsValue("4")), )
View Source
var NoiseIntTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "NoiseInt", "Make noise value for int", ), NewNoiseIntTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("int2", "int4", "int8"). SetSkipOnNull(true), ).SetRequired(true), toolkit.MustNewParameter( "ratio", "max random percentage for noise", ).SetRequired(true). SetDefaultValue(toolkit.ParamsValue("0.1")), )
View Source
var RandomBoolTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomBool", "Generate random bool", ), NewRandomBoolTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("bool"), ).SetRequired(true), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomChoiceTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomChoice", "Replace values chosen randomly from list", ), NewRandomChoiceTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true), ).SetRequired(true), toolkit.MustNewParameter( "values", `list of value to randomly in string format. The string with value "\N" supposed to be NULL value`, ).SetRequired(true), toolkit.MustNewParameter( "validate", `perform encode-decode procedure using column type, ensuring that value has correct type`, ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("true")), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomDateTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomDate", "Generate random date in the provided interval", ), NewRandomDateTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("date", "timestamp", "timestamptz"), ).SetRequired(true), toolkit.MustNewParameter( "min", "min threshold date (and/or time) of random value", ).SetRequired(true). SetLinkParameter("column"), toolkit.MustNewParameter( "max", "max threshold date (and/or time) of random value", ).SetRequired(true). SetLinkParameter("column"), toolkit.MustNewParameter( "truncate", fmt.Sprintf("truncate date till the part (%s)", strings.Join(truncateParts, ", ")), ), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomFloatTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomFloat", "Generate random float", ), NewRandomFloatTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("float4", "float8"), ).SetRequired(true), toolkit.MustNewParameter( "min", "min float threshold of random value. The value range depends on column type", ).SetRequired(true), toolkit.MustNewParameter( "max", "min float threshold of random value. The value range depends on column type", ).SetRequired(true), toolkit.MustNewParameter( "precision", "precision of random float value (number of digits after coma)", ).SetDefaultValue(toolkit.ParamsValue("4")), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomIntTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomInt", "Generate random int value from min to max", ), NewRandomIntTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("int2", "int4", "int8"), ).SetRequired(true), toolkit.MustNewParameter( "min", "min int value threshold", ).SetRequired(true), toolkit.MustNewParameter( "max", "max int value threshold", ).SetRequired(true), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomStringTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomString", "Generate random string", ), NewRandomStringTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("text", "varchar"), ).SetRequired(true), toolkit.MustNewParameter( "min_length", "min length of string", ).SetRequired(true), toolkit.MustNewParameter( "max_length", "max length of string", ).SetRequired(true), toolkit.MustNewParameter( "symbols", "the characters range for random string", ).SetDefaultValue(toolkit.ParamsValue("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890")), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RandomUuidTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RandomUuid", "Generate random uuid", ), NewRandomUuidTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("text", "varchar", "uuid"), ).SetRequired(true), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var RegexpReplaceTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "RegexpReplace", "Replace string using regular expression", ), NewRegexpReplaceTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true). SetAllowedColumnTypes("varchar", "text", "bpchar"), ).SetRequired(true), toolkit.MustNewParameter( "regexp", "regular expression", ).SetRequired(true), toolkit.MustNewParameter( "replace", "replacement value", ).SetRequired(true), )
View Source
var ReplaceTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Replace", "Replace column value to the provided", ), NewReplaceTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true), ).SetRequired(true), toolkit.MustNewParameter( "value", "value to replace", ).SetRequired(true). SetLinkParameter("column"), toolkit.MustNewParameter( "keep_null", "do not replace NULL values to random value", ).SetDefaultValue(toolkit.ParamsValue("true")), )
View Source
var SetNullTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "SetNull", "Set NULL value", ), NewSetNullTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true), ).SetRequired(true), )
View Source
var TemplateRecordTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "TemplateRecord", "Modify the record using gotemplate", ), NewTemplateRecordTransformer, toolkit.MustNewParameter( "template", "gotemplate string", ).SetRequired(true), toolkit.MustNewParameter( "validate", "validate template result via PostgreSQL driver decoding", ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("false")), toolkit.MustNewParameter( "columns", "Columns that supposed to be affected by the template. The list of columns will be checked for constraint violation", ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("[]")), )
View Source
var TemplateTransformerDefinition = utils.NewDefinition( utils.NewTransformerProperties( "Template", "Modify the value using gotemplate", ), NewTemplateTransformer, toolkit.MustNewParameter( "column", "column name", ).SetIsColumn(toolkit.NewColumnProperties(). SetAffected(true), ).SetRequired(true), toolkit.MustNewParameter( "template", "gotemplate string", ).SetRequired(true), toolkit.MustNewParameter( "validate", "validate template result via PostgreSQL driver decoding", ).SetRequired(false). SetDefaultValue(toolkit.ParamsValue("false")), )
Functions ¶
func NewDictTransformer ¶
func NewHashTransformer ¶
func NewJsonTransformer ¶
func NewMaskingTransformer ¶
func NewNoiseDateTransformer ¶
func NewNoiseIntTransformer ¶
func NewRandomIntTransformer ¶
func NewReplaceTransformer ¶
func NewSetNullTransformer ¶
func NewTemplateTransformer ¶
Types ¶
type Cmd ¶
type Cmd struct { *utils.CmdTransformerBase Columns []*Column // contains filtered or unexported fields }
func (*Cmd) GetAffectedColumns ¶
type ColumnContext ¶
type ColumnContext struct {
// contains filtered or unexported fields
}
func NewColumnContext ¶
func NewColumnContext(columnType string, columnName string) *ColumnContext
func (*ColumnContext) DecodeValue ¶
func (cc *ColumnContext) DecodeValue(v any) (any, error)
func (*ColumnContext) DecodeValueByColumn ¶
func (cc *ColumnContext) DecodeValueByColumn(name string, v any) (any, error)
func (*ColumnContext) DecodeValueByType ¶
func (cc *ColumnContext) DecodeValueByType(name string, v any) (any, error)
func (*ColumnContext) EncodeValue ¶
func (cc *ColumnContext) EncodeValue(v any) (any, error)
func (*ColumnContext) EncodeValueByColumn ¶
func (cc *ColumnContext) EncodeValueByColumn(name string, v any) (any, error)
func (*ColumnContext) EncodeValueByType ¶
func (cc *ColumnContext) EncodeValueByType(name string, v any) (any, error)
func (*ColumnContext) GetColumnRawValue ¶
func (cc *ColumnContext) GetColumnRawValue(name string) (any, error)
func (*ColumnContext) GetColumnType ¶
func (cc *ColumnContext) GetColumnType() string
func (*ColumnContext) GetColumnValue ¶
func (cc *ColumnContext) GetColumnValue(name string) (any, error)
func (*ColumnContext) GetRawValue ¶
func (cc *ColumnContext) GetRawValue() (any, error)
func (*ColumnContext) GetValue ¶
func (cc *ColumnContext) GetValue() (any, error)
type DictTransformer ¶
type DictTransformer struct {
// contains filtered or unexported fields
}
func (*DictTransformer) GetAffectedColumns ¶
func (ht *DictTransformer) GetAffectedColumns() map[int]string
type HashTransformer ¶
type HashTransformer struct {
// contains filtered or unexported fields
}
func (*HashTransformer) GetAffectedColumns ¶
func (ht *HashTransformer) GetAffectedColumns() map[int]string
type JsonContext ¶
type JsonContext struct {
// contains filtered or unexported fields
}
func NewJsonContext ¶
func NewJsonContext() *JsonContext
func (*JsonContext) DecodeValueByColumn ¶
func (jc *JsonContext) DecodeValueByColumn(name string, v any) (any, error)
func (*JsonContext) DecodeValueByType ¶
func (jc *JsonContext) DecodeValueByType(name string, v any) (any, error)
func (*JsonContext) EncodeValueByColumn ¶
func (jc *JsonContext) EncodeValueByColumn(name string, v any) (any, error)
func (*JsonContext) EncodeValueByType ¶
func (jc *JsonContext) EncodeValueByType(name string, v any) (any, error)
func (*JsonContext) GetColumnRawValue ¶
func (jc *JsonContext) GetColumnRawValue(name string) (any, error)
func (*JsonContext) GetColumnValue ¶
func (jc *JsonContext) GetColumnValue(name string) (any, error)
func (*JsonContext) GetOriginalValue ¶
func (jc *JsonContext) GetOriginalValue() any
func (*JsonContext) GetPath ¶
func (jc *JsonContext) GetPath() string
func (*JsonContext) OriginalValueExists ¶
func (jc *JsonContext) OriginalValueExists() bool
type JsonTransformer ¶
type JsonTransformer struct {
// contains filtered or unexported fields
}
func (*JsonTransformer) GetAffectedColumns ¶
func (jt *JsonTransformer) GetAffectedColumns() map[int]string
type MaskingTransformer ¶
type MaskingTransformer struct {
// contains filtered or unexported fields
}
func (*MaskingTransformer) GetAffectedColumns ¶
func (mt *MaskingTransformer) GetAffectedColumns() map[int]string
type NoiseDateTransformer ¶
type NoiseDateTransformer struct {
// contains filtered or unexported fields
}
func (*NoiseDateTransformer) Done ¶
func (ndt *NoiseDateTransformer) Done(ctx context.Context) error
func (*NoiseDateTransformer) GetAffectedColumns ¶
func (ndt *NoiseDateTransformer) GetAffectedColumns() map[int]string
type NoiseFloatTransformer ¶
type NoiseFloatTransformer struct {
// contains filtered or unexported fields
}
func (*NoiseFloatTransformer) Done ¶
func (nft *NoiseFloatTransformer) Done(ctx context.Context) error
func (*NoiseFloatTransformer) GetAffectedColumns ¶
func (nft *NoiseFloatTransformer) GetAffectedColumns() map[int]string
type NoiseIntTransformer ¶
type NoiseIntTransformer struct {
// contains filtered or unexported fields
}
func (*NoiseIntTransformer) GetAffectedColumns ¶
func (nit *NoiseIntTransformer) GetAffectedColumns() map[int]string
type Operation ¶
type Operation struct { Operation string `mapstructure:"operation"` Value interface{} `mapstructure:"value,omitempty"` ValueTemplate string `mapstructure:"value_template,omitempty"` Path string `mapstructure:"path"` ErrorNotExist bool `mapstructure:"error_not_exist"` // contains filtered or unexported fields }
type RandomBoolTransformer ¶
type RandomBoolTransformer struct {
// contains filtered or unexported fields
}
func (*RandomBoolTransformer) Done ¶
func (rbt *RandomBoolTransformer) Done(ctx context.Context) error
func (*RandomBoolTransformer) GetAffectedColumns ¶
func (rbt *RandomBoolTransformer) GetAffectedColumns() map[int]string
type RandomChoiceTransformer ¶
type RandomChoiceTransformer struct {
// contains filtered or unexported fields
}
func (*RandomChoiceTransformer) Done ¶
func (ht *RandomChoiceTransformer) Done(ctx context.Context) error
func (*RandomChoiceTransformer) GetAffectedColumns ¶
func (ht *RandomChoiceTransformer) GetAffectedColumns() map[int]string
type RandomDateTransformer ¶
type RandomDateTransformer struct {
// contains filtered or unexported fields
}
func (*RandomDateTransformer) Done ¶
func (rdt *RandomDateTransformer) Done(ctx context.Context) error
func (*RandomDateTransformer) GetAffectedColumns ¶
func (rdt *RandomDateTransformer) GetAffectedColumns() map[int]string
type RandomDateTransformerParams ¶
type RandomDateTransformerParams struct { Min string `mapstructure:"min" validate:"required"` Max string `mapstructure:"max" validate:"required"` Truncate string `mapstructure:"truncate" validate:"omitempty,oneof=year month day hour second nano"` Nullable bool `mapstructure:"nullable"` Fraction float32 `mapstructure:"fraction"` }
type RandomFloatTransformer ¶
type RandomFloatTransformer struct {
// contains filtered or unexported fields
}
func (*RandomFloatTransformer) Done ¶
func (rft *RandomFloatTransformer) Done(ctx context.Context) error
func (*RandomFloatTransformer) GetAffectedColumns ¶
func (rft *RandomFloatTransformer) GetAffectedColumns() map[int]string
type RandomIntTransformer ¶
type RandomIntTransformer struct {
// contains filtered or unexported fields
}
func (*RandomIntTransformer) Done ¶
func (rit *RandomIntTransformer) Done(ctx context.Context) error
func (*RandomIntTransformer) GetAffectedColumns ¶
func (rit *RandomIntTransformer) GetAffectedColumns() map[int]string
type RandomStringTransformer ¶
type RandomStringTransformer struct {
// contains filtered or unexported fields
}
func (*RandomStringTransformer) Done ¶
func (rst *RandomStringTransformer) Done(ctx context.Context) error
func (*RandomStringTransformer) GetAffectedColumns ¶
func (rst *RandomStringTransformer) GetAffectedColumns() map[int]string
type RandomUuidTransformer ¶
type RandomUuidTransformer struct {
// contains filtered or unexported fields
}
func (*RandomUuidTransformer) Done ¶
func (rut *RandomUuidTransformer) Done(ctx context.Context) error
func (*RandomUuidTransformer) GetAffectedColumns ¶
func (rut *RandomUuidTransformer) GetAffectedColumns() map[int]string
type RegexpReplaceTransformer ¶
type RegexpReplaceTransformer struct {
// contains filtered or unexported fields
}
func (*RegexpReplaceTransformer) Done ¶
func (rrt *RegexpReplaceTransformer) Done(ctx context.Context) error
func (*RegexpReplaceTransformer) GetAffectedColumns ¶
func (rrt *RegexpReplaceTransformer) GetAffectedColumns() map[int]string
type ReplaceTransformer ¶
type ReplaceTransformer struct {
// contains filtered or unexported fields
}
func (*ReplaceTransformer) GetAffectedColumns ¶
func (rt *ReplaceTransformer) GetAffectedColumns() map[int]string
type SetNullTransformer ¶
type SetNullTransformer struct {
// contains filtered or unexported fields
}
func (*SetNullTransformer) GetAffectedColumns ¶
func (sut *SetNullTransformer) GetAffectedColumns() map[int]string
type TemplateRecordTransformer ¶
type TemplateRecordTransformer struct {
// contains filtered or unexported fields
}
func (*TemplateRecordTransformer) Done ¶
func (sut *TemplateRecordTransformer) Done(ctx context.Context) error
func (*TemplateRecordTransformer) GetAffectedColumns ¶
func (sut *TemplateRecordTransformer) GetAffectedColumns() map[int]string
type TemplateTransformer ¶
type TemplateTransformer struct {
// contains filtered or unexported fields
}
func (*TemplateTransformer) GetAffectedColumns ¶
func (sut *TemplateTransformer) GetAffectedColumns() map[int]string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.