platformutils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchOSToOSArch

func ArchOSToOSArch(input string) string

ArchOSToOSArch converts "Arch-OS" format to "OS/Arch" format.

func FindPlatform

func FindPlatform(platform string) (string, string)

FindPlatform returns OS and arch. Ex: if linux/amd64 is passed, it will return linux amd64. If no platform is passed, it will return the current OS and arch.

func OSArchToArchOS

func OSArchToArchOS(input string) string

OSArchToArchOS converts "OS/Arch" format to "Arch-OS" format.

Types

type FormatType

type FormatType string

FormatType represents the format of a platform string.

const (
	// OSArchFormat represents the "OS/Arch" format.
	OSArchFormat FormatType = "OS/Arch"
	// ArchOSFormat represents the "Arch-OS" format.
	ArchOSFormat FormatType = "Arch-OS"
	// UnknownFormat represents an unknown format.
	UnknownFormat FormatType = "Unknown"
)

func DetermineFormat

func DetermineFormat(platform string) FormatType

DetermineFormat takes a platform string and returns a FormatType indicating its format.

Jump to

Keyboard shortcuts

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