Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultValidationTimeout = 20 * time.Second DefaultRowTransformationTimeout = 2 * time.Second DefaultAutoDiscoveryTimeout = 10 * time.Second )
View Source
const ( ValidateArgName = "--validate" PrintDefinitionArgName = "--print-definition" TransformArgName = "--transform" )
View Source
const ( JsonModeName = "json" CsvModeName = "csv" TextModeName = "text" )
Variables ¶
View Source
var (
ErrValidationTimeout = errors.New("validation timeout")
)
Functions ¶
func BootstrapCustomTransformers ¶
func BootstrapCustomTransformers(ctx context.Context, registry *utils.TransformerRegistry, customTransformers []*TransformerDefinition) (err error)
func ProduceNewCmdTransformerFunction ¶
func ProduceNewCmdTransformerFunction(ctd *TransformerDefinition) utils.NewTransformerFunc
Types ¶
type CmdTransformer ¶
type CmdTransformer struct { *utils.CmdTransformerBase // contains filtered or unexported fields }
func NewCustomCmdTransformer ¶
func NewCustomCmdTransformer( ctx context.Context, driver *toolkit.Driver, parameters map[string]toolkit.Parameterizer, ctd *TransformerDefinition, ) (*CmdTransformer, toolkit.ValidationWarnings, error)
func (*CmdTransformer) GetAffectedColumns ¶
func (ct *CmdTransformer) GetAffectedColumns() map[int]string
func (*CmdTransformer) Validate ¶
func (ct *CmdTransformer) Validate(ctx context.Context) (toolkit.ValidationWarnings, error)
type TransformerDefinition ¶
type TransformerDefinition struct { Name string `mapstructure:"name" yaml:"name" json:"name"` Description string `mapstructure:"description" yaml:"description" json:"description"` Executable string `mapstructure:"executable" yaml:"executable" json:"executable"` Args []string `mapstructure:"args" yaml:"args" json:"args"` Parameters []*toolkit.ParameterDefinition `mapstructure:"parameters" yaml:"parameters" json:"parameters"` Validate bool `mapstructure:"validate" yaml:"validate" json:"validate"` AutoDiscover bool `mapstructure:"auto_discover" yaml:"auto_discover" json:"auto_discover"` ValidationTimeout time.Duration `mapstructure:"validation_timeout" yaml:"validation_timeout" json:"validation_timeout"` AutoDiscoveryTimeout time.Duration `mapstructure:"auto_discovery_timeout" yaml:"auto_discovery_timeout" json:"auto_discovery_timeout"` RowTransformationTimeout time.Duration `mapstructure:"row_transformation_timeout" yaml:"row_transformation_timeout" json:"row_transformation_timeout"` ExpectedExitCode int `mapstructure:"expected_exit_code" yaml:"expected_exit_code" json:"expected_exit_code"` Driver *toolkit.DriverParams `mapstructure:"driver" yaml:"driver" json:"driver"` }
Click to show internal directories.
Click to hide internal directories.