starlark

package
v0.1.0-dev.20260214164504 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package starlark provides the Starlark runtime and host bindings for lore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillSlot

func FillSlot(node *execution.Node, graph *execution.Graph, slotName string, value starlark.Value) error

FillSlot fills a slot in a node from a Starlark value.

Any slot accepts:

  • A promise (Output): creates an edge, value flows at runtime
  • A gather (Gather): creates edges from all members (parallel execution)
  • An immediate value: stored directly, known at analysis time

func MakeAttr

func MakeAttr(name string, fn BuiltinFunc) starlark.Value

MakeAttr creates a starlark.Builtin from a receiver method.

func NoSuchAttrError

func NoSuchAttrError(receiver, attr string) error

NoSuchAttrError returns an error for an unknown attribute.

Types

type ArchivePlan

type ArchivePlan struct {
	Receiver
	// contains filtered or unexported fields
}

ArchivePlan implements plan.archive.* bindings using the slot-based model.

func NewArchivePlan

func NewArchivePlan(graph *execution.Graph, h host.Host, project string) *ArchivePlan

NewArchivePlan creates a new ArchivePlan for the given graph and host.

func (*ArchivePlan) Attr

func (a *ArchivePlan) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*ArchivePlan) AttrNames

func (a *ArchivePlan) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type ArchiveReceiver

type ArchiveReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

ArchiveReceiver provides the archive.* Starlark namespace.

Backing implementation: host.Host (ExpandPath, RunCommand). Extraction delegates to tar via shell.

func NewArchiveReceiver

func NewArchiveReceiver(h host.Host, output io.Writer) *ArchiveReceiver

NewArchiveReceiver creates a new archive receiver.

func (*ArchiveReceiver) Attr

func (r *ArchiveReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*ArchiveReceiver) AttrNames

func (r *ArchiveReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type Bindings

type Bindings struct {
	// contains filtered or unexported fields
}

Bindings provides lore's host API to Starlark scripts.

func NewBindings

func NewBindings(features []string, settings map[string]string, output io.Writer) *Bindings

NewBindings creates a new Bindings instance.

func (*Bindings) Globals

func (b *Bindings) Globals() starlark.StringDict

Globals returns the predeclared globals for Starlark scripts.

type BuiltinFunc

type BuiltinFunc func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

BuiltinFunc is the signature for builtin function implementations.

type DockerReceiver

type DockerReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

DockerReceiver provides the docker.* Starlark namespace.

Backing implementation: os/exec (exec.Command("docker", ...)). Uses kwargs pass-through: any keyword argument is converted to a CLI flag.

Example:

docker.run("nginx", detach=True, name="web", publish=["80:80"])
# Executes: docker run --detach --name web --publish 80:80 nginx

func NewDockerReceiver

func NewDockerReceiver(output io.Writer) *DockerReceiver

NewDockerReceiver creates a new docker receiver.

func (*DockerReceiver) Attr

func (d *DockerReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*DockerReceiver) AttrNames

func (d *DockerReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type EnvReceiver

type EnvReceiver struct {
	Receiver
}

EnvReceiver provides the env.* Starlark namespace.

Backing implementation: os package (Getenv, Setenv, ExpandEnv). No backing struct — delegates directly to the standard library.

func NewEnvReceiver

func NewEnvReceiver() *EnvReceiver

NewEnvReceiver creates a new env receiver.

func (*EnvReceiver) Attr

func (r *EnvReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*EnvReceiver) AttrNames

func (r *EnvReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type FilePlan

type FilePlan struct {
	// contains filtered or unexported fields
}

FilePlan implements plan.file.* bindings using the slot-based model. Each method adds a node to the execution graph.

Slots can be filled with either: - Immediate values (strings known at analysis time) - Promises (Output handles that create edges)

func NewFilePlan

func NewFilePlan(graph *execution.Graph, h host.Host, project string) *FilePlan

NewFilePlan creates a new FilePlan for the given graph and host.

func (*FilePlan) Attr

func (f *FilePlan) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*FilePlan) AttrNames

func (f *FilePlan) AttrNames() []string

func (*FilePlan) Freeze

func (f *FilePlan) Freeze()

func (*FilePlan) Hash

func (f *FilePlan) Hash() (uint32, error)

func (*FilePlan) String

func (f *FilePlan) String() string

Starlark Value interface

func (*FilePlan) Truth

func (f *FilePlan) Truth() starlark.Bool

func (*FilePlan) Type

func (f *FilePlan) Type() string

type Gather

type Gather struct {
	// contains filtered or unexported fields
}

Gather represents a collection of outputs that can run in parallel. When used as a slot input, it creates edges from ALL members to the consumer, enabling parallel execution of the gathered nodes.

Usage in Starlark:

a = plan.file.copy(src1, dst1)
b = plan.file.copy(src2, dst2)
c = plan.file.copy(src3, dst3)
group = plan.gather(a, b, c)
d = plan.whatever(group)  # d waits for a, b, c (which run in parallel)

func NewGather

func NewGather(graph *execution.Graph, outputs ...*Output) *Gather

NewGather creates a new Gather from multiple outputs.

func (*Gather) FillSlot

func (g *Gather) FillSlot(consumer *execution.Node, slotName string)

FillSlot fills a slot in the consumer node with all gathered promises, creating edges from each member. This enables parallel execution.

func (*Gather) Freeze

func (g *Gather) Freeze()

func (*Gather) Hash

func (g *Gather) Hash() (uint32, error)

func (*Gather) Outputs

func (g *Gather) Outputs() []*Output

Outputs returns the gathered outputs.

func (*Gather) String

func (g *Gather) String() string

Starlark Value interface

func (*Gather) Truth

func (g *Gather) Truth() starlark.Bool

func (*Gather) Type

func (g *Gather) Type() string

type GitPlan

type GitPlan struct {
	Receiver
	// contains filtered or unexported fields
}

GitPlan implements plan.git.* bindings using the slot-based model.

func NewGitPlan

func NewGitPlan(graph *execution.Graph, h host.Host, project string) *GitPlan

NewGitPlan creates a new GitPlan for the given graph and host.

func (*GitPlan) Attr

func (g *GitPlan) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*GitPlan) AttrNames

func (g *GitPlan) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type GitReceiver

type GitReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

GitReceiver provides the git.* Starlark namespace.

Backing implementation: os/exec (exec.Command("git", ...)). Uses kwargs pass-through: any keyword argument is converted to a CLI flag. This means all git flags work automatically without explicit binding code.

Example:

git.clone("https://github.com/user/repo", depth=1, branch="main")
# Executes: git clone --depth 1 --branch main https://github.com/user/repo

func NewGitReceiver

func NewGitReceiver(output io.Writer) *GitReceiver

NewGitReceiver creates a new git receiver.

func (*GitReceiver) Attr

func (g *GitReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*GitReceiver) AttrNames

func (g *GitReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type HTTPReceiver

type HTTPReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

HTTPReceiver provides the http.* Starlark namespace.

Backing implementation: net/http (Get) for requests, host.Host (ExpandPath) for path expansion.

func NewHTTPReceiver

func NewHTTPReceiver(h host.Host, output io.Writer) *HTTPReceiver

NewHTTPReceiver creates a new http receiver.

func (*HTTPReceiver) Attr

func (r *HTTPReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*HTTPReceiver) AttrNames

func (r *HTTPReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type LogReceiver

type LogReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

LogReceiver provides the log.* Starlark namespace and root-level output functions (note, warn, error, success, fail).

Backing implementation: io.Writer. Bound to root as both the "log" namespace and as individual builtins.

func NewLogReceiver

func NewLogReceiver(output io.Writer) *LogReceiver

NewLogReceiver creates a new log receiver.

func (*LogReceiver) Attr

func (r *LogReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*LogReceiver) AttrNames

func (r *LogReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type NpmReceiver

type NpmReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

NpmReceiver provides the npm.* Starlark namespace.

Backing implementation: os/exec (exec.Command("npm", ...), exec.Command("npx", ...)). Uses kwargs pass-through: any keyword argument is converted to a CLI flag.

Example:

npm.install("astro", "tailwind", global=True, save_dev=True)
# Executes: npm install --global --save-dev astro tailwind

func NewNpmReceiver

func NewNpmReceiver(output io.Writer) *NpmReceiver

NewNpmReceiver creates a new npm receiver.

func (*NpmReceiver) Attr

func (n *NpmReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*NpmReceiver) AttrNames

func (n *NpmReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type Output

type Output struct {
	// contains filtered or unexported fields
}

Output represents a promise - a handle to a node's output that can flow through the graph to fill slots in other nodes.

When passed to a plan function's slot, it creates an edge in the graph. The same promise can flow to multiple slots (fan-out).

func NewOutput

func NewOutput(node *execution.Node, graph *execution.Graph, slot string) *Output

NewOutput creates a new Output (promise) representing a node's output.

func ResolveInput

func ResolveInput(value starlark.Value) (*Output, error)

ResolveInput extracts an *Output from a Starlark value. Returns an error if the value is not an Output.

func (*Output) Attr

func (o *Output) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*Output) AttrNames

func (o *Output) AttrNames() []string

func (*Output) DependOn

func (o *Output) DependOn(consumer *execution.Node)

DependOn creates an edge making the given node depend on this output's node.

func (*Output) FillSlot

func (o *Output) FillSlot(consumer *execution.Node, slotName string)

FillSlot fills a slot in the consumer node with this promise, creating an edge. This is called when a promise is passed to a plan function.

func (*Output) Freeze

func (o *Output) Freeze()

func (*Output) Graph

func (o *Output) Graph() *execution.Graph

Graph returns the execution graph.

func (*Output) Hash

func (o *Output) Hash() (uint32, error)

func (*Output) Node

func (o *Output) Node() *execution.Node

Node returns the execution node that produces this output.

func (*Output) Path

func (o *Output) Path() string

Path returns a path from the node's slots.

func (*Output) Slot

func (o *Output) Slot() string

Slot returns which output slot this represents.

func (*Output) String

func (o *Output) String() string

Starlark Value interface

func (*Output) Truth

func (o *Output) Truth() starlark.Bool

func (*Output) Type

func (o *Output) Type() string

type PackageContext

type PackageContext struct {
	// Name is the package name being deployed.
	Name string

	// Version is the version being deployed.
	Version string

	// Features are the enabled feature flags for this deployment.
	Features []string

	// Settings are key-value configuration settings.
	Settings map[string]string

	// DryRun indicates this is a preview (no actual changes).
	DryRun bool

	// SourceRoot is the package source directory in the registry cache.
	SourceRoot string

	// TargetRoot is the deployment target directory (usually $HOME).
	TargetRoot string
}

PackageContext provides information about the package being deployed. Passed to phase scripts as the second argument.

func (*PackageContext) HasFeature

func (p *PackageContext) HasFeature(name string) bool

HasFeature checks if a feature is enabled.

func (*PackageContext) Setting

func (p *PackageContext) Setting(key string) string

Setting returns a setting value, or empty string if not set.

func (*PackageContext) ToStarlark

func (p *PackageContext) ToStarlark() starlark.Value

ToStarlark converts the PackageContext to a Starlark receiver.

type PackagePlan

type PackagePlan struct {
	// contains filtered or unexported fields
}

PackagePlan implements plan.package.* bindings using the slot-based model. Each method adds a node to the execution graph.

func NewPackagePlan

func NewPackagePlan(graph *execution.Graph, h host.Host, project string) *PackagePlan

NewPackagePlan creates a new PackagePlan for the given graph and host.

func (*PackagePlan) Attr

func (p *PackagePlan) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*PackagePlan) AttrNames

func (p *PackagePlan) AttrNames() []string

func (*PackagePlan) Freeze

func (p *PackagePlan) Freeze()

func (*PackagePlan) Hash

func (p *PackagePlan) Hash() (uint32, error)

func (*PackagePlan) String

func (p *PackagePlan) String() string

Starlark Value interface

func (*PackagePlan) Truth

func (p *PackagePlan) Truth() starlark.Bool

func (*PackagePlan) Type

func (p *PackagePlan) Type() string

type PackageQueries

type PackageQueries interface {
	// Installed checks if a package is installed.
	Installed(name string) bool

	// Version returns the installed version of a package, or empty string if not installed.
	Version(name string) string
}

PackageQueries provides read-only package manager queries.

type PackageReceiver

type PackageReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

PackageReceiver provides the package.* Starlark namespace.

Backing implementation: host.PackageManager for package operations. Also provides access to package features and settings from the manifest.

func NewPackageReceiver

func NewPackageReceiver(pm host.PackageManager, features []string, settings map[string]string, output io.Writer) *PackageReceiver

NewPackageReceiver creates a new package receiver.

func (*PackageReceiver) Attr

func (r *PackageReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*PackageReceiver) AttrNames

func (r *PackageReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type PhaseConfig

type PhaseConfig struct {
	// Retry holds the retry policy configured by the script.
	Retry *execution.RetryPolicy
}

PhaseConfig collects phase configuration from Starlark configure() hooks. Passed to configure(phase) as the single argument.

Starlark API:

def configure(phase):
    phase.retry(max_attempts=3, backoff="exponential", initial_delay="1s")

func NewPhaseConfig

func NewPhaseConfig() *PhaseConfig

NewPhaseConfig creates a new PhaseConfig for collecting script configuration.

func (*PhaseConfig) ToStarlark

func (c *PhaseConfig) ToStarlark() starlark.Value

ToStarlark returns a Starlark value exposing phase.retry().

type PlanBindings

type PlanBindings interface {
	// Graph returns the underlying execution graph being built.
	Graph() *execution.Graph

	// Host returns the host abstraction for path expansion, etc.
	Host() host.Host

	// Project returns the project name for grouping nodes.
	Project() string

	// PackageInstall adds a package installation node.
	PackageInstall(packages ...string) *execution.Node

	// PackageUpgrade adds a package upgrade node.
	PackageUpgrade(packages ...string) *execution.Node

	// PackageRemove adds a package removal node.
	PackageRemove(packages ...string) *execution.Node

	// PackageUpdate adds a package index update node.
	PackageUpdate() *execution.Node

	// Configure adds a configuration file node (template expansion + copy).
	Configure(source, target string) *execution.Node

	// Link adds a symlink creation node.
	Link(source, target string) *execution.Node

	// Copy adds a file copy node.
	Copy(source, target string) *execution.Node

	// Write adds a file write node (write content directly to target).
	Write(target, content string) *execution.Node

	// Remove adds a file/directory removal node.
	Remove(target string) *execution.Node

	// Download adds a file download node.
	Download(url, target string) *execution.Node

	// ArchiveExtract adds an archive extraction node.
	ArchiveExtract(archive, target string) *execution.Node

	// GitClone adds a git clone node.
	GitClone(url, target string) *execution.Node

	// GitCheckout adds a git checkout node.
	GitCheckout(ref string) *execution.Node

	// GitPull adds a git pull node.
	GitPull() *execution.Node

	// Service adds a service management node.
	Service(name string, action ServiceAction) *execution.Node

	// Shell adds a shell command execution node.
	Shell(command string) *execution.Node

	// DependsOn creates a dependency edge between nodes.
	// The 'from' node will execute after the 'to' node completes.
	DependsOn(from, to *execution.Node)
}

PlanBindings provides operations that add nodes to the execution graph. Each method returns the created node for chaining or dependency specification.

Note: Go method names are simple (Install, Remove, etc.) while Starlark uses nested structs (plan.package.install, plan.file.copy) and engine operations use namespaced names (package-install, package-remove).

func NewPlanBindings

func NewPlanBindings(graph *execution.Graph, h host.Host, project string) PlanBindings

NewPlanBindings creates a new PlanBindings for the given graph and host.

type PlanRoot

type PlanRoot struct {
	// contains filtered or unexported fields
}

PlanRoot implements the top-level plan namespace using the slot-based model. It provides access to sub-namespaces (package, file, archive, git) and top-level bindings (source, literal, download, service, shell, depends_on).

func NewPlanRoot

func NewPlanRoot(graph *execution.Graph, h host.Host, project string) *PlanRoot

NewPlanRoot creates a new PlanRoot for the given graph and host.

func (*PlanRoot) Attr

func (p *PlanRoot) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*PlanRoot) AttrNames

func (p *PlanRoot) AttrNames() []string

func (*PlanRoot) Freeze

func (p *PlanRoot) Freeze()

func (*PlanRoot) Hash

func (p *PlanRoot) Hash() (uint32, error)

func (*PlanRoot) String

func (p *PlanRoot) String() string

Starlark Value interface

func (*PlanRoot) Truth

func (p *PlanRoot) Truth() starlark.Bool

func (*PlanRoot) Type

func (p *PlanRoot) Type() string

type Receiver

type Receiver struct {
	// contains filtered or unexported fields
}

Receiver provides common implementations for Starlark binding namespaces. Embed this in concrete types to satisfy starlark.Value. Concrete types must implement starlark.HasAttrs (Attr and AttrNames) themselves.

func NewReceiver

func NewReceiver(name string) Receiver

NewReceiver creates a new Receiver with the given namespace name.

func (Receiver) Freeze

func (r Receiver) Freeze()

Freeze implements starlark.Value.

func (Receiver) Hash

func (r Receiver) Hash() (uint32, error)

Hash implements starlark.Value.

func (Receiver) String

func (r Receiver) String() string

String implements starlark.Value.

func (Receiver) Truth

func (r Receiver) Truth() starlark.Bool

Truth implements starlark.Value.

func (Receiver) Type

func (r Receiver) Type() string

Type implements starlark.Value.

type ServiceAction

type ServiceAction int

ServiceAction represents a service management action.

const (
	// ServiceStart starts a service.
	ServiceStart ServiceAction = iota
	// ServiceStop stops a service.
	ServiceStop
	// ServiceRestart restarts a service.
	ServiceRestart
	// ServiceEnable enables a service at boot.
	ServiceEnable
	// ServiceDisable disables a service at boot.
	ServiceDisable
)

func (ServiceAction) String

func (a ServiceAction) String() string

String returns the action name.

type ServiceQueries

type ServiceQueries interface {
	// Exists checks if a service exists.
	Exists(name string) bool

	// Running checks if a service is currently running.
	Running(name string) bool

	// Enabled checks if a service is enabled at boot.
	Enabled(name string) bool
}

ServiceQueries provides read-only service manager queries.

type ServiceReceiver

type ServiceReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

ServiceReceiver provides the service.* Starlark namespace.

Backing implementation: host.ServiceManager.

func NewServiceReceiver

func NewServiceReceiver(sm host.ServiceManager, output io.Writer) *ServiceReceiver

NewServiceReceiver creates a new service receiver.

func (*ServiceReceiver) Attr

func (r *ServiceReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*ServiceReceiver) AttrNames

func (r *ServiceReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type ShellReceiver

type ShellReceiver struct {
	Receiver
	// contains filtered or unexported fields
}

ShellReceiver provides the shell.* Starlark namespace.

Backing implementation: host.Host (RunCommand) for exec/run, os/exec.LookPath for which.

func NewShellReceiver

func NewShellReceiver(h host.Host, output io.Writer) *ShellReceiver

NewShellReceiver creates a new shell receiver.

func (*ShellReceiver) Attr

func (r *ShellReceiver) Attr(name string) (starlark.Value, error)

Attr implements starlark.HasAttrs.

func (*ShellReceiver) AttrNames

func (r *ShellReceiver) AttrNames() []string

AttrNames implements starlark.HasAttrs.

type StarlarkPlanBindings

type StarlarkPlanBindings struct {
	PlanBindings
}

StarlarkPlanBindings wraps PlanBindings for Starlark conversion.

func (*StarlarkPlanBindings) ToStarlark

func (s *StarlarkPlanBindings) ToStarlark() starlark.Value

ToStarlark converts the plan bindings to a Starlark value. Exposed to phase scripts as the third argument.

All namespaces use the Attr receiver pattern for consistency and static analysis support. Starlark API:

plan.package.install("pkg1", "pkg2", ...)  # Install packages
plan.package.upgrade("pkg1", ...)          # Upgrade packages
plan.package.remove("pkg1", ...)           # Remove packages
plan.package.update()                      # Update package index
plan.file.configure(source, target)        # Configure file (template + copy)
plan.file.link(source, target)             # Create symlink
plan.file.copy(source, target)             # Copy file
plan.file.write(target, content)           # Write content to file
plan.file.remove(target)                   # Remove file/directory
plan.archive.extract(archive, prefix)      # Extract archive
plan.git.clone(url, path)                  # Clone repository
plan.git.checkout(repo, ref)               # Checkout ref
plan.git.pull(repo)                        # Pull changes
plan.source(path)                          # Declare source file
plan.literal(content)                      # Inline content
plan.download(url)                         # Download file
plan.service(name, action)                 # Manage service
plan.shell(command)                        # Run shell command
plan.depends_on(consumer, producer)        # Create dependency

type SystemBindings

type SystemBindings interface {
	// Platform returns information about the current system.
	Platform() host.Platform

	// Package provides package manager queries.
	Package() PackageQueries

	// Service provides service manager queries.
	Service() ServiceQueries

	// ToStarlark converts the system bindings to a Starlark value.
	ToStarlark() starlark.Value
}

SystemBindings provides read-only queries about the current platform state. Wraps host.Host to expose platform information to phase scripts.

func NewSystemBindings

func NewSystemBindings(h host.Host) SystemBindings

NewSystemBindings creates a new SystemBindings from a host.Host.

type SystemFile

type SystemFile struct {
	// contains filtered or unexported fields
}

SystemFile implements system.file.* bindings for filesystem queries. These are immediate queries - they execute during analysis, not deferred.

func NewSystemFile

func NewSystemFile(h host.Host) *SystemFile

NewSystemFile creates a new SystemFile for the given host.

func (*SystemFile) Attr

func (f *SystemFile) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*SystemFile) AttrNames

func (f *SystemFile) AttrNames() []string

func (*SystemFile) Freeze

func (f *SystemFile) Freeze()

func (*SystemFile) Hash

func (f *SystemFile) Hash() (uint32, error)

func (*SystemFile) String

func (f *SystemFile) String() string

Starlark Value interface

func (*SystemFile) Truth

func (f *SystemFile) Truth() starlark.Bool

func (*SystemFile) Type

func (f *SystemFile) Type() string

type SystemGit

type SystemGit struct{}

SystemGit implements system.git.* bindings for git queries. These are immediate queries - they execute during analysis, not deferred.

func NewSystemGit

func NewSystemGit() *SystemGit

NewSystemGit creates a new SystemGit.

func (*SystemGit) Attr

func (g *SystemGit) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*SystemGit) AttrNames

func (g *SystemGit) AttrNames() []string

func (*SystemGit) Freeze

func (g *SystemGit) Freeze()

func (*SystemGit) Hash

func (g *SystemGit) Hash() (uint32, error)

func (*SystemGit) String

func (g *SystemGit) String() string

Starlark Value interface

func (*SystemGit) Truth

func (g *SystemGit) Truth() starlark.Bool

func (*SystemGit) Type

func (g *SystemGit) Type() string

type SystemPackage

type SystemPackage struct {
	// contains filtered or unexported fields
}

SystemPackage implements system.package.* bindings for package manager queries. These are immediate queries - they execute during analysis, not deferred.

func NewSystemPackage

func NewSystemPackage(pm host.PackageManager) *SystemPackage

NewSystemPackage creates a new SystemPackage for the given package manager.

func (*SystemPackage) Attr

func (p *SystemPackage) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*SystemPackage) AttrNames

func (p *SystemPackage) AttrNames() []string

func (*SystemPackage) Freeze

func (p *SystemPackage) Freeze()

func (*SystemPackage) Hash

func (p *SystemPackage) Hash() (uint32, error)

func (*SystemPackage) String

func (p *SystemPackage) String() string

Starlark Value interface

func (*SystemPackage) Truth

func (p *SystemPackage) Truth() starlark.Bool

func (*SystemPackage) Type

func (p *SystemPackage) Type() string

type SystemRoot

type SystemRoot struct {
	// contains filtered or unexported fields
}

SystemRoot implements the top-level system namespace using the Attr receiver pattern. It provides access to sub-namespaces (package, service, git, file) and the platform struct.

Unlike plan.*, system.* bindings query current system state immediately rather than building an execution graph.

func NewSystemRoot

func NewSystemRoot(h host.Host) *SystemRoot

NewSystemRoot creates a new SystemRoot for the given host.

func (*SystemRoot) Attr

func (s *SystemRoot) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*SystemRoot) AttrNames

func (s *SystemRoot) AttrNames() []string

func (*SystemRoot) Freeze

func (s *SystemRoot) Freeze()

func (*SystemRoot) Hash

func (s *SystemRoot) Hash() (uint32, error)

func (*SystemRoot) String

func (s *SystemRoot) String() string

Starlark Value interface

func (*SystemRoot) Truth

func (s *SystemRoot) Truth() starlark.Bool

func (*SystemRoot) Type

func (s *SystemRoot) Type() string

type SystemService

type SystemService struct {
	// contains filtered or unexported fields
}

SystemService implements system.service.* bindings for service manager queries. These are immediate queries - they execute during analysis, not deferred.

func NewSystemService

func NewSystemService(sm host.ServiceManager) *SystemService

NewSystemService creates a new SystemService for the given service manager.

func (*SystemService) Attr

func (s *SystemService) Attr(name string) (starlark.Value, error)

Starlark HasAttrs interface

func (*SystemService) AttrNames

func (s *SystemService) AttrNames() []string

func (*SystemService) Freeze

func (s *SystemService) Freeze()

func (*SystemService) Hash

func (s *SystemService) Hash() (uint32, error)

func (*SystemService) String

func (s *SystemService) String() string

Starlark Value interface

func (*SystemService) Truth

func (s *SystemService) Truth() starlark.Bool

func (*SystemService) Type

func (s *SystemService) Type() string

Directories

Path Synopsis
Package platform provides platform-specific plan bindings for the Starlark runtime.
Package platform provides platform-specific plan bindings for the Starlark runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL