custom

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

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.Parameter,
	ctd *TransformerDefinition,
) (*CmdTransformer, toolkit.ValidationWarnings, error)

func (*CmdTransformer) Done

func (ct *CmdTransformer) Done(ctx context.Context) error

func (*CmdTransformer) GetAffectedColumns

func (ct *CmdTransformer) GetAffectedColumns() map[int]string

func (*CmdTransformer) Init

func (ct *CmdTransformer) Init(ctx context.Context) (err error)

func (*CmdTransformer) Validate

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.Parameter  `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"`
}

func GetDynamicTransformerDefinition

func GetDynamicTransformerDefinition(ctx context.Context, executable string, args ...string) (*TransformerDefinition, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL