Documentation
¶
Overview ¶
Package platform provides access to platform information by graph actions and executing receivers.
Index ¶
Constants ¶
const ( Arch op.ActionName = "platform.arch" Distro op.ActionName = "platform.distro" Hostname op.ActionName = "platform.hostname" OS op.ActionName = "platform.os" Version op.ActionName = "platform.version" )
Action-name constants for the platform provider's plan-mode actions.
Each constant is the short dotted action label its method dispatches under. Pass these to plan.Plan, op.ReceiverRegistry().BuildAction, RuntimeEnvironment.ActionByName, or WithActionNamed in place of a string literal so a typo is a compile error and rename / find-references work through the constant.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
op.ProviderBase
}
Provider exposes host platform metadata to Starlark scripts and graph actions.
All accessors delegate to the platform capability (`platform.Platform`) on the provider's op.RuntimeEnvironment. When the context has no platform (nil), accessors return zero values.
func NewProvider ¶
func NewProvider(runtimeEnvironment *op.RuntimeEnvironment) *Provider
NewProvider returns a new platform Provider with the given runtime environment.
Parameters:
- `runtimeEnvironment`: the execution context (must carry a non-nil Platform for accessors to return data).
Returns:
- `*Provider`: the configured provider.
func (*Provider) Arch ¶
Arch returns the CPU architecture (e.g., "amd64", "arm64").
Returns:
- `string`: the architecture identifier, or "" if platform is nil.
+devlore:claim=deterministic
func (*Provider) Distro ¶
Distro returns the OS distribution (e.g., "Ubuntu", "Fedora").
Returns:
- `string`: the distribution name, or "" if unavailable or platform is nil.
+devlore:claim=deterministic
func (*Provider) Hostname ¶
Hostname returns the machine hostname.
Returns:
- `string`: the hostname, or "" if unavailable or platform is nil.
+devlore:claim=deterministic