installer

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPackageMapping

func AddPackageMapping(mapping PackageMapping) error

AddPackageMapping adds a new package mapping

func GetPackageManagerName

func GetPackageManagerName(pmType types.PackageManagerType) string

GetPackageManagerName returns the display name for a package manager type

func GetPackageManagerType

func GetPackageManagerType(installerInst Installer) types.PackageManagerType

GetPackageManagerType returns the PackageManagerType for a given installer

func GetPackageName

func GetPackageName(pkg string, pmType types.PackageManagerType) (string, error)

GetPackageName returns the package name for a given package and package manager

func InstallPackage

func InstallPackage(ctx context.Context, pkg string) error

InstallPackage installs a package using the best available package manager

func InstallPackages

func InstallPackages(ctx context.Context, packages []string) error

InstallPackages installs multiple packages using the best available package manager

Types

type Installer

type Installer = types.Installer

Installer is an alias for types.Installer for backward compatibility

func DetectPackageManager

func DetectPackageManager() (Installer, error)

DetectPackageManager detects the best available package manager for the current system

type PackageMapping

type PackageMapping struct {
	Name        string
	Description string
	Packages    map[types.PackageManagerType]string
}

PackageMapping defines a mapping for a package across different package managers

func GetAllPackageMappings

func GetAllPackageMappings() []PackageMapping

GetAllPackageMappings returns all package mappings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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