ospkg

package
v0.0.0-...-dd6cbca Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(pkg string) string

Clean checks the string pkg and returns the package name. Everything up to the first _ is the package name after the scheme (https:// or http://). If the string is an absolute path, the base is returned as the package name. On error the pkg is returned as-is.

Types

type ArchLinuxManager

type ArchLinuxManager struct{}

ArchLinuxManager manages packages on Arch Linux.

func (*ArchLinuxManager) Install

func (p *ArchLinuxManager) Install(pkg, version string) (bool, error)

func (*ArchLinuxManager) Setup

func (p *ArchLinuxManager) Setup() error

func (*ArchLinuxManager) Unitfile

func (p *ArchLinuxManager) Unitfile(pkg string) (string, error)

type DebianManager

type DebianManager struct{}

DebianManager manages packages on Debian.

func (*DebianManager) Install

func (p *DebianManager) Install(pkg, version string) (bool, error)

func (*DebianManager) Unitfile

func (p *DebianManager) Unitfile(pkg string) (string, error)

type Manager

type Manager interface {
	// Install install the given package at the given version, the returned boolean is true.
	// Does nothing if package is already installed, in this case the returned boolean is false.
	Install(pkg, version string) (bool, error)
	// Unitfile returns the location of the unitfile for the given package
	// Returns an error if no unitfiles were found
	Unitfile(pkg string) (string, error)
}

Manager represents OS package management.

type NoopManager

type NoopManager struct{}

NoopManager implements a no-op of the Manager interface. Its purpose is to enable scenarios where no package handling is required, i.e. the necessary executables are already available on the host.

func (*NoopManager) Install

func (p *NoopManager) Install(pkg, version string) (bool, error)

func (*NoopManager) Setup

func (p *NoopManager) Setup() error

func (*NoopManager) Unitfile

func (p *NoopManager) Unitfile(pkg string) (string, error)

Jump to

Keyboard shortcuts

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