Documentation
¶
Index ¶
- Constants
- func EnvVars(manifest *Manifest, basePath string) []string
- func PrepareDAG(ctx context.Context, dag *core.DAG, installer Installer, opts InstallOptions, ...) ([]string, error)
- func ToolsetHash(cfg *core.ToolConfig, platform string) (string, error)
- func ValidateDAGSupported(dag *core.DAG) error
- type CacheLayout
- type Command
- type InstallOptions
- type Installer
- type Manifest
Constants ¶
const (
// EnvManifest points command executors to the resolved Dagu tools manifest.
EnvManifest = "DAGU_TOOLS_MANIFEST"
)
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
ReadManifest reads a resolved tools manifest from disk.