Documentation
¶
Overview ¶
Package platform provides platform-specific plan bindings for the Starlark runtime.
Each platform (darwin, linux, windows) provides specialized implementations that understand the native package manager, service manager, and file system conventions for that platform.
Build Tags:
- darwin.go: macOS with Homebrew and launchd
- linux.go: Linux with runtime distro detection (apt, dnf, pacman)
- windows.go: Windows with winget
The correct implementation is selected via Go build tags at compile time, with Linux using runtime detection to select the appropriate package manager.
Index ¶
- type LinuxPlanBindings
- func (b LinuxPlanBindings) ArchiveExtract(archive, target string) *execution.Node
- func (l *LinuxPlanBindings) Copy(source, target string) *execution.Node
- func (l *LinuxPlanBindings) Decrypt(source string) *execution.Node
- func (l *LinuxPlanBindings) DependsOn(from, to *execution.Node)
- func (b LinuxPlanBindings) Download(url, target string) *execution.Node
- func (b LinuxPlanBindings) GitCheckout(ref string) *execution.Node
- func (b LinuxPlanBindings) GitClone(url, target string) *execution.Node
- func (b LinuxPlanBindings) GitPull() *execution.Node
- func (b LinuxPlanBindings) Graph() *execution.Graph
- func (b LinuxPlanBindings) Host() host.Host
- func (l *LinuxPlanBindings) Link(source, target string) *execution.Node
- func (l *LinuxPlanBindings) PackageInstall(packages ...string) *execution.Node
- func (l *LinuxPlanBindings) PackageManagerName() string
- func (l *LinuxPlanBindings) PackageRemove(packages ...string) *execution.Node
- func (l *LinuxPlanBindings) PackageUpdate() *execution.Node
- func (l *LinuxPlanBindings) PackageUpgrade(packages ...string) *execution.Node
- func (l *LinuxPlanBindings) PlatformName() string
- func (b LinuxPlanBindings) Project() string
- func (b LinuxPlanBindings) Remove(target string) *execution.Node
- func (l *LinuxPlanBindings) Render(source string) *execution.Node
- func (l *LinuxPlanBindings) Service(name string, action loreStar.ServiceAction) *execution.Node
- func (l *LinuxPlanBindings) Shell(command string) *execution.Node
- func (l *LinuxPlanBindings) ToStarlark() starlark.Value
- func (l *LinuxPlanBindings) Write(target, content string) *execution.Node
- type PlatformPlanBindings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinuxPlanBindings ¶
type LinuxPlanBindings struct {
// contains filtered or unexported fields
}
LinuxPlanBindings provides Linux-specific plan bindings. Uses runtime distro detection to select the appropriate package manager.
func (LinuxPlanBindings) ArchiveExtract ¶
ArchiveExtract adds an archive extraction node.
func (*LinuxPlanBindings) Copy ¶
func (l *LinuxPlanBindings) Copy(source, target string) *execution.Node
Copy adds a file copy node.
func (*LinuxPlanBindings) Decrypt ¶
func (l *LinuxPlanBindings) Decrypt(source string) *execution.Node
Decrypt adds a decryption node.
func (*LinuxPlanBindings) DependsOn ¶
func (l *LinuxPlanBindings) DependsOn(from, to *execution.Node)
DependsOn creates a dependency edge between nodes.
func (LinuxPlanBindings) GitCheckout ¶
GitCheckout adds a git checkout node.
func (*LinuxPlanBindings) Link ¶
func (l *LinuxPlanBindings) Link(source, target string) *execution.Node
Link adds a symlink creation node.
func (*LinuxPlanBindings) PackageInstall ¶
func (l *LinuxPlanBindings) PackageInstall(packages ...string) *execution.Node
PackageInstall adds a package installation node using the platform's package manager.
func (*LinuxPlanBindings) PackageManagerName ¶
func (l *LinuxPlanBindings) PackageManagerName() string
PackageManagerName returns the detected package manager name.
func (*LinuxPlanBindings) PackageRemove ¶
func (l *LinuxPlanBindings) PackageRemove(packages ...string) *execution.Node
PackageRemove adds a package removal node using the platform's package manager.
func (*LinuxPlanBindings) PackageUpdate ¶
func (l *LinuxPlanBindings) PackageUpdate() *execution.Node
PackageUpdate adds a package index update node using the platform's package manager.
func (*LinuxPlanBindings) PackageUpgrade ¶
func (l *LinuxPlanBindings) PackageUpgrade(packages ...string) *execution.Node
PackageUpgrade adds a package upgrade node using the platform's package manager.
func (*LinuxPlanBindings) PlatformName ¶
func (l *LinuxPlanBindings) PlatformName() string
PlatformName returns "linux".
func (LinuxPlanBindings) Project ¶
func (b LinuxPlanBindings) Project() string
Project returns the project name for grouping nodes.
func (*LinuxPlanBindings) Render ¶
func (l *LinuxPlanBindings) Render(source string) *execution.Node
Render adds a template rendering node.
func (*LinuxPlanBindings) Service ¶
func (l *LinuxPlanBindings) Service(name string, action loreStar.ServiceAction) *execution.Node
Service adds a systemd service management node.
func (*LinuxPlanBindings) Shell ¶
func (l *LinuxPlanBindings) Shell(command string) *execution.Node
Shell adds a shell command execution node.
func (*LinuxPlanBindings) ToStarlark ¶
func (l *LinuxPlanBindings) ToStarlark() starlark.Value
ToStarlark converts the plan bindings to a Starlark receiver.
type PlatformPlanBindings ¶
type PlatformPlanBindings interface {
loreStar.PlanBindings
// ToStarlark returns the Starlark representation of the plan bindings.
ToStarlark() starlark.Value
// PlatformName returns the platform identifier (e.g., "darwin", "linux", "windows").
PlatformName() string
// PackageManagerName returns the package manager name (e.g., "brew", "apt", "winget").
PackageManagerName() string
}
PlatformPlanBindings extends PlanBindings with platform-specific operations. Each platform implementation may add additional methods beyond the base interface.
func NewPlanBindings ¶
func NewPlanBindings(graph *execution.Graph, h host.Host, project string, reg *execution.ActionRegistry) PlatformPlanBindings
NewPlanBindings creates a new Linux-specific PlanBindings. The appropriate package manager is selected based on the detected distro.