flatpak

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: 0BSD Imports: 7 Imported by: 0

Documentation

Overview

Package flatpak provides Go bindings for the Flatpak package manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flatpak

type Flatpak struct {
	snack.Locker
}

Flatpak wraps the flatpak CLI.

func New

func New() *Flatpak

New returns a new Flatpak manager.

func (*Flatpak) AddRepo

func (f *Flatpak) AddRepo(ctx context.Context, repo snack.Repository) error

AddRepo adds a new remote.

func (*Flatpak) Autoremove

func (f *Flatpak) Autoremove(ctx context.Context, opts ...snack.Option) error

Autoremove removes unused runtimes and extensions.

func (*Flatpak) Available

func (f *Flatpak) Available() bool

Available reports whether flatpak is present on the system.

func (*Flatpak) Clean

func (f *Flatpak) Clean(ctx context.Context) error

Clean is a no-op for flatpak (no direct cache clean equivalent).

func (*Flatpak) Info

func (f *Flatpak) Info(ctx context.Context, pkg string) (*snack.Package, error)

Info returns details about a specific package.

func (*Flatpak) Install

func (f *Flatpak) Install(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)

Install one or more packages.

func (*Flatpak) IsInstalled

func (f *Flatpak) IsInstalled(ctx context.Context, pkg string) (bool, error)

IsInstalled reports whether a package is currently installed.

func (*Flatpak) LatestVersion added in v0.2.0

func (f *Flatpak) LatestVersion(ctx context.Context, pkg string) (string, error)

LatestVersion returns the latest available version of a flatpak.

func (*Flatpak) List

func (f *Flatpak) List(ctx context.Context) ([]snack.Package, error)

List returns all installed packages.

func (*Flatpak) ListRepos

func (f *Flatpak) ListRepos(ctx context.Context) ([]snack.Repository, error)

ListRepos returns all configured remotes.

func (*Flatpak) ListUpgrades added in v0.2.0

func (f *Flatpak) ListUpgrades(ctx context.Context) ([]snack.Package, error)

ListUpgrades returns flatpaks that have newer versions available.

func (*Flatpak) Name

func (f *Flatpak) Name() string

Name returns "flatpak".

func (*Flatpak) NormalizeName added in v0.3.0

func (f *Flatpak) NormalizeName(name string) string

NormalizeName returns the canonical form of a flatpak app ID.

func (*Flatpak) ParseArch added in v0.3.0

func (f *Flatpak) ParseArch(name string) (string, string)

ParseArch extracts the architecture from a flatpak reference if present.

func (*Flatpak) Purge

func (f *Flatpak) Purge(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) error

Purge removes packages including their data.

func (*Flatpak) Remove

func (f *Flatpak) Remove(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.RemoveResult, error)

Remove one or more packages.

func (*Flatpak) RemoveRepo

func (f *Flatpak) RemoveRepo(ctx context.Context, id string) error

RemoveRepo removes a configured remote.

func (*Flatpak) Search

func (f *Flatpak) Search(ctx context.Context, query string) ([]snack.Package, error)

Search queries for packages matching the query.

func (*Flatpak) Update

func (f *Flatpak) Update(ctx context.Context) error

Update is a no-op for flatpak (auto-refreshes).

func (*Flatpak) Upgrade

func (f *Flatpak) Upgrade(ctx context.Context, opts ...snack.Option) error

Upgrade all installed packages to their latest versions.

func (*Flatpak) UpgradeAvailable added in v0.2.0

func (f *Flatpak) UpgradeAvailable(ctx context.Context, pkg string) (bool, error)

UpgradeAvailable reports whether a newer version is available.

func (*Flatpak) UpgradePackages

func (f *Flatpak) UpgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Option) (snack.InstallResult, error)

UpgradePackages upgrades specific installed packages.

func (*Flatpak) Version

func (f *Flatpak) Version(ctx context.Context, pkg string) (string, error)

Version returns the installed version of a package.

func (*Flatpak) VersionCmp added in v0.2.0

func (f *Flatpak) VersionCmp(ctx context.Context, ver1, ver2 string) (int, error)

VersionCmp compares two version strings.

Jump to

Keyboard shortcuts

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