Documentation ¶
Index ¶
- Variables
- func IsValid(s string) bool
- func NewErrInvalidPlatform(value string) error
- func Satisfies(plat Platform, constraint Platform) bool
- func SatisfiesOCI(ociplat *ocispec.Platform, constraint Platform) bool
- func SelectIndex(candidates []Platform, constraint Platform) int
- func SelectManifest(index *ocispec.Index, constraint Platform) (ocispec.Descriptor, error)
- func SelectManifestIndex(index *ocispec.Index, constraint Platform) int
- func ValidateAll(s ...string) error
- type List
- type Platform
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPlatform = errors.New("invalid platform")
ErrInvalidPlatform represents a platform value error.
var SupportedPlatforms = List{ Arm64Sonoma, Arm64Ventura, Arm64Monterey, Arm64BigSur, Sonoma, Ventura, Monterey, BigSur, Catalina, Mojave, HighSierra, X8664Linux, }
SupportedPlatforms contains all supported platforms.
var ValidPlatformValues = append([]Platform{All}, SupportedPlatforms...)
ValidPlatformValues validates flag values.
Functions ¶
func NewErrInvalidPlatform ¶
NewErrInvalidPlatform wraps ErrInvalidPlatform with the invalid platform value.
func Satisfies ¶
Satisfies simply checks if the given platform satisfies the constraint. The selected platform will not exceed the constraint.
func SatisfiesOCI ¶
SatisfiesOCI checks if the given OCI image platform satisfies the constraint. The selected platform will not exceed the constraint.
func SelectIndex ¶
SelectIndex selects the most viable platform from a list of candidate platforms. The returned index will be -1 if a compatible platform is not found. The selected platform will not exceed the constraint.
func SelectManifest ¶
SelectManifest selects the most viable manifest from an OCI image index. The returned index will be -1 if a compatible image is not found. The selected platform will not exceed the constraint.
func SelectManifestIndex ¶
SelectManifestIndex selects the most viable manifest from an OCI image index. The returned index will be -1 if a compatible image is not found. The selected platform will not exceed the constraint.
func ValidateAll ¶
ValidateAll reports an error if any given strings are an invalid platform.
Types ¶
type List ¶
type List []Platform
List defines a list of platforms.
type Platform ¶
type Platform string
Platform defines a platform.
const ( Arm64Sonoma Platform = "arm64_sonoma" // macOS Sonoma ARM 64-bit Arm64Ventura Platform = "arm64_ventura" // macOS Sonoma ARM 64-bit Arm64Monterey Platform = "arm64_monterey" // macOS Sonoma ARM 64-bit Arm64BigSur Platform = "arm64_big_sur" // macOS Sonoma ARM 64-bit Sonoma Platform = "sonoma" // macOS Sonoma x86 64-bit Ventura Platform = "ventura" // macOS Ventura x86 64-bit Monterey Platform = "monterey" // macOS Monterey x86 64-bit BigSur Platform = "big_sur" // macOS Big Sur x86 64-bit Catalina Platform = "catalina" // macOS Catalina x86 64-bit Mojave Platform = "mojave" // macOS Mojave x86 64-bit HighSierra Platform = "high_sierra" // macOS High Sierra x86 64-bit X8664Linux Platform = "x86_64_linux" // Linux x86 64-bit All Platform = "all" // All platforms Unsupported Platform = "" // Unsupported platform (hops defined) )