platformutil

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMatchComparer

func NewMatchComparer(all bool, ss []string) (platforms.MatchComparer, error)

Ported from nerdctl project, copyright The containerd Authors. https://github.com/containerd/nerdctl/blob/0f1c52a2d5c76b49789699d0a0018a99e4c1cff8/pkg/platformutil/platformutil.go#L40

NewMatchComparer returns MatchComparer. If all is true, NewMatchComparer always returns All, regardless to the value of ss. If all is false and ss is empty, NewMatchComparer returns DefaultStrict (not Default). Otherwise NewMatchComparer returns Ordered MatchComparer.

func NewOCISpecPlatformSlice

func NewOCISpecPlatformSlice(all bool, ss []string) ([]ocispec.Platform, error)

Ported from nerdctl project, copyright The containerd Authors. https://github.com/containerd/nerdctl/blob/0f1c52a2d5c76b49789699d0a0018a99e4c1cff8/pkg/platformutil/platformutil.go#L56

NewOCISpecPlatformSlice returns a slice of ocispec.Platform If all is true, NewOCISpecPlatformSlice always returns an empty slice, regardless to the value of ss. If all is false and ss is empty, NewOCISpecPlatformSlice returns DefaultSpec. Otherwise NewOCISpecPlatformSlice returns the slice that correspond to ss.

func ParsePlatforms

func ParsePlatforms(all bool, ss string) (platforms.MatchComparer, error)

Parse platform strings into MatchComparer, ss is multiple platforms split by ",", For example: linux/amd64,linux/arm64

Types

This section is empty.

Jump to

Keyboard shortcuts

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