system

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package system contains some helpers for working with operating-system package management.

Currently only Debian GNU/Linux systems are supported, but that might change.

Index

Constants

View Source
const (
	YUM    = "YUM"
	DEBIAN = "DEBIAN"
)

Known-system types

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

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

Package maintains our object state

func New

func New() *Package

New creates a new instance of this object, attempting to identify the system during the initial phase.

func (*Package) Install

func (p *Package) Install(name []string) error

Install a single package to the system.

func (*Package) IsInstalled

func (p *Package) IsInstalled(name string) (bool, error)

IsInstalled checks a package installed?

func (*Package) IsKnown

func (p *Package) IsKnown() bool

IsKnown reports whether this system is using a known packaging-system.

func (*Package) System

func (p *Package) System() string

System returns the O/S we've identified

func (*Package) Uninstall

func (p *Package) Uninstall(name []string) error

Uninstall a single package from the system.

func (*Package) Update

func (p *Package) Update() error

Update carries out the update command for a given system

func (*Package) UsePrivilegeHelper added in v0.19.0

func (p *Package) UsePrivilegeHelper(cmd string)

UsePrivilegeHelper is used to ensure that all executed commands are prefixed with "sudo ..", "doas ..", or similar.

Jump to

Keyboard shortcuts

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