Initial commit: unitdore scaffold + syncup/edit commands

- config: load/save/add unit, Unit struct
- runtime: podman + docker discovery and exists check
- cmd: syncup (discover + reconcile), edit, cobra root
- PLAN.md: full project plan
This commit is contained in:
2026-04-03 14:39:09 +02:00
commit aa7d85822c
12 changed files with 633 additions and 0 deletions

33
runtime/runtime.go Normal file
View File

@@ -0,0 +1,33 @@
package runtime
// Container represents a discovered running container.
type Container struct {
Name string
Image string
Command string
Runtime string // "podman" or "docker"
}
// Runtime is the interface all container runtimes must implement.
type Runtime interface {
Name() string
ListRunning() ([]Container, error)
Exists(name string) (bool, error)
}
// Available returns all supported runtimes (callers skip those with no binary).
func Available() []Runtime {
return []Runtime{&Podman{}, &Docker{}}
}
// Get returns a runtime by name ("podman" or "docker").
func Get(name string) Runtime {
switch name {
case "podman":
return &Podman{}
case "docker":
return &Docker{}
default:
return nil
}
}