Documentation
¶
Overview ¶
Package platform provides access to platform information by graph actions and executing receivers.
Index ¶
Constants ¶
This section is empty.
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 op.Platform on the provider's op.Context. When the context has no platform (nil), accessors return zero values.
+devlore:access=both
func NewProvider ¶
NewProvider returns a new platform Provider with the given op.Context.
Parameters:
- ctx: 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.
func (*Provider) Distro ¶
Distro returns the OS distribution (e.g., "Ubuntu", "Fedora").
Returns:
- string: the distribution name, or "" if unavailable or platform is nil.
func (*Provider) Hostname ¶
Hostname returns the machine hostname.
Returns:
- string: the hostname, or "" if unavailable or platform is nil.
Click to show internal directories.
Click to hide internal directories.