api

package
v0.0.0-...-17ed7cf Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequiresRoot          = errors.New("operation requires root")
	ErrUnsupportedInit       = errors.New("unknown init system")
	ErrDaemonDoesNotExist    = errors.New("daemon does not exist")
	ErrUnknownDirectory      = errors.New("init system uses unknown init scripts directory")
	ErrUnsupportedInitOutput = errors.New("init system produced unknown output")
)

Functions

func Exec

func Exec(command string) error

func FileContains

func FileContains(fileContent string, content string) bool

func Find

func Find(regex string, fileContent string) ([]int, error)

func FindAll

func FindAll(regex string, fileContent string) ([][]int, error)

func GetEnv

func GetEnv(variableName string) string

func GetProperLines

func GetProperLines(regex string, fileContent string) ([]string, error)

func GetRandomLetters

func GetRandomLetters(length int) string

func InstallPackages

func InstallPackages(packageStrings ...string) error

func RemoveComments

func RemoveComments(fileContent, singleLineStart, multiLineStart, multiLineEnd string) string

func RemovePackages

func RemovePackages(packagesToRemove ...string) error

func ShellCommand

func ShellCommand(script string) (string, error)

func Sleep

func Sleep(milliseconds int)

Types

type AurPackage

type AurPackage struct {
	Name    string
	Depends []string
}

type AurResponseLayout

type AurResponseLayout struct {
	Results []AurPackage
}

type CreateConfigOptions

type CreateConfigOptions struct {
	Optional   bool
	Options    string
	ConfigType vrctFs.FileType
}

type Daemon

type Daemon struct {
	Name      string
	IsActive  bool
	IsEnabled bool
	RunLevel  string
}

func GetDaemon

func GetDaemon(daemonName string) (Daemon, error)

type DaemonApi

type DaemonApi struct {
	ImportLoopData *shared.ImportLoopData
}

func (*DaemonApi) DisableDaemon

func (s *DaemonApi) DisableDaemon(daemonName string) error

func (*DaemonApi) EnableDaemon

func (s *DaemonApi) EnableDaemon(daemonName string) error

func (*DaemonApi) RestartDaemon

func (s *DaemonApi) RestartDaemon(daemonName string) error

func (*DaemonApi) StartDaemon

func (s *DaemonApi) StartDaemon(daemonName string) error

func (*DaemonApi) StopDaemon

func (s *DaemonApi) StopDaemon(daemonName string) error

type DirData

type DirData struct {
	IsDir bool
	Path  string
}

type Distro

type Distro struct {
	Name    string
	Version string
}

func GetDistro

func GetDistro() Distro

type FsApi

type FsApi struct {
	FsVRCT *vrctFs.VRCTFs
}

func (*FsApi) Apply

func (f *FsApi) Apply() (int, error)

func (*FsApi) CompareConfigs

func (f *FsApi) CompareConfigs(received, desired []byte, configType uint) error

func (*FsApi) Copy

func (f *FsApi) Copy(from, to string) error

func (*FsApi) CreateConfig

func (f *FsApi) CreateConfig(path, content string, options CreateConfigOptions) error

func (*FsApi) CreateFile

func (f *FsApi) CreateFile(path, content string, optional bool) error

func (*FsApi) FileExists

func (f *FsApi) FileExists(path string, isDirectory bool) bool

func (*FsApi) PathExists

func (f *FsApi) PathExists(path string) bool

func (*FsApi) ReadDir

func (f *FsApi) ReadDir(path string) ([]DirData, error)

func (*FsApi) ReadFile

func (f *FsApi) ReadFile(path string) (string, error)

func (*FsApi) UpdateConfig

func (f *FsApi) UpdateConfig(path, content string, options CreateConfigOptions) error

type GitApi

type GitApi struct {
	FsVrct *vrctFs.VRCTFs
}

func (*GitApi) GitClone

func (g *GitApi) GitClone(repoUrl, destinationPath string) error

type InitSystem

type InitSystem string
const (
	SYSTEMD InitSystem = "systemd"
	RUNIT   InitSystem = "runit"
	OPENRC  InitSystem = "openrc"
	/*
		lack of sysv, s6 and 66
	*/
	UNKNOWN InitSystem = ""
)

func GetInitSystem

func GetInitSystem() (InitSystem, error)

func (InitSystem) String

func (is InitSystem) String() string

type Package

type Package struct {
	Name          string
	Version       string
	Description   string
	Architecture  string
	URL           string
	Licenses      []string
	Groups        []string
	Provides      []string
	DependsOn     []string
	OptionalDeps  []string
	RequiredBy    []string
	OptionalFor   []string
	ConflictsWith []string
	Replaces      []string
	InstalledSize []string
	Packager      string
	BuildDate     string
	InstallDate   string
	InstallReason string
	InstallScript bool
	ValidatedBy   string
}

func GetPackage

func GetPackage(name string) (Package, error)

Jump to

Keyboard shortcuts

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