executor

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 30 * time.Minute

DefaultTimeout is the default timeout for container execution (30 minutes)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthError added in v1.3.0

type AuthError struct {
	Registry string
	Image    string
	Err      error
}

AuthError represents an authentication failure when pulling images

func (*AuthError) Error added in v1.3.0

func (e *AuthError) Error() string

func (*AuthError) Unwrap added in v1.3.0

func (e *AuthError) Unwrap() error

type BackendType added in v1.3.0

type BackendType string

BackendType represents the executor backend type

const (
	BackendAuto       BackendType = "auto"
	BackendDocker     BackendType = "docker"
	BackendPodman     BackendType = "podman"
	BackendKubernetes BackendType = "kubernetes"
)

func ParseBackendType added in v1.3.0

func ParseBackendType(s string) BackendType

ParseBackendType converts a string to BackendType

func (BackendType) String added in v1.3.0

func (b BackendType) String() string

String returns the string representation of BackendType

type DockerExecutor

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

DockerExecutor executes tools using Docker

func NewDockerExecutor

func NewDockerExecutor(dryRun, verbose, quiet bool) (*DockerExecutor, error)

NewDockerExecutor creates a new Docker executor

func (*DockerExecutor) Available added in v1.3.0

func (e *DockerExecutor) Available() bool

Available checks if Docker daemon is running and accessible

func (*DockerExecutor) Close

func (e *DockerExecutor) Close() error

Close closes the Docker client

func (*DockerExecutor) Name added in v1.3.0

func (e *DockerExecutor) Name() string

Name returns the executor backend name

func (*DockerExecutor) Run

func (e *DockerExecutor) Run(ctx context.Context, containerConfig *config.ContainerConfig) error

Run executes a tool configuration

func (*DockerExecutor) SetTimeout added in v1.3.0

func (e *DockerExecutor) SetTimeout(d time.Duration)

SetTimeout sets the execution timeout for containers

type ExecutionContext added in v1.3.0

type ExecutionContext struct {
	DryRun    bool   // If true, show what would be executed without running
	Verbose   bool   // If true, show detailed output
	Workspace string // Project workspace path
}

ExecutionContext provides runtime context for executors

type Executor added in v1.3.0

type Executor interface {
	// Run executes a tool with the given configuration
	Run(ctx context.Context, config *config.ContainerConfig) error

	// Available checks if this executor backend is available
	// For Docker: checks if daemon is running
	// For Podman: checks if podman machine is running
	Available() bool

	// Name returns the executor backend name (docker, podman, kubernetes)
	Name() string

	// Close releases any resources held by the executor
	Close() error
}

Executor defines the interface for executing tools in containers Implementations include DockerExecutor, PodmanExecutor, KubernetesExecutor

type PodmanExecutor added in v1.3.0

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

PodmanExecutor wraps DockerExecutor connected to Podman's Docker-compatible socket. Podman exposes a Docker-compatible API, so we reuse the Docker SDK.

func NewPodmanExecutor added in v1.4.0

func NewPodmanExecutor(dryRun, verbose, quiet bool) (*PodmanExecutor, error)

NewPodmanExecutor creates a Podman executor via Docker-compatible socket.

func (*PodmanExecutor) Available added in v1.3.0

func (e *PodmanExecutor) Available() bool

func (*PodmanExecutor) Close added in v1.3.0

func (e *PodmanExecutor) Close() error

func (*PodmanExecutor) Name added in v1.3.0

func (e *PodmanExecutor) Name() string

func (*PodmanExecutor) Run added in v1.3.0

type Selector added in v1.3.0

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

Selector manages executor selection based on availability and user preference

func NewSelector added in v1.3.0

func NewSelector(dryRun, verbose, quiet bool) (*Selector, error)

NewSelector creates a new executor selector

func (*Selector) Close added in v1.3.0

func (s *Selector) Close() error

Close releases resources held by all executors

func (*Selector) DockerAvailable added in v1.3.0

func (s *Selector) DockerAvailable() bool

DockerAvailable checks if Docker is available

func (*Selector) GetDocker added in v1.3.0

func (s *Selector) GetDocker() *DockerExecutor

GetDocker returns the Docker executor (may be nil)

func (*Selector) ListAvailableBackends added in v1.3.0

func (s *Selector) ListAvailableBackends() []BackendType

ListAvailableBackends returns which backends are currently available

func (*Selector) PodmanAvailable added in v1.3.0

func (s *Selector) PodmanAvailable() bool

PodmanAvailable checks if Podman is available

func (*Selector) Select added in v1.3.0

func (s *Selector) Select(toolName string, backend BackendType) (Executor, error)

Select chooses the appropriate executor for a tool based on backend preference

Jump to

Keyboard shortcuts

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