flatpak

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package flatpak provides an implementation of the syspkg manager interface for the Flatpak package manager. It provides a unified interface for interacting with the Flatpak package manager. This package is a wrapper around the Flatpak command-line interface.

Flatpak is a software utility for software deployment, package management, and application virtualization for Linux desktop computers. The Flatpak command-line interface aims to be a complete tool for installing, managing, and running Flatpak software. For more information about Flatpak, visit: - https://flatpak.org/ - https://docs.flatpak.org/en/latest/flatpak-command-reference.html

This package is part of the syspkg library.

Index

Constants

View Source
const (
	ArgsAssumeYes string = "-y"
	ArgsAssumeNo  string = ""
	ArgsDryRun    string = "--no-deploy"
	ArgsFixBroken string = ""
	ArgsQuiet     string = ""
	ArgsPurge     string = "--delete-data" // https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-uninstall
	// When --delete-data is specified while removing an app, its data directory in ~/.var/app and any permissions it might have are removed. When --delete-data is used without a REF , all 'unowned' app data is removed.
	ArgsAutoRemove     string = "--unused" // Remove unused refs on the system.
	ArgsShowProgress   string = ""
	ArgsNonInteractive string = "--noninteractive"
	ArgsVerbose        string = "--verbose"
	ArgsUpsert         string = "--or-update"
)

Constants representing Flatpak command arguments.

Variables

View Source
var ENV_NonInteractive []string = []string{"LC_ALL=C"}

ENV_NonInteractive is an environment variable that sets the locale to C for non-interactive mode.

Functions

func ParseFindOutput

func ParseFindOutput(msg string, opts *manager.Options) []manager.PackageInfo

ParseFindOutput parses the output of the flatpak search command and returns a slice of PackageInfo.

func ParseInstallOutput

func ParseInstallOutput(msg string, opts *manager.Options) []manager.PackageInfo

ParseInstallOutput parses the output of the flatpak install command and returns a slice of PackageInfo.

func ParseListInstalledOutput

func ParseListInstalledOutput(msg string, opts *manager.Options) []manager.PackageInfo

ParseListInstalledOutput parses the output of the flatpak list command for installed packages and returns a slice of PackageInfo.

func ParseListUpgradableOutput

func ParseListUpgradableOutput(msg string, opts *manager.Options) []manager.PackageInfo

ParseListUpgradableOutput parses the output of the flatpak list command for upgradable packages and returns a slice of PackageInfo.

func ParsePackageInfoOutput

func ParsePackageInfoOutput(msg string, opts *manager.Options) manager.PackageInfo

ParsePackageInfoOutput parses the output of the flatpak info command and returns a PackageInfo struct.

Types

type PackageManager

type PackageManager struct{}

PackageManager implements the syspkg manager interface for Flatpak.

func (*PackageManager) Delete

func (a *PackageManager) Delete(pkgs []string, opts *manager.Options) ([]manager.PackageInfo, error)

Delete removes the given packages using Flatpak with the provided options.

func (*PackageManager) Find

func (a *PackageManager) Find(keywords []string, opts *manager.Options) ([]manager.PackageInfo, error)

Find searches for packages matching the given keywords using Flatpak with the provided options.

func (*PackageManager) GetPackageInfo

func (a *PackageManager) GetPackageInfo(pkg string, opts *manager.Options) (manager.PackageInfo, error)

GetPackageInfo retrieves package information for a single package using Flatpak with the provided options.

func (*PackageManager) GetPackageManager

func (a *PackageManager) GetPackageManager() string

GetPackageManager returns the name of the Flatpak package manager.

func (*PackageManager) Install

func (a *PackageManager) Install(pkgs []string, opts *manager.Options) ([]manager.PackageInfo, error)

Install installs the given packages using Flatpak with the provided options.

func (*PackageManager) IsAvailable

func (a *PackageManager) IsAvailable() bool

IsAvailable checks if the Flatpak package manager is available on the system.

func (*PackageManager) ListInstalled

func (a *PackageManager) ListInstalled(opts *manager.Options) ([]manager.PackageInfo, error)

ListInstalled lists installed packages using Flatpak with the provided options.

func (*PackageManager) ListUpgradable

func (a *PackageManager) ListUpgradable(opts *manager.Options) ([]manager.PackageInfo, error)

ListUpgradable lists upgradable packages using Flatpak with the provided options.

func (*PackageManager) Refresh

func (a *PackageManager) Refresh(opts *manager.Options) error

Refresh updates the package metadata for Flatpak. Not currently implemented.

func (*PackageManager) UpgradeAll

func (a *PackageManager) UpgradeAll(opts *manager.Options) ([]manager.PackageInfo, error)

UpgradeAll upgrades all packages using Flatpak with the provided options.

Jump to

Keyboard shortcuts

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