godnf

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 8 Imported by: 0

README

Golang DNF Client

A go client for interacting with Red Hat/Fedora's DNF (Dandified Yum) package manager.


Features

  • Install packages from the repositories
  • Update the system to the latest package versions
  • Remove packages and their dependencies
  • Search for packages by name or description
  • Obtain the dependencies of a package
  • List installed packages

Contributions

Contributions are welcome! Please fork this repository and submit a pull request with your changes.

License

This project is licensed under the MIT License.

See LICENSE for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectdnfBinary

func DetectdnfBinary() (string, error)

Function used to find the dnf binary in the system.

func DnfBinaryFrom

func DnfBinaryFrom(path string) (string, error)

Types

type Dnf

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

Dnf represents the DNF client.

func New

func New(binaryPath string) *Dnf

Returns a new godnf value, which represents an initialized DNF client.

func (*Dnf) Depends

func (a *Dnf) Depends(packageName string, opt *Options) ([]Package, error)

Obtains a list of dependencies from a packageName.

func (*Dnf) Install

func (a *Dnf) Install(packageName string, opt *Options) error

Install a dnf package from its packageName.

func (*Dnf) List

func (a *Dnf) List(opt *Options) error

List all installed packages.

func (*Dnf) Remove

func (a *Dnf) Remove(packageName string, opt *Options) error

Remove a package from its packageName.

func (*Dnf) Search

func (a *Dnf) Search(packageName string, opt *Options) error

Search a package from its packageName.

func (*Dnf) Update

func (a *Dnf) Update(packageName string, opt *Options) error

Update a packages from is packageName. If packageName is empty, updates all the packages in the system.

type Options

type Options struct {
	Verbose      bool
	DryRun       bool
	Output       io.Writer
	NotAssumeYes bool
	DestDir      string
}

Options represents the configuration options for the running command.

type Package

type Package struct {
	Name    string
	Version string
	Path    string
}

Package represents a DNF package.

Jump to

Keyboard shortcuts

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