platforms

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spec

type Spec struct {
	OS   string
	Arch string
}

Spec defines a platform as an os/arch pair.

func GetCurrentPlatformSpec added in v1.1.0

func GetCurrentPlatformSpec() (spec Spec)

GetCurrentPlatformSpec returns a platform.Spec for the platform on which this code is currently being executed

func (*Spec) IsCompatibleWith

func (s *Spec) IsCompatibleWith(otherSpec Spec) bool

IsCompatibleWith returns true if the current spec is compatible with the spec specified as its argument. TTPs will often not care about the architecture and will therefore specify requirements like:

platforms:
  - os: windows

In such cases, we can assume that the TTP is compatible with all architectures.

func (*Spec) String

func (s *Spec) String() string

String returns a human readable representation of the spec; it is mainly used for error messages.

func (*Spec) Validate

func (s *Spec) Validate() error

Validate checks whether the platform spec is valid. To be valid, the spec must be enforceable, so at least one of the fields must be non-empty.

Jump to

Keyboard shortcuts

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