executors

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionFile

type ExecutionFile struct {
	Path            string
	Timeout         int
	Retry           int
	Platform        string
	WorkDirectory   string
	TransactionMode string // For SQL executor
}

ExecutionFile represents a file to be executed

type ExecutionResult

type ExecutionResult struct {
	Success  bool
	Output   string
	Error    error
	Duration int64 // in milliseconds
}

ExecutionResult represents the result of executing a file

type SQLConfig

type SQLConfig struct {
	Driver   string `mapstructure:"driver"`
	Host     string `mapstructure:"host"`
	Port     int    `mapstructure:"port"`
	Database string `mapstructure:"database"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	SSLMode  string `mapstructure:"sslmode"`
}

SQLConfig represents the configuration for SQL executor

type SQLExecutor

type SQLExecutor struct {
	// contains filtered or unexported fields
}

SQLExecutor implements the Executor interface for SQL scripts

func NewSQLExecutor

func NewSQLExecutor() *SQLExecutor

NewSQLExecutor creates a new SQL executor

func (*SQLExecutor) Clone

func (e *SQLExecutor) Clone() *SQLExecutor

Clone creates a new instance of SQLExecutor with the same configuration

func (*SQLExecutor) Close

func (e *SQLExecutor) Close() error

Close closes the database connection

func (*SQLExecutor) Execute

func (e *SQLExecutor) Execute(ctx context.Context, file ExecutionFile) (*ExecutionResult, error)

Execute executes the SQL file

func (*SQLExecutor) Name

func (e *SQLExecutor) Name() string

Name returns the name of this executor

func (*SQLExecutor) Validate

func (e *SQLExecutor) Validate(config map[string]interface{}) error

Validate validates the configuration

type SQLStepConfig

type SQLStepConfig struct {
	Transaction bool   `mapstructure:"transaction"`
	SkipIf      string `mapstructure:"skip_if"`
}

SQLStepConfig represents step-specific configuration

type ShellExecutor

type ShellExecutor struct {
	// contains filtered or unexported fields
}

ShellExecutor executes shell scripts

func NewShellExecutor

func NewShellExecutor() *ShellExecutor

NewShellExecutor creates a new shell executor

func (*ShellExecutor) Execute

func (e *ShellExecutor) Execute(ctx context.Context, file ExecutionFile) (*ExecutionResult, error)

Execute executes a shell script

func (*ShellExecutor) Name

func (e *ShellExecutor) Name() string

Name returns the executor name

func (*ShellExecutor) Validate

func (e *ShellExecutor) Validate(config map[string]interface{}) error

Validate validates the executor configuration

Jump to

Keyboard shortcuts

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