platform

package
v0.1.0-dev.20260314180406 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 1 Imported by: 0

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

func NewProvider(ctx op.Context) *Provider

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

func (p *Provider) Arch() string

Arch returns the CPU architecture (e.g., "amd64", "arm64").

Returns:

  • string: the architecture identifier, or "" if platform is nil.

func (*Provider) Distro

func (p *Provider) Distro() string

Distro returns the OS distribution (e.g., "Ubuntu", "Fedora").

Returns:

  • string: the distribution name, or "" if unavailable or platform is nil.

func (*Provider) Hostname

func (p *Provider) Hostname() string

Hostname returns the machine hostname.

Returns:

  • string: the hostname, or "" if unavailable or platform is nil.

func (*Provider) OS

func (p *Provider) OS() string

OS returns the operating system name (e.g., "darwin", "linux", "windows").

Returns:

  • string: the OS identifier, or "" if platform is nil.

func (*Provider) Version

func (p *Provider) Version() string

Version returns the OS version string.

Returns:

  • string: the version, or "" if unavailable or platform is nil.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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