mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 21:36:40 -10:00
backend.Backend is Name, Caps and four roles, each required: - Host: Problems, NameMax, Location, DiskDirs, Floors - Images: BuildImage, Images, ImageSize, DeleteImage, BuildTools, ToolFormat, KeyFiles - Machines: CreateVM, Start, Running, ProxyURL, Stop, Delete, Rename, List, Inspect, Exec, Shell, SSH, ForwardTarget - Housekeeping: Usage, Strays, DevvmCache, DeleteCache The optional interfaces Lima implemented (KeyFiles, Storage, Locator, UsageReporter, StrayFinder, CacheCleaner) are gone into the roles, and their callers call the methods directly; Forgetter stays the one optional role, found with backend.As. Running(ctx, vm) returns a backend.Run (ID, Confined, Lifeline) in place of StartID, Confined and Lifeline. Space.Check, Space.Warning and LocationOf take a Host. lima.Lima keeps its fields, Name, Caps and its shared helpers (14 methods), and embeds host, images, machines and housekeeping, each over the Lima it's part of (withRoles); backendtest.Fake is split the same way. The guard has every role's methods, its own for the ones it guards. Structure test: max-methods counts an interface's declared methods too; Lima and the fake leave largeTypes. Tests: TestRunning, TestGuardRoles, TestAs (Forgetter), TestFakeRunningAndNone, two TestRulesFail cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
10 lines
276 B
Go
10 lines
276 B
Go
package backend
|
|
|
|
// CacheEntry is one entry of a backend's own cache that devvm's builds
|
|
// put there: what devvm gc --caches frees (Housekeeping.DevvmCache).
|
|
type CacheEntry struct {
|
|
What string // what it is, as gc lists it
|
|
Path string // the file or folder
|
|
Size int64
|
|
}
|