core

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProcessPath string

Functions

func AskConfirmation

func AskConfirmation(s string) bool

func CopyFile

func CopyFile(src, dst string) error

func CopyToUserTemp

func CopyToUserTemp(path string) (string, error)

func CreateApxTable

func CreateApxTable(writer io.Writer) *tablewriter.Table

func ExitIfOverlayTypeFS

func ExitIfOverlayTypeFS()

func IsOverlayTypeFS

func IsOverlayTypeFS() bool

func NewDbox

func NewDbox() (*dbox, error)

func PkgManagerExists

func PkgManagerExists(name string) bool

PkgManagerExists checks if the package manager exists.

func RootCheck

func RootCheck(display bool) bool

func StackExists

func StackExists(name string) bool

StackExists checks if a stack exists.

Types

type Apx

type Apx struct {
	Cnf *settings.Config
}

func NewApx

func NewApx(cnf *settings.Config) *Apx

func NewStandardApx

func NewStandardApx() *Apx

func (*Apx) CheckAndCreateApxStorageDirectory

func (a *Apx) CheckAndCreateApxStorageDirectory() error

func (*Apx) CheckAndCreateApxUserPkgManagersDirectory

func (a *Apx) CheckAndCreateApxUserPkgManagersDirectory() error

func (*Apx) CheckAndCreateUserStacksDirectory

func (a *Apx) CheckAndCreateUserStacksDirectory() error

func (*Apx) CheckContainerTools

func (a *Apx) CheckContainerTools() error

func (*Apx) EssentialChecks

func (a *Apx) EssentialChecks() error

type PkgManager

type PkgManager struct {
	// Model values:
	// 1: name will be used as the main command;
	// 2: each command is the whole command
	// Default: 2
	// DEPRECATION WARNING: Model 1 will be removed in the future, please
	// update your configuration files to use model 2.
	Model         int
	Name          string
	NeedSudo      bool
	CmdAutoRemove string
	CmdClean      string
	CmdInstall    string
	CmdList       string
	CmdPurge      string
	CmdRemove     string
	CmdSearch     string
	CmdShow       string
	CmdUpdate     string
	CmdUpgrade    string

	// BuiltIn:
	// If true, the package manager is built-in (stored in
	// /usr/share/apx/pkg-managers) and cannot be removed by the user
	BuiltIn bool
}

PkgManager represents a package manager in Apx, a set of instructions to handle a package manager.

func ListPkgManagers

func ListPkgManagers() []*PkgManager

ListPkgManagers lists all the package managers.

func LoadPkgManager

func LoadPkgManager(name string) (*PkgManager, error)

LoadPkgManager loads a package manager from the specified path.

func LoadPkgManagerFromPath added in v2.1.2

func LoadPkgManagerFromPath(path string) (*PkgManager, error)

LoadPkgManagerFromPath loads a package manager from the specified path.

func NewPkgManager

func NewPkgManager(name string, needSudo bool, autoRemove, clean, install, list, purge, remove, search, show, update, upgrade string, builtIn bool) *PkgManager

NewPkgManager creates a new PkgManager instance.

func (*PkgManager) Export added in v2.1.2

func (pkgManager *PkgManager) Export(path string) error

Export exports the package manager to the specified path.

func (*PkgManager) GenCmd

func (pkgManager *PkgManager) GenCmd(cmd string, args ...string) []string

GenCmd generates the command to run inside the container.

func (*PkgManager) Remove

func (pkgManager *PkgManager) Remove() error

Remove removes the package manager from the specified path.

func (*PkgManager) Save

func (pkgManager *PkgManager) Save() error

Save saves the package manager to the specified path.

type Stack

type Stack struct {
	Name       string
	Base       string
	Packages   []string
	PkgManager string
	BuiltIn    bool // If true, the stack is built-in (stored in /usr/share/apx/stacks) and cannot be removed by the user
}

Stack represents a stack in Apx, a set of instructions to build a container.

func ListStackForPkgManager

func ListStackForPkgManager(pkgManager string) []*Stack

ListStackForPkgManager returns a list of stacks for the specified package manager.

func ListStacks

func ListStacks() []*Stack

ListStacks returns a list of all stacks.

func LoadStack

func LoadStack(name string) (*Stack, error)

LoadStack loads a stack from the specified path.

func LoadStackFromPath

func LoadStackFromPath(path string) (*Stack, error)

LoadStackFromPath loads a stack from the specified path.

func NewStack

func NewStack(name, base string, packages []string, pkgManager string, builtIn bool) *Stack

NewStack creates a new Stack instance.

func (*Stack) Export

func (stack *Stack) Export(path string) error

Export exports the stack YAML to the specified path.

func (*Stack) GetPkgManager

func (stack *Stack) GetPkgManager() (*PkgManager, error)

GetPkgManager returns the package manager of the stack.

func (*Stack) Remove

func (stack *Stack) Remove() error

Remove removes the stack file.

func (*Stack) Save

func (stack *Stack) Save() error

Save saves the stack to a YAML file.

type SubSystem

type SubSystem struct {
	InternalName         string
	Name                 string
	Stack                *Stack
	Home                 string
	Status               string
	ExportedPrograms     map[string]map[string]string
	HasInit              bool
	IsManaged            bool
	IsRootfull           bool
	IsUnshared           bool
	HasNvidiaIntegration bool
}

func ListSubSystems

func ListSubSystems(includeManaged bool, includeRootFull bool) ([]*SubSystem, error)

func LoadSubSystem

func LoadSubSystem(name string, isRootFull bool) (*SubSystem, error)

func NewSubSystem

func NewSubSystem(name string, stack *Stack, home string, hasInit bool, isManaged bool, isRootfull bool, isUnshared bool, hasNvidiaIntegration bool) (*SubSystem, error)

func (*SubSystem) Create

func (s *SubSystem) Create() error

func (*SubSystem) Enter

func (s *SubSystem) Enter() error

func (*SubSystem) Exec

func (s *SubSystem) Exec(captureOutput, detachedMode bool, args ...string) (string, error)

func (*SubSystem) ExportBin

func (s *SubSystem) ExportBin(binary string, exportPath string) error

func (*SubSystem) ExportDesktopEntries

func (s *SubSystem) ExportDesktopEntries(args ...string) (int, error)

func (*SubSystem) ExportDesktopEntry

func (s *SubSystem) ExportDesktopEntry(appName string) error

func (*SubSystem) Remove

func (s *SubSystem) Remove() error

func (*SubSystem) Reset

func (s *SubSystem) Reset() error

func (*SubSystem) Start added in v2.1.2

func (s *SubSystem) Start() error

func (*SubSystem) Stop added in v2.1.2

func (s *SubSystem) Stop() error

func (*SubSystem) UnexportBin

func (s *SubSystem) UnexportBin(binary string, exportPath string) error

func (*SubSystem) UnexportDesktopEntries

func (s *SubSystem) UnexportDesktopEntries(args ...string) (int, error)

func (*SubSystem) UnexportDesktopEntry

func (s *SubSystem) UnexportDesktopEntry(appName string) error

Jump to

Keyboard shortcuts

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