system

package
v1.6.3-v1.27.5-k3s1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package system abstracts the filesystem layout of the system and exposes functions to copy and move files

Index

Constants

View Source
const (
	// DefaultRootDir represents where persistent installations are located
	DefaultRootDir = "/HAOS/system"
	// DefaultDataDir represents where persistent state is located
	DefaultDataDir = "/HAOS/data"
	// DefaultLocalDir represents where local, persistent configuration is located
	DefaultLocalDir = "/var/lib/1898andCo/haos"
	// DefaultStateDir represents where ephemeral state is located
	DefaultStateDir = "/run/HAOS"
)

Variables

View Source
var (
	AppFs = afero.NewOsFs()
)

Functions

func CopyComponent

func CopyComponent(src, dst string, remount bool, key string) (bool, error)

CopyComponent will copy the component identified by `key` from `src` to `dst`, moving the `current` symlink to the version from `src` (after renaming `current` to `previous`).

func DataPath

func DataPath(elem ...string) string

DataPath joins any number of elements into a single path underneath the persistent state root, by default `DefaultDataDir`

func LocalPath

func LocalPath(elem ...string) string

LocalPath joins any number of elements into a single path underneath the persistent configuration root, by default `DefaultLocalDir`

func RootPath

func RootPath(elem ...string) string

RootPath joins any number of elements into a single path underneath the persistent installation root, by default `DefaultRootDir`

func StatComponentVersion

func StatComponentVersion(root, key string, alias VersionName) (os.FileInfo, error)

StatComponentVersion will de-reference the version symlink for the component.

func StatePath

func StatePath(elem ...string) string

StatePath joins any number of elements into a single path underneath the ephemeral state root, by default `DefaultStateDir`

Types

type VersionName

type VersionName string
const (
	VersionCurrent  VersionName = "current"
	VersionPrevious VersionName = "previous"
)

Jump to

Keyboard shortcuts

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