storage

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(reg *RegistryManager, version, arch, expectedRoot string) error

Cleanup removes an installed Qt version directory and updates the registry. expectedRoot is the Qt install root directory (e.g. C:\Qt); only paths under this root will be removed.

func InstallDir

func InstallDir(root, version, arch string) string

InstallDir returns the directory where a Qt SDK should be installed. root is the Qt install root (e.g. C:\Qt), version e.g. "6.10.0", arch e.g. "msvc2022_64".

func LockFile

func LockFile(path string) (func(), error)

LockFile acquires an exclusive advisory lock on a .lock file next to path. Blocks until the lock can be acquired. Returns an unlock function that must be called to release the lock.

On Unix the .lock file is removed at unlock time on a best-effort basis.

func TempDir

func TempDir(installDir string) string

TempDir returns a temporary extraction directory within the install root.

Types

type InstalledExtras

type InstalledExtras struct {
	Docs      bool `json:"docs,omitempty"`
	Examples  bool `json:"examples,omitempty"`
	Sources   bool `json:"sources,omitempty"`
	DebugInfo bool `json:"debug_info,omitempty"`
}

InstalledExtras holds extra content installed alongside a Qt version.

type InstalledQt

type InstalledQt struct {
	Version     string          `json:"version"`
	Arch        string          `json:"arch"`
	InstallDir  string          `json:"install_dir"`
	Modules     []string        `json:"modules,omitempty"`
	Extras      InstalledExtras `json:"extras,omitzero"`
	InstalledAt time.Time       `json:"installed_at"`
	SizeBytes   int64           `json:"size_bytes,omitempty"`
}

InstalledQt describes a single installed Qt SDK target.

type Registry

type Registry struct {
	Version int           `json:"version"`
	Qt      []InstalledQt `json:"qt,omitempty"`
}

Registry is the root of the registry file.

type RegistryManager

type RegistryManager struct {
	// contains filtered or unexported fields
}

RegistryManager manages loading and saving the qvm registry.

func NewRegistryManager

func NewRegistryManager() (*RegistryManager, error)

NewRegistryManager creates a RegistryManager using the XDG state directory. On Linux this is ~/.local/state/qvm/; on Windows %LOCALAPPDATA%\qvm\.

func NewRegistryManagerAt

func NewRegistryManagerAt(path string) *RegistryManager

NewRegistryManagerAt creates a RegistryManager at a specific path (for testing).

func (*RegistryManager) AddQt

func (m *RegistryManager) AddQt(entry InstalledQt) error

AddQt adds or replaces a Qt installation record.

func (*RegistryManager) Load

func (m *RegistryManager) Load() (*Registry, error)

Load reads the registry from disk. Returns an empty registry if the file doesn't exist.

func (*RegistryManager) Path

func (m *RegistryManager) Path() string

Path returns the registry file path.

func (*RegistryManager) RemoveQt

func (m *RegistryManager) RemoveQt(version, arch string) error

RemoveQt removes a Qt installation record.

func (*RegistryManager) Save

func (m *RegistryManager) Save(r *Registry) error

Save atomically writes the registry to disk.

Jump to

Keyboard shortcuts

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