platforms

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 3,368

Documentation

Index

Constants

This section is empty.

Variables

All is a platform MatchComparer which matches all platforms with preference for ordering.

Deprecated: use platforms.All.

Functions

func Any deprecated added in v1.2.0

func Any(platform ...specs.Platform) platforms.MatchComparer

Any returns a platform MatchComparer which matches any of the platforms with no preference for ordering.

Deprecated: use platforms.Any.

func Default deprecated

func Default() platforms.MatchComparer

Default returns the default matcher for the platform.

Deprecated: use platforms.Default.

func DefaultSpec deprecated

func DefaultSpec() specs.Platform

DefaultSpec returns the current platform's default platform specification.

Deprecated: use platforms.DefaultSpec.

func DefaultString deprecated added in v1.2.0

func DefaultString() string

DefaultString returns the default string specifier for the platform.

Deprecated: use platforms.DefaultString.

func Format deprecated

func Format(platform specs.Platform) string

Format returns a string specifier from the provided platform specification.

Deprecated: use platforms.Format.

func GetWindowsOsVersion deprecated added in v1.7.6

func GetWindowsOsVersion() string

GetWindowsOsVersion returns the version of Windows of the local system, it returns an empty string on other platforms.

Deprecated: this function is deprecated, and removed in github.com/containerd/platforms

func MustParse deprecated added in v1.2.0

func MustParse(specifier string) specs.Platform

MustParse is like Parses but panics if the specifier cannot be parsed. Simplifies initialization of global variables.

Deprecated: use platforms.MustParse.

func NewMatcher deprecated added in v1.1.0

func NewMatcher(platform specs.Platform) platforms.Matcher

NewMatcher returns a simple matcher based on the provided platform specification. The returned matcher only looks for equality based on os, architecture and variant.

One may implement their own matcher if this doesn't provide the required functionality.

Applications should opt to use `Match` over directly parsing specifiers.

Deprecated: use platforms.NewMatcher.

func Normalize deprecated

func Normalize(platform specs.Platform) specs.Platform

Normalize validates and translate the platform to the canonical value.

For example, if "Aarch64" is encountered, we change it to "arm64" or if "x86_64" is encountered, it becomes "amd64".

Deprecated: use platforms.Normalize.

func Only deprecated added in v1.2.0

func Only(platform specs.Platform) platforms.MatchComparer

Only returns a match comparer for a single platform using default resolution logic for the platform.

For arm/v8, will also match arm/v7, arm/v6 and arm/v5 For arm/v7, will also match arm/v6 and arm/v5 For arm/v6, will also match arm/v5 For amd64, will also match 386

Deprecated: use platforms.Only.

func OnlyStrict deprecated added in v1.5.0

func OnlyStrict(platform specs.Platform) platforms.MatchComparer

OnlyStrict returns a match comparer for a single platform.

Unlike Only, OnlyStrict does not match sub platforms. So, "arm/vN" will not match "arm/vM" where M < N, and "amd64" will not also match "386".

OnlyStrict matches non-canonical forms. So, "arm64" matches "arm/64/v8".

Deprecated: use platforms.OnlyStrict.

func Ordered deprecated added in v1.2.0

func Ordered(platform ...specs.Platform) platforms.MatchComparer

Ordered returns a platform MatchComparer which matches any of the platforms but orders them in order they are provided.

Deprecated: use platforms.Ordered.

func Parse deprecated

func Parse(specifier string) (specs.Platform, error)

Parse parses the platform specifier syntax into a platform declaration.

Platform specifiers are in the format `<os>|<arch>|<os>/<arch>[/<variant>]`. The minimum required information for a platform specifier is the operating system or architecture. If there is only a single string (no slashes), the value will be matched against the known set of operating systems, then fall back to the known set of architectures. The missing component will be inferred based on the local environment.

Deprecated: use platforms.Parse.

Types

type MatchComparer deprecated added in v1.2.0

type MatchComparer = platforms.MatchComparer

MatchComparer is able to match and compare platforms to filter and sort platforms.

Deprecated: use platforms.MatchComparer.

func DefaultStrict deprecated added in v1.5.0

func DefaultStrict() MatchComparer

DefaultStrict returns strict form of Default.

Deprecated: use platforms.DefaultStrict.

type Matcher deprecated

type Matcher = platforms.Matcher

Matcher matches platforms specifications, provided by an image or runtime.

Deprecated: use platforms.Matcher.

type Platform deprecated added in v1.7.0

type Platform = specs.Platform

Platform is a type alias for convenience, so there is no need to import image-spec package everywhere.

Deprecated: use specs.Platform.

Jump to

Keyboard shortcuts

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