runtime

package
v0.0.0-...-6d29d49 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureRuntime

func EnsureRuntime(embeddedBlob []byte, opts ...Option) (string, error)

EnsureRuntime unpacks the embedded zstd-compressed tar runtime blob into an XDG cache directory and returns the path to it.

If PORTABLEDESKTOP_RUNTIME_DIR (or the WithRuntimeDir option) is set, that directory is validated and returned directly without extracting anything.

The cache key is derived from the first 12 hex characters of the SHA-256 digest of embeddedBlob. If the cache directory already exists it is reused immediately; otherwise the blob is extracted into a temporary directory and atomically renamed into place.

func ResolveRuntimeBinary

func ResolveRuntimeBinary(runtimeDir, name string) string

ResolveRuntimeBinary returns the full path to name inside runtimeDir/bin if the file exists there. Otherwise it falls back to returning name unqualified so the caller can rely on PATH resolution.

func ResolveRuntimeData

func ResolveRuntimeData(runtimeDir, subpath string) string

ResolveRuntimeData returns the full path to a file under runtimeDir/share/<subpath> if it exists. Returns an empty string if the file is not found.

func ValidateRuntimeDir

func ValidateRuntimeDir(dir string) error

ValidateRuntimeDir checks that dir contains a bin/Xvnc binary.

Types

type Option

type Option func(*options)

Option is a functional option for EnsureRuntime.

func WithRuntimeDir

func WithRuntimeDir(dir string) Option

WithRuntimeDir overrides the PORTABLEDESKTOP_RUNTIME_DIR env var check with the given directory path.

Jump to

Keyboard shortcuts

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