Documentation ¶
Index ¶
- Constants
- Variables
- func CrossPlatform(targetKernel, targetArch, hostKernel, hostArch string) bool
- func GetAlpineArch(mArch string) (string, bool)
- func GetAlpineTripleName(mArch string) (string, bool)
- func GetAppleArch(mArch string) (string, bool)
- func GetAppleTripleName(mArch, darwinVersion string) (string, bool)
- func GetArch(platform, mArch string) (string, bool)
- func GetDebianArch(mArch string) (string, bool)
- func GetDebianTripleName(mArch string, targetKernel, targetLibc string) (v string, ok bool)
- func GetDockerArch(mArch string) (string, bool)
- func GetDockerArchVariant(mArch string) (string, bool)
- func GetDockerHubArch(mArch, mKernel string) (string, bool)
- func GetDockerOS(kernel string) (string, bool)
- func GetGNUArch(mArch string) (string, bool)
- func GetGNUTripleName(mArch, targetKernel, targetLibc string) (string, bool)
- func GetGolangArch(mArch string) (string, bool)
- func GetGolangOS(kernel string) (string, bool)
- func GetLLVMArch(mArch string) (string, bool)
- func GetLLVMTripleName(mArch, targetKernel, targetLibc string) (string, bool)
- func GetOciArch(mArch string) (string, bool)
- func GetOciArchVariant(mArch string) (string, bool)
- func GetOciOS(kernel string) (string, bool)
- func GetQemuArch(mArch string) (string, bool)
- func GetRustArch(mArch string) (string, bool)
- func GetZigArch(mArch string) (string, bool)
- func HardFloatArch(arch string) string
- func SimpleArch(arch string) string
- func SoftFloatArch(arch string) string
- type GlobalEnv
- type ZipCompressionMethod
Constants ¶
const ( ArchiveFormat_Zip = "zip" ArchiveFormat_Tar = "tar" )
const ( CompressionMethod_Gzip = "gzip" CompressionMethod_Bzip2 = "bzip2" CompressionMethod_XZ = "xz" CompressionMethod_LZMA = "lzma" CompressionMethod_ZSTD = "zstd" CompressionMethod_DEFLATE = "deflate" )
const ( EnvName_DUKKHA_CACHE_DIR = "DUKKHA_CACHE_DIR" EnvName_DUKKHA_WORKDIR = "DUKKHA_WORKDIR" EnvName_GIT_BRANCH = "GIT_BRANCH" EnvName_GIT_COMMIT = "GIT_COMMIT" EnvName_GIT_TAG = "GIT_TAG" EnvName_GIT_WORKTREE_CLEAN = "GIT_WORKTREE_CLEAN" EnvName_GIT_DEFAULT_BRANCH = "GIT_DEFAULT_BRANCH" EnvName_TIME_ZONE = "TIME_ZONE" EnvName_TIME_ZONE_OFFSET = "TIME_ZONE_OFFSET" EnvName_TIME_YEAR = "TIME_YEAR" EnvName_TIME_MONTH = "TIME_MONTH" EnvName_TIME_DAY = "TIME_DAY" EnvName_TIME_HOUR = "TIME_HOUR" EnvName_TIME_MINUTE = "TIME_MINUTE" EnvName_TIME_SECOND = "TIME_SECOND" // for linux: ID value in /etc/os-release EnvName_HOST_OS = "HOST_OS" // for linux: VERSION_ID value in /etc/os-release EnvName_HOST_OS_VERSION = "HOST_OS_VERSION" // value of runtime.GOOS EnvName_HOST_KERNEL = "HOST_KERNEL" // value of uname -r syscall EnvName_HOST_KERNEL_VERSION = "HOST_KERNEL_VERSION" // arch value EnvName_HOST_ARCH = "HOST_ARCH" EnvName_HOST_ARCH_SIMPLE = "HOST_ARCH_SIMPLE" // triple name parts EnvName_MATRIX_KERNEL = "MATRIX_KERNEL" EnvName_MATRIX_ARCH = "MATRIX_ARCH" EnvName_MATRIX_ARCH_SIMPLE = "MATRIX_ARCH_SIMPLE" EnvName_MATRIX_LIBC = "MATRIX_LIBC" )
const ( KERNEL_Windows = "windows" KERNEL_Linux = "linux" KERNEL_Darwin = "darwin" KERNEL_FreeBSD = "freebsd" KERNEL_NetBSD = "netbsd" KERNEL_OpenBSD = "openbsd" KERNEL_Solaris = "solaris" KERNEL_Illumos = "illumos" KERNEL_JavaScript = "js" KERNEL_Aix = "aix" KERNEL_Android = "android" KERNEL_iOS = "ios" KERNEL_Plan9 = "plan9" )
const ( LIBC_GNU = "gnu" LIBC_MSVC = "msvc" LIBC_MUSL = "musl" )
nolint:revive
const ( // debian apt PM_APT = "apt" // alpine apk PM_APK = "apk" // centos yum PM_YUM = "yum" // fedora dnf PM_DNF = "dnf" // nix PM_NIX = "nix" // homebrew PM_BREW = "brew" )
nolint:revive
const ( // linux/gnu family Platform_Alpine = "alpine" Platform_Debian = "debian" Platform_Ubuntu = "ubuntu" Platform_GNU = "gnu" // windows family Platform_WindowsNT = "windows_nt" // native windows (libc: MSVC) Platform_WindowsMINGW = "windows_mingw" // posix windows (libc: mingw) // darwin family Platform_MacOS = "macos" Platform_iOS = "ios" Platform_WatchOS = "watchos" // golang family Platform_Golang = "golang" Platform_Docker = "docker" Platform_OCI = "oci" Platform_DockerHub = "dockerhub" // llvm family Platform_LLVM = "llvm" Platform_Zig = "zig" Platform_Rust = "rust" Platform_QEMU = "qemu" )
const (
// Placeholder for current tool cmd (string slice)
DUKKHA_TOOL_CMD = "DUKKHA_TOOL_CMD"
)
nolint:revive
const (
DefaultCacheDir = ".dukkha/cache"
)
Variables ¶
var GlobalEnvNames = &[GlobalEnv_Count]string{ GlobalEnv_DUKKHA_CACHE_DIR: EnvName_DUKKHA_CACHE_DIR, GlobalEnv_DUKKHA_WORKDIR: EnvName_DUKKHA_WORKDIR, GlobalEnv_GIT_BRANCH: EnvName_GIT_BRANCH, GlobalEnv_GIT_COMMIT: EnvName_GIT_COMMIT, GlobalEnv_GIT_TAG: EnvName_GIT_TAG, GlobalEnv_GIT_WORKTREE_CLEAN: EnvName_GIT_WORKTREE_CLEAN, GlobalEnv_GIT_DEFAULT_BRANCH: EnvName_GIT_DEFAULT_BRANCH, GlobalEnv_TIME_ZONE: EnvName_TIME_ZONE, GlobalEnv_TIME_ZONE_OFFSET: EnvName_TIME_ZONE_OFFSET, GlobalEnv_TIME_YEAR: EnvName_TIME_YEAR, GlobalEnv_TIME_MONTH: EnvName_TIME_MONTH, GlobalEnv_TIME_DAY: EnvName_TIME_DAY, GlobalEnv_TIME_HOUR: EnvName_TIME_HOUR, GlobalEnv_TIME_MINUTE: EnvName_TIME_MINUTE, GlobalEnv_TIME_SECOND: EnvName_TIME_SECOND, GlobalEnv_HOST_OS: EnvName_HOST_OS, GlobalEnv_HOST_OS_VERSION: EnvName_HOST_OS_VERSION, GlobalEnv_HOST_KERNEL: EnvName_HOST_KERNEL, GlobalEnv_HOST_KERNEL_VERSION: EnvName_HOST_KERNEL_VERSION, GlobalEnv_HOST_ARCH: EnvName_HOST_ARCH, GlobalEnv_HOST_ARCH_SIMPLE: EnvName_HOST_ARCH_SIMPLE, }
Functions ¶
func CrossPlatform ¶ added in v0.8.0
func GetAlpineArch ¶
func GetAlpineTripleName ¶
GetAlpineTripleName of matrix arch reference: https://more.musl.cc/10/x86_64-linux-musl/ nolint:gocyclo
func GetAppleArch ¶
TODO: determine apple arch nolint:gocyclo
func GetAppleTripleName ¶
nolint:gocyclo
func GetDebianArch ¶
func GetDebianTripleName ¶
nolint:gocyclo
func GetDockerArch ¶
func GetDockerHubArch ¶
func GetDockerOS ¶
GetDockerOS is currently an alias of GetGolangOS
func GetGNUArch ¶ added in v0.2.0
func GetGNUTripleName ¶ added in v0.2.0
Ref: - https://salsa.debian.org/dpkg-team/dpkg/-/blob/main/data/cputable - https://salsa.debian.org/dpkg-team/dpkg/-/blob/main/data/ostable
func GetGolangArch ¶
func GetGolangOS ¶
GetGolangOS get GOOS value by kernel value, return true if kernel value is known to this package
func GetLLVMArch ¶ added in v0.2.0
func GetLLVMTripleName ¶ added in v0.4.0
func GetOciArch ¶
func GetOciArchVariant ¶
currently it's the same as docker arch variant nolint:gocyclo
func GetQemuArch ¶
func GetRustArch ¶ added in v0.2.0
func GetZigArch ¶ added in v0.2.0
func HardFloatArch ¶ added in v0.9.0
HardFloatArch returns hardfloat version of arch
func SimpleArch ¶ added in v0.8.0
SimpleArch generalizes cpu micro arch for practical use
- amd64v{1, 2, 3, 4} => amd64 - arm64v{8, 9} => arm64 - ppc64{, le}v{8, 9} => ppc64{, le}
Exceptions: - armv{5, 6, 7} are kept as is - arm => armv7
func SoftFloatArch ¶ added in v0.9.0
SoftFloatArch returns hardfloat version of arch
Types ¶
type GlobalEnv ¶ added in v0.9.0
type GlobalEnv int32
const ( GlobalEnv_DUKKHA_WORKDIR GlobalEnv = iota GlobalEnv_DUKKHA_CACHE_DIR GlobalEnv_GIT_BRANCH GlobalEnv_GIT_COMMIT GlobalEnv_GIT_TAG GlobalEnv_GIT_WORKTREE_CLEAN GlobalEnv_GIT_DEFAULT_BRANCH GlobalEnv_TIME_ZONE GlobalEnv_TIME_ZONE_OFFSET GlobalEnv_TIME_YEAR GlobalEnv_TIME_MONTH GlobalEnv_TIME_DAY GlobalEnv_TIME_HOUR GlobalEnv_TIME_MINUTE GlobalEnv_TIME_SECOND GlobalEnv_HOST_OS GlobalEnv_HOST_OS_VERSION GlobalEnv_HOST_KERNEL GlobalEnv_HOST_KERNEL_VERSION GlobalEnv_HOST_ARCH GlobalEnv_HOST_ARCH_SIMPLE GlobalEnv_Count )
func GetGlobalEnvIDByName ¶ added in v0.9.0
GetGlobalEnvIDByName return -1 when name is not a global env name
type ZipCompressionMethod ¶ added in v0.5.1
type ZipCompressionMethod uint16
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT#4.4.5
const ( ZipCompressionMethod_Store ZipCompressionMethod = 0 ZipCompressionMethod_Deflate ZipCompressionMethod = 8 ZipCompressionMethod_BZIP2 ZipCompressionMethod = 12 ZipCompressionMethod_LZMA ZipCompressionMethod = 14 ZipCompressionMethod_ZSTD ZipCompressionMethod = 93 ZipCompressionMethod_XZ ZipCompressionMethod = 95 )
func (ZipCompressionMethod) String ¶ added in v0.5.1
func (m ZipCompressionMethod) String() string