Documentation
ΒΆ
Overview ΒΆ
Package flow provides a high-performance, modular, and embeddable data pipeline orchestration and stream ETL library for Go. It allows developers to programmatically load, validate, and execute complex pipeline AST nodes (such as loops, parallel batches, and dynamic SQL/Go scripts) from XML configuration files.
Index ΒΆ
- func BuildClientAndRequest(elem HTTPClientElement) (*http.Client, *http.Request, error)
- func DecodeTextBytes(data []byte) string
- func GetSchemaXSD() []byte
- func NormalizeXMLBytes(data []byte) []byte
- func StreamETL(ctx context.Context, r *Registry, ...) (int64, error)
- func ValidateAST(preflightNodes []PipelineNode, flowNodes []PipelineNode, ...) error
- func ValidateXSD(xmlPath string, xsdPath string) error
- type AssertElement
- type AttemptResult
- type DBHandle
- type DatabaseConfig
- type ETLOptions
- type ErrorClass
- type EventSink
- type EventType
- type ExcelReadElement
- type ExcelWriteElement
- type ExecutionEvent
- type Executor
- func (e *Executor) AddEventSink(sink EventSink)
- func (e *Executor) Execute(ctx context.Context, nodes []PipelineNode) ([]ScriptResult, error)
- func (e *Executor) ExecuteRun(ctx context.Context, nodes []PipelineNode) (RunResult, error)
- func (e *Executor) SetEventSink(sink EventSink)
- func (e *Executor) SetEventSinks(sinks ...EventSink)
- func (e *Executor) SetGoPath(goPath string)
- func (e *Executor) SetInterpHook(hook func(*interp.Options))
- func (e *Executor) SetInterpreterHook(hook func(*interp.Options))
- func (e *Executor) SetOptionsPath(path string)
- func (e *Executor) SetVerbose(verbose bool)
- type FileReadElement
- type FileSaveElement
- type HTTPClientElement
- type HtmlTemplateElement
- type JSONLineSink
- type JsonPathElement
- type KVBulkElement
- type KVElement
- type NodeKind
- type NodeResult
- type PipelineConfig
- type PipelineNode
- type Registry
- func (r *Registry) CloseDatabases()
- func (r *Registry) CopyVariables() map[string]interface{}
- func (r *Registry) GetBadgerDB(name string) (*badger.DB, error)
- func (r *Registry) GetBoltDB(name string) (*goBolt.DB, error)
- func (r *Registry) GetDB(name string) (*sql.DB, error)
- func (r *Registry) GetDBHandle(name string) (DBHandle, error)
- func (r *Registry) GetEtcdDB(name string) (*clientv3.Client, error)
- func (r *Registry) GetRedisDB(name string) (*redis.Client, error)
- func (r *Registry) GetVar(name string) interface{}
- func (r *Registry) GetVarBool(name string) bool
- func (r *Registry) GetVarFloat(name string) float64
- func (r *Registry) GetVarInt(name string) int
- func (r *Registry) GetVarString(name string) string
- func (r *Registry) GetVarTime(name string) time.Time
- func (r *Registry) InitDatabases(configs []DatabaseConfig) error
- func (r *Registry) InitDatabasesWithContext(ctx context.Context, configs []DatabaseConfig) error
- func (r *Registry) InitVariables(configs []VariableConfig) error
- func (r *Registry) MergeVariables(src map[string]interface{})
- func (r *Registry) SetVar(name string, value interface{})
- func (r *Registry) Snapshot() *Registry
- type RowCounts
- type RunResult
- type RunStatus
- type SQLBulkElement
- type SQLElement
- type ScriptItem
- type ScriptResult
- type TemplateElement
- type VariableConfig
- type XmlXPathElement
- type YamlPathElement
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func BuildClientAndRequest ΒΆ added in v1.2.11
BuildClientAndRequest constructs fully configured http.Client and http.Request instances.
func DecodeTextBytes ΒΆ added in v1.2.33
DecodeTextBytes decodes raw file bytes into a clean UTF-8 string, handling UTF-16 LE/BE (with or without BOM) and UTF-8 BOM.
func GetSchemaXSD ΒΆ added in v1.1.0
func GetSchemaXSD() []byte
GetSchemaXSD returns the embedded XSD schema content as a byte slice.
func NormalizeXMLBytes ΒΆ added in v1.2.33
NormalizeXMLBytes inspects the byte slice for UTF-8/UTF-16 BOMs or UTF-16 byte patterns, transcodes the XML payload to valid UTF-8, and updates any UTF-16 XML declaration to UTF-8.
func StreamETL ΒΆ
func StreamETL(ctx context.Context, r *Registry, srcDBName, queryStr, dstDBName, targetTable string, opts ETLOptions) (int64, error)
StreamETL streams query results line-by-line from a source database into a target database table.
func ValidateAST ΒΆ
func ValidateAST(preflightNodes []PipelineNode, flowNodes []PipelineNode, registeredDBs []DatabaseConfig) error
ValidateAST verifies script IDs, database names, and structural rules across preflight and flow ASTs.
func ValidateXSD ΒΆ
ValidateXSD invokes 'xmllint' to validate the XML file against the given XSD schema.
Types ΒΆ
type AssertElement ΒΆ added in v1.2.15
type AssertElement struct {
ID string `xml:"id,attr"`
Var string `xml:"var,attr"`
Equals string `xml:"equals,attr"`
Value string `xml:"value,attr"`
Operator string `xml:"operator,attr"`
Message string `xml:"message,attr"`
OnFailure string `xml:"on_failure,attr"` // "halt", "warn", "continue", "set_var"
FailVar string `xml:"fail_var,attr"`
FailVal string `xml:"fail_val,attr"`
Description string `xml:"description,attr"`
FailureNodes []PipelineNode // Nodes inside <on_failure> block
}
type AttemptResult ΒΆ added in v1.2.21
type AttemptResult struct {
Attempt int `json:"attempt"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
Status RunStatus `json:"status"`
ErrorClass ErrorClass `json:"error_class,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
RowCounts RowCounts `json:"row_counts,omitempty"`
}
type DBHandle ΒΆ
type DBHandle struct {
Conn *sql.DB // Connection pool handle
Driver string // Database driver name (e.g. "sqlite", "mysql")
}
DBHandle encapsulates an active sql.DB connection pool along with its driver name.
type DatabaseConfig ΒΆ
type DatabaseConfig struct {
Name string // Unique identifier for the database
Driver string // Database driver name (e.g. postgres, mysql, sqlite)
ConnectionString string // Driver-specific connection string
MaxOpenConns int // Maximum concurrent open connections in the pool
MaxIdleConns int // Maximum idle connections to retain in the pool
ConnMaxLifetime time.Duration // Maximum lifetime of a connection before it is recycled
Workload string // Optional workload profile for tuning defaults (e.g. oltp, bulk, analytics)
}
DatabaseConfig represents a database connection setup defined in the XML.
type ETLOptions ΒΆ added in v1.2.0
type ETLOptions struct {
BatchSize int // Number of rows per batch flush
Tablock bool // Acquire table lock for minimal logging on SQL Server
CheckConstraints bool // Enforce target constraints during MSSQL bulk insert
FireTriggers bool // Execute target table triggers during MSSQL bulk insert
KeepNulls bool // Preserve explicit NULL values during MSSQL bulk insert
}
ETLOptions encapsulates batching and engine-specific performance tuning flags.
type ErrorClass ΒΆ added in v1.2.21
type ErrorClass string
const ( ErrorClassCanceled ErrorClass = "canceled" ErrorClassConfiguration ErrorClass = "configuration" ErrorClassValidation ErrorClass = "validation" ErrorClassDatabase ErrorClass = "database" ErrorClassHTTP ErrorClass = "http" ErrorClassFileSystem ErrorClass = "filesystem" ErrorClassScript ErrorClass = "script" ErrorClassTemplate ErrorClass = "template" ErrorClassDataFormat ErrorClass = "data_format" ErrorClassInternal ErrorClass = "internal" ErrorClassUnknown ErrorClass = "unknown" )
func ClassifyError ΒΆ added in v1.2.21
func ClassifyError(err error) ErrorClass
type EventSink ΒΆ added in v1.2.21
type EventSink interface {
Emit(context.Context, ExecutionEvent) error
}
type ExcelReadElement ΒΆ added in v1.2.13
type ExcelReadElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Sheet string `xml:"sheet,attr"`
Header *bool `xml:"header,attr"`
Var string `xml:"var,attr"`
OutputVar string `xml:"output_var,attr"`
}
func (*ExcelReadElement) GetOutputVar ΒΆ added in v1.2.13
func (e *ExcelReadElement) GetOutputVar() string
type ExcelWriteElement ΒΆ added in v1.2.13
type ExecutionEvent ΒΆ added in v1.2.21
type ExecutionEvent struct {
Sequence uint64 `json:"sequence"`
Type EventType `json:"type"`
OccurredAt time.Time `json:"occurred_at"`
RunID string `json:"run_id"`
ExecutionID string `json:"execution_id,omitempty"`
ParentExecutionID string `json:"parent_execution_id,omitempty"`
NodeID string `json:"node_id,omitempty"`
NodeKind string `json:"node_kind,omitempty"`
NodePath string `json:"node_path,omitempty"`
Attempt int `json:"attempt,omitempty"`
Status RunStatus `json:"status,omitempty"`
UserName string `json:"user_name,omitempty"`
Hostname string `json:"hostname,omitempty"`
OptionsPath string `json:"options_path,omitempty"`
RowCounts RowCounts `json:"row_counts,omitempty"`
ErrorClass ErrorClass `json:"error_class,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type Executor ΒΆ
type Executor struct {
// contains filtered or unexported fields
}
Executor orchestrates recursive pipeline AST node executions.
func NewExecutor ΒΆ
NewExecutor creates and returns a new Executor configured with the provided Registry.
func (*Executor) AddEventSink ΒΆ added in v1.2.31
func (*Executor) Execute ΒΆ
func (e *Executor) Execute(ctx context.Context, nodes []PipelineNode) ([]ScriptResult, error)
Execute triggers sequential or parallel tree evaluation for a slice of PipelineNodes.
func (*Executor) ExecuteRun ΒΆ added in v1.2.21
ExecuteRun executes nodes and returns structured run and node lifecycle results.
func (*Executor) SetEventSink ΒΆ added in v1.2.21
func (*Executor) SetEventSinks ΒΆ added in v1.2.21
func (*Executor) SetInterpHook ΒΆ added in v1.2.4
func (*Executor) SetInterpreterHook ΒΆ added in v1.2.31
func (*Executor) SetOptionsPath ΒΆ added in v1.3.2
func (*Executor) SetVerbose ΒΆ added in v1.1.0
type FileReadElement ΒΆ added in v1.2.13
type FileReadElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Path string `xml:"path,attr"`
Filename string `xml:"filename,attr"`
Var string `xml:"var,attr"`
Variable string `xml:"variable,attr"`
OutputVar string `xml:"output_var,attr"`
OutputVariable string `xml:"output_variable,attr"`
OutVar string `xml:"out_var,attr"`
}
func (*FileReadElement) GetFilePath ΒΆ added in v1.2.13
func (f *FileReadElement) GetFilePath() string
func (*FileReadElement) GetOutputVar ΒΆ added in v1.2.13
func (f *FileReadElement) GetOutputVar() string
type FileSaveElement ΒΆ added in v1.2.13
type FileSaveElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Path string `xml:"path,attr"`
Filename string `xml:"filename,attr"`
Var string `xml:"var,attr"`
Variable string `xml:"variable,attr"`
Append *bool `xml:"append,attr"`
Content string `xml:",chardata"`
}
func (*FileSaveElement) GetFilePath ΒΆ added in v1.2.13
func (f *FileSaveElement) GetFilePath() string
func (*FileSaveElement) GetInputVar ΒΆ added in v1.2.13
func (f *FileSaveElement) GetInputVar() string
type HTTPClientElement ΒΆ added in v1.2.11
type HTTPClientElement struct {
XMLName xml.Name `xml:"-"`
// Core Request Attributes
ID string `xml:"id,attr"`
URI string `xml:"uri,attr"`
URL string `xml:"url,attr"`
Method string `xml:"method,attr"`
Data string `xml:"data,attr"`
BodyContent string `xml:",chardata"`
Headers string `xml:"headers,attr"`
ContentType string `xml:"content_type,attr"`
// Variable Output Assignments
Var string `xml:"var,attr"`
Variable string `xml:"variable,attr"`
OutputVar string `xml:"output_var,attr"`
OutputVariable string `xml:"output_variable,attr"`
OutVar string `xml:"out_var,attr"`
StatusCodeVar string `xml:"status_code_var,attr"`
StatusCodeVariable string `xml:"status_code_variable,attr"`
StatusVar string `xml:"status_var,attr"`
StatusVariable string `xml:"status_variable,attr"`
// http.Client Attributes
Timeout string `xml:"timeout,attr"`
MaxRedirects *int `xml:"max_redirects,attr"`
FollowRedirects *bool `xml:"follow_redirects,attr"`
CookieJar *bool `xml:"cookie_jar,attr"`
// http.Transport Attributes
Proxy string `xml:"proxy,attr"`
TLSInsecureSkipVerify *bool `xml:"tls_insecure_skip_verify,attr"`
TLSHandshakeTimeout string `xml:"tls_handshake_timeout,attr"`
TLSServerName string `xml:"tls_server_name,attr"`
TLSMinVersion string `xml:"tls_min_version,attr"`
TLSMaxVersion string `xml:"tls_max_version,attr"`
DisableKeepAlives *bool `xml:"disable_keep_alives,attr"`
DisableCompression *bool `xml:"disable_compression,attr"`
MaxIdleConns *int `xml:"max_idle_conns,attr"`
MaxIdleConnsPerHost *int `xml:"max_idle_conns_per_host,attr"`
MaxConnsPerHost *int `xml:"max_conns_per_host,attr"`
IdleConnTimeout string `xml:"idle_conn_timeout,attr"`
ResponseHeaderTimeout string `xml:"response_header_timeout,attr"`
ExpectContinueTimeout string `xml:"expect_continue_timeout,attr"`
MaxResponseHeaderBytes *int64 `xml:"max_response_header_bytes,attr"`
WriteBufferSize *int `xml:"write_buffer_size,attr"`
ReadBufferSize *int `xml:"read_buffer_size,attr"`
ForceAttemptHTTP2 *bool `xml:"force_attempt_http2,attr"`
}
HTTPClientElement maps all attributes from the HttpClientType XML schema.
func (*HTTPClientElement) GetOutputVariable ΒΆ added in v1.2.11
func (e *HTTPClientElement) GetOutputVariable() string
Helper methods to identify target output variables
func (*HTTPClientElement) GetStatusCodeVariable ΒΆ added in v1.2.11
func (e *HTTPClientElement) GetStatusCodeVariable() string
type HtmlTemplateElement ΒΆ added in v1.2.21
type HtmlTemplateElement struct {
ID string `xml:"id,attr"`
Name string `xml:"name,attr"`
File string `xml:"file,attr"`
Engine string `xml:"engine,attr"`
OutputVar string `xml:"output_var,attr"`
Var string `xml:"var,attr"`
Mode string `xml:"mode,attr"` // "text", "summary"
Content string `xml:",chardata"`
}
func (*HtmlTemplateElement) GetOutputVar ΒΆ added in v1.2.21
func (t *HtmlTemplateElement) GetOutputVar() string
type JSONLineSink ΒΆ added in v1.2.21
func (*JSONLineSink) Emit ΒΆ added in v1.2.21
func (s *JSONLineSink) Emit(_ context.Context, event ExecutionEvent) error
type JsonPathElement ΒΆ added in v1.2.13
type JsonPathElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Var string `xml:"var,attr"`
Path string `xml:"path,attr"`
JSONPath string `xml:"jsonpath,attr"`
Content string `xml:",chardata"` // Captures inner element body text
Mode string `xml:"mode,attr"` // "value", "json", "json_array"
OutputVar string `xml:"output_var,attr"`
OutVar string `xml:"out_var,attr"`
}
func (*JsonPathElement) GetJSONPath ΒΆ added in v1.2.13
func (j *JsonPathElement) GetJSONPath() string
func (*JsonPathElement) GetOutputVar ΒΆ added in v1.2.13
func (j *JsonPathElement) GetOutputVar() string
type KVBulkElement ΒΆ added in v1.2.29
type KVBulkElement struct {
ID string `xml:"id,attr"`
DBName string `xml:"db,attr"` // Source DB
TargetDB string `xml:"target_db,attr"` // Target DB
Bucket string `xml:"bucket,attr"` // Source bucket
TargetBucket string `xml:"target_bucket,attr"`
TargetTable string `xml:"target_table,attr"` // For KV to SQL bulk export
BatchSize int `xml:"batch_size,attr"`
VarName string `xml:"var,attr"`
OutputVar string `xml:"output_var,attr"`
Code string `xml:",chardata"`
}
func (*KVBulkElement) GetOutputVar ΒΆ added in v1.2.29
func (kb *KVBulkElement) GetOutputVar() string
type KVElement ΒΆ added in v1.2.29
type KVElement struct {
ID string `xml:"id,attr"`
DBName string `xml:"db,attr"`
Bucket string `xml:"bucket,attr"`
Op string `xml:"op,attr"` // "get", "put", "delete", "scan"
Key string `xml:"key,attr"`
Value string `xml:"value,attr"`
VarName string `xml:"var,attr"`
OutputVar string `xml:"output_var,attr"`
Code string `xml:",chardata"`
}
func (*KVElement) GetOutputVar ΒΆ added in v1.2.29
type NodeKind ΒΆ
type NodeKind int
NodeKind represents the structural type of a PipelineNode.
const ( // NodeScript represents a leaf script execution step. NodeScript NodeKind = iota // NodeGroup represents a simple sequence container of nodes. NodeGroup // NodeIf represents a conditional branching sequence. NodeIf // NodeForEach represents an iterative driver loop. NodeForEach // NodeParallel represents a concurrent block container. NodeParallel // NodeWhile represents a condition-controlled iteration loop. NodeWhile // NodeHTTPClient represents an HTTP client execution step. NodeHTTPClient // Added NodeHTTPClient enum // NodeTemplate represents a template inclusion step. NodeTemplate // New enum item NodeHtmlTemplate // New enum item for HTML template inclusion step // NodeFileSave represents a file save operation step. NodeFileSave // New enum item for file save operation // NodeFileRead represents a file read operation step. NodeFileRead // New enum item for file read operation NodeExcelRead // New enum item for Excel read operation NodeExcelWrite // New enum item for Excel write operation NodeXMLXPath // New enum item for XML XPath extraction NodeJSONPath // New enum item for JSON path extraction NodeYAMLPath // New enum item for YAML path extraction NodeSQL // New enum item for standard SQL execution NodeSQLBulk // New enum item for bulk SQL execution NodeAssert // New enum item for assert operation NodeKV // New enum item for key-value store operations NodeKVBulk // New enum item for bulk key-value store operations )
type NodeResult ΒΆ added in v1.2.21
type NodeResult struct {
ExecutionID string `json:"execution_id"`
ParentExecutionID string `json:"parent_execution_id,omitempty"`
NodeID string `json:"node_id,omitempty"`
NodeKind string `json:"node_kind"`
NodePath string `json:"node_path"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
Status RunStatus `json:"status"`
Attempts []AttemptResult `json:"attempts"`
RowCounts RowCounts `json:"row_counts,omitempty"`
ErrorClass ErrorClass `json:"error_class,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type PipelineConfig ΒΆ added in v1.2.16
type PipelineConfig struct {
Variables []VariableConfig
Databases []DatabaseConfig
PreflightNodes []PipelineNode
FlowNodes []PipelineNode
}
PipelineConfig encapsulates the complete parsed AST structure.
func ParseXMLConfig ΒΆ
func ParseXMLConfig(xmlData []byte) (PipelineConfig, error)
ParseXMLConfig parses XML pipeline config definitions into separate Preflight and Flow ASTs.
type PipelineNode ΒΆ
type PipelineNode struct {
Kind NodeKind // Struct/flow type of the node
MaxThreads int // Concurrency limit (only used for NodeParallel)
MaxIterations int // Infinite loop safety limit (only used for NodeWhile)
Script *ScriptItem // Leaf script item payload (only used for NodeScript)
HTTPClient *HTTPClientElement // Added HTTP payload
GroupID string // Structural/group name or ID
IfVar string // Condition driver variable name
IfEquals string // Expected variable value to match
ForEachScript *ScriptItem // Iterator driver script config (only used for NodeForEach)
Children []PipelineNode // List of sequential child execution steps
ElseNodes []PipelineNode // Else branching steps (only used for NodeIf)
Transaction bool // Start transaction for this group
DBName string // Database name for the transaction
Timeout string // Optional transaction/node timeout
Buffer bool // Opt-in in-memory buffering for NodeForEach
Template *TemplateElement // New payload field for template inclusion step
FileSave *FileSaveElement // New payload field for file save operation
FileRead *FileReadElement // New payload field for file read operation
ExcelRead *ExcelReadElement // New payload field for Excel read operation
ExcelWrite *ExcelWriteElement // New payload field for Excel write operation
XmlXPath *XmlXPathElement // New payload field for XML XPath extraction
JsonPath *JsonPathElement // New payload field for JSON path extraction
HtmlTemplate *HtmlTemplateElement // New payload field for HTML template inclusion step
YamlPath *YamlPathElement // New payload field for YAML path extraction
Assert *AssertElement // New enum item for assert operation
SQL *SQLElement // New payload field for standard SQL execution
SQLBulk *SQLBulkElement // New payload field for bulk SQL execution
KV *KVElement // New payload field for key-value store operations
KVBulk *KVBulkElement // New payload field for bulk key-value store operations
}
PipelineNode is an AST node in the pipeline execution tree.
type Registry ΒΆ
type Registry struct {
// contains filtered or unexported fields
}
Registry is a thread-safe container that manages active database connection pools and dynamic pipeline environment variables.
func NewRegistry ΒΆ
func NewRegistry() *Registry
NewRegistry instantiates and returns an empty Registry context.
func (*Registry) CloseDatabases ΒΆ
func (r *Registry) CloseDatabases()
CloseDatabases closes all open database connections tracked inside the registry and removes them.
func (*Registry) CopyVariables ΒΆ
CopyVariables creates and returns a thread-safe snapshot map of all current environment variables.
func (*Registry) GetBadgerDB ΒΆ added in v1.2.29
func (*Registry) GetDB ΒΆ
GetDB returns the direct sql.DB pointer for the requested database name, if registered.
func (*Registry) GetDBHandle ΒΆ
GetDBHandle returns the DBHandle wrapper (containing sql.DB and Driver name) for the database.
func (*Registry) GetRedisDB ΒΆ added in v1.2.29
func (*Registry) GetVar ΒΆ
GetVar retrieves an environment variable's raw interface value in a thread-safe manner.
func (*Registry) GetVarBool ΒΆ
func (*Registry) GetVarFloat ΒΆ
func (*Registry) GetVarInt ΒΆ
GetVarInt retrieves a variable and returns its value as an integer (parsing strings if necessary).
func (*Registry) GetVarString ΒΆ
GetVarString retrieves a variable and returns its value formatted as a string.
func (*Registry) GetVarTime ΒΆ added in v1.2.8
GetVarTime retrieves a variable and returns its value as time.Time (parsing string dates if necessary).
func (*Registry) InitDatabases ΒΆ
func (r *Registry) InitDatabases(configs []DatabaseConfig) error
InitDatabases opens connection pools for all supplied DatabaseConfigs with variable interpolation in connection strings.
func (*Registry) InitDatabasesWithContext ΒΆ added in v1.2.31
func (r *Registry) InitDatabasesWithContext(ctx context.Context, configs []DatabaseConfig) error
InitDatabasesWithContext opens connection pools using the supplied context for cancellation and timeouts. On partial failure, any databases opened during the invocation are automatically rolled back/closed.
func (*Registry) InitVariables ΒΆ
func (r *Registry) InitVariables(configs []VariableConfig) error
InitVariables registers and parses multiple environment variables based on type configuration.
func (*Registry) MergeVariables ΒΆ added in v1.2.8
MergeVariables copies variable key-value pairs into the parent registry.
type RunResult ΒΆ added in v1.2.21
type RunResult struct {
RunID string `json:"run_id"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
Status RunStatus `json:"status"`
UserName string `json:"user_name,omitempty"`
Hostname string `json:"hostname,omitempty"`
OptionsPath string `json:"options_path,omitempty"`
ErrorClass ErrorClass `json:"error_class,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
RowCounts RowCounts `json:"row_counts,omitempty"`
Nodes []NodeResult `json:"nodes"`
}
type SQLBulkElement ΒΆ added in v1.2.26
type SQLBulkElement struct {
ID string // Unique identifier of the script
DBName string // Target database identifier for SQL queries
TargetDB string // Destination database identifier for streaming ETL
TargetTable string // Destination table name for streaming ETL
BatchSize int // Maximum rows loaded per batch
VarName string // Input environment variable to pull script code from dynamically
OutputVar string // Environment variable to store the command's outputs or logs into
Code string // Inner script text/payload
Tablock bool // Acquire table lock for minimal logging on SQL Server
CheckConstraints bool // Evaluate constraints during MSSQL bulk insert
FireTriggers bool // Execute target table triggers during MSSQL bulk insert
KeepNulls bool // Preserve explicit NULL values during MSSQL bulk insert
Timeout string // Optional execution timeout duration (e.g. 10m, 1h)
}
type SQLElement ΒΆ added in v1.2.26
type SQLElement struct {
ID string // Unique identifier of the script
DBName string // Target database identifier for SQL queries
VarName string // Input environment variable to pull script code from dynamically
OutputVar string // Environment variable to store the command's outputs or logs into
Code string // Inner script text/payload
Timeout string // Optional execution timeout duration (e.g. 30s, 45m)
}
type ScriptItem ΒΆ
type ScriptItem struct {
ID string // Unique identifier of the script
Language string // Language identifier (e.g. go, lua, shell, pwsh)
DBName string // Target database identifier for SQL queries
TargetDB string // Destination database identifier for streaming ETL
TargetTable string // Destination table name for streaming ETL
BatchSize int // Maximum rows loaded per batch
FilePath string // Path to an external script file to load and execute
VarName string // Input environment variable to pull script code from dynamically
OutputVar string // Environment variable to store the command's outputs or logs into
Code string // Inner script text/payload
Tablock bool // Acquire table lock for minimal logging on SQL Server
CheckConstraints bool // Evaluate constraints during MSSQL bulk insert
FireTriggers bool // Execute target table triggers during MSSQL bulk insert
KeepNulls bool // Preserve explicit NULL values during MSSQL bulk insert
}
ScriptItem represents an executable script payload (such as Go, Lua, Shell, or .NET script) with metadata.
type ScriptResult ΒΆ
type ScriptResult struct {
ScriptID string `json:"script_id"` // Unique script identifier
ReturnCode any `json:"return_code"` // 0 on success, or error details on failure
ResultsString string `json:"results_string"` // Output logs, driver queries, or execution results
Duration string `json:"duration,omitempty"` // Cumulative execution time
}
ScriptResult represents the complete outcome of a single executed script or loop block.
type TemplateElement ΒΆ added in v1.2.13
type TemplateElement struct {
ID string `xml:"id,attr"`
Name string `xml:"name,attr"`
File string `xml:"file,attr"`
Engine string `xml:"engine,attr"`
OutputVar string `xml:"output_var,attr"`
Var string `xml:"var,attr"`
Mode string `xml:"mode,attr"` // "text", "summary"
Content string `xml:",chardata"`
}
func (*TemplateElement) GetOutputVar ΒΆ added in v1.2.13
func (t *TemplateElement) GetOutputVar() string
type VariableConfig ΒΆ
type VariableConfig struct {
Name string // Name of the variable
Type string // Type of the variable (e.g. string, int, bool, float)
Value string // Value of the variable as a raw string
}
VariableConfig represents an individual environment variable loaded from XML.
type XmlXPathElement ΒΆ added in v1.2.13
type XmlXPathElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Var string `xml:"var,attr"`
XPath string `xml:"xpath,attr"`
Content string `xml:",chardata"` // Captures inner element body text
Mode string `xml:"mode,attr"` // "text", "xml", "json_array"
OutputVar string `xml:"output_var,attr"`
OutVar string `xml:"out_var,attr"`
}
func (*XmlXPathElement) GetOutputVar ΒΆ added in v1.2.33
func (x *XmlXPathElement) GetOutputVar() string
func (*XmlXPathElement) GetXPath ΒΆ added in v1.2.13
func (x *XmlXPathElement) GetXPath() string
type YamlPathElement ΒΆ added in v1.2.13
type YamlPathElement struct {
ID string `xml:"id,attr"`
File string `xml:"file,attr"`
Var string `xml:"var,attr"`
Path string `xml:"path,attr"`
YAMLPath string `xml:"yamlpath,attr"`
Content string `xml:",chardata"` // Captures inner element body text
Mode string `xml:"mode,attr"` // "value", "json", "json_array", "yaml"
OutputVar string `xml:"output_var,attr"`
OutVar string `xml:"out_var,attr"`
}
func (*YamlPathElement) GetOutputVar ΒΆ added in v1.2.13
func (y *YamlPathElement) GetOutputVar() string
func (*YamlPathElement) GetYAMLPath ΒΆ added in v1.2.13
func (y *YamlPathElement) GetYAMLPath() string