pkg

package
v0.0.0-...-d459dd1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pkg handles basic operations in the management of packages in operating systems.

Important

If you are going to use a package manager different to Deb, then you should check the options since I cann't test all.

TODO

Add managers of BSD systems.

Use flag to do not show questions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect() (PackageType, Packager, error)

Detect tries to get the package manager used in the system, looking for executables in directory "/usr/bin".

Types

type PackageType

type PackageType int

PackageType represents a package management system.

const (
	Deb PackageType = iota + 1
	RPM
	Pacman
	Ebuild
	ZYpp
)

type Packager

type Packager interface {
	// Install installs a program.
	Install(...string) error

	// Remove removes a program.
	Remove(bool, ...string) error

	// Purge removes a program and its config files.
	Purge(bool, ...string) error

	// Clean erases downloaded archive files.
	Clean() error

	// Upgrade upgrades all the packages on the system.
	Upgrade() error
}

func New

func New(p PackageType) Packager

New returns the interface to handle the package manager.

Jump to

Keyboard shortcuts

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