Documentation
¶
Overview ¶
Package discovery finds Docker Compose projects on disk under user-configured roots, so the UI can offer "available but not yet deployed" stacks alongside the label-derived running ones. It is read-only: it parses just enough of each compose file (its name and service count) and never executes anything.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Roots []Root `json:"roots"`
Filter Filter `json:"filter"`
Aliases map[string]string `json:"aliases"` // normalized project name → Oriel display name
}
Config is the persisted discovery configuration.
type Discovered ¶
type Discovered struct {
Name string `json:"name"` // normalized project name (the identity)
Alias string `json:"alias"` // Oriel display name, if set (display only)
Dir string `json:"dir"` // project directory
File string `json:"file"` // canonical compose file
Services int `json:"services"` // service count, -1 if unparseable
}
Discovered is one compose project found on disk.
type Filter ¶
Filter restricts which discovered stacks surface. Mode "off" shows all; "allow" shows only matches; "deny" hides matches. Running stacks are never affected — the filter is applied to discovery results only.
func (Filter) Allows ¶
func (f Filter) Allows(d Discovered) bool
Allows reports whether a discovered stack passes the filter. Patterns match a project's name, its Oriel alias, or its directory path (path globs may use **).
type Root ¶
type Root struct {
ID string `json:"id"`
Path string `json:"path"`
Traverse bool `json:"traverse"`
Enabled bool `json:"enabled"`
}
Root is one configured search location.
type RootResult ¶
type RootResult struct {
ID string `json:"id"`
Found int `json:"found"`
Error string `json:"error,omitempty"`
}
RootResult reports per-root scan feedback for the Settings UI.
type ScanResult ¶
type ScanResult struct {
Stacks []Discovered `json:"stacks"`
Roots []RootResult `json:"roots"`
}
ScanResult is the full output of a scan.
func Scan ¶
func Scan(cfg Config) ScanResult
Scan walks all enabled roots, de-duplicates by compose-file path, applies display aliases, and reports per-root feedback. Filtering and deployed-stack exclusion happen in the caller (which has the live container list).