pkg

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookBeforeUninstallAll = "before_uninstall_all"
	HookAfterUninstallAll  = "after_uninstall_all"
	HookBeforeUninstall    = "before_uninstall"
	HookAfterUninstall     = "after_uninstall"
	HookBeforeInstall      = "before_install"
	HookAfterInstall       = "after_install"
	HookBeforeInstallAll   = "before_install_all"
	HookAfterInstallAll    = "after_install_all"
)

Variables

View Source
var (
	ErrPackageInstalled    = errors.New("pkg: package installed")
	ErrPackageNotInstalled = errors.New("pkg: package not installed")
)

Functions

func Stow

func Stow(options StowOptions, pkgs ...Package) error

Types

type Loader

type Loader struct {
	State, Source, Target filesystem.Path
}

func (Loader) DefaultManifest

func (l Loader) DefaultManifest() Manifest

func (Loader) Load

func (l Loader) Load() (Package, error)

type Manifest

type Manifest struct {
	Name   string `toml:"name,omitempty"`
	Source string `toml:"source,omitempty"`
	Hooks  string `toml:"hooks,omitempty"`
}

type Package

type Package interface {
	Installed() (bool, error)
	Install() error
	Uninstall() error
	RunHookIfExists(name string) error
	Name() string
}

type StowOptions

type StowOptions struct {
	Delete bool
}

Jump to

Keyboard shortcuts

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