tools

package
v2.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// EnvManifest points command executors to the resolved Dagu tools manifest.
	EnvManifest = "DAGU_TOOLS_MANIFEST"
)

Variables

This section is empty.

Functions

func EnvVars

func EnvVars(manifest *Manifest, basePath string) []string

EnvVars returns the runtime env vars needed to expose a resolved aqua toolset.

func PrepareDAG

func PrepareDAG(ctx context.Context, dag *core.DAG, installer Installer, opts InstallOptions, basePath string) ([]string, error)

PrepareDAG validates, installs, and exposes the tools declared by a DAG.

func ToolsetHash

func ToolsetHash(cfg *core.ToolConfig, platform string) (string, error)

ToolsetHash returns a stable hash for a tool declaration on a platform.

func ValidateDAGSupported

func ValidateDAGSupported(dag *core.DAG) error

ValidateDAGSupported returns an error when DAG tools are declared for an execution mode that cannot receive the host-local tool environment.

Types

type CacheLayout

type CacheLayout struct {
	RootDir      string
	LockDir      string
	EnvDir       string
	BinDir       string
	ConfigFile   string
	ChecksumFile string
	ManifestFile string
}

CacheLayout contains worker-local cache paths for a toolset.

func CachePaths

func CachePaths(toolsDir, platform, toolsetHash string) (CacheLayout, error)

CachePaths returns the worker-local cache paths for an aqua-backed toolset.

type Command

type Command struct {
	Name    string `json:"name"`
	Path    string `json:"path"`
	Package string `json:"package"`
	Version string `json:"version"`
}

Command records one resolved executable path.

type InstallOptions

type InstallOptions struct {
	ToolsDir string
	// DataDir is kept as an internal fallback for callers that have not been
	// updated to pass ToolsDir directly.
	DataDir  string
	WorkDir  string
	Platform string
}

InstallOptions identifies the worker-local filesystem context for tools.

type Installer

type Installer interface {
	Install(ctx context.Context, cfg *core.ToolConfig, opts InstallOptions) (*Manifest, error)
}

Installer installs and resolves a DAG tool declaration.

type Manifest

type Manifest struct {
	Provider     string             `json:"provider"`
	Platform     string             `json:"platform"`
	Hash         string             `json:"hash"`
	RootDir      string             `json:"rootDir"`
	EnvDir       string             `json:"envDir"`
	BinDir       string             `json:"binDir"`
	Config       string             `json:"config"`
	Checksum     string             `json:"checksum"`
	ManifestFile string             `json:"manifestFile"`
	Commands     map[string]Command `json:"commands"`
}

Manifest records the resolved commands made available to a DAG run.

func ReadManifest

func ReadManifest(path string) (*Manifest, error)

ReadManifest reads a resolved tools manifest from disk.

Directories

Path Synopsis
cmd command

Jump to

Keyboard shortcuts

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