1
0
mirror of synced 2026-05-03 02:03:31 +00:00

Add support for extractPath

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2026-04-13 23:22:47 +03:00
parent 2cee1d795e
commit c0938d351f
5 changed files with 271 additions and 42 deletions

View File

@@ -38,16 +38,26 @@ var reservedNames = map[string]bool{
// Plugin represents a discovered plugin binary.
type Plugin struct {
Name string // e.g., "operator" (derived from "flux-operator")
Path string // absolute path to binary
// Name is the plugin name, e.g. "operator" (derived from "flux-operator").
Name string
// Path is the absolute path to the plugin binary.
Path string
}
// Handler discovers and executes plugins. Uses dependency injection
// for testability.
type Handler struct {
// ReadDir lists directory entries.
ReadDir func(name string) ([]os.DirEntry, error)
Stat func(name string) (os.FileInfo, error)
GetEnv func(key string) string
// Stat returns file info, following symlinks.
Stat func(name string) (os.FileInfo, error)
// GetEnv returns the value of an environment variable.
GetEnv func(key string) string
// HomeDir returns the current user's home directory.
HomeDir func() (string, error)
}