Documentation ¶
Index ¶
- func DecodeRecoveryToken(recoverytoken string) []string
- func EncodeRecoveryToken(data ...string) string
- func Exists(path string) bool
- func ExtractOCIImage(img v1.Image, targetDestination string) error
- func FindCommand(def string, options []string) string
- func Flavor() string
- func GetCurrentPlatform() string
- func GetEfiGrubFiles(arch string) []string
- func GetEfiShimFiles(arch string) []string
- func GetImage(targetImage, targetPlatform string, auth *registrytypes.AuthConfig, ...) (v1.Image, error)
- func GetInit() string
- func GetInterfaceIP(in string) string
- func GetOCIImageSize(targetImage, targetPlatform string, auth *registrytypes.AuthConfig, ...) (int64, error)
- func IsOpenRCBased() bool
- func K0sBin() string
- func K3sBin() string
- func ListOutput(rels []string, output string) []string
- func ListToOutput(rels []string, output string) []string
- func MkdirAll(fs sdkTypes.KairosFS, name string, mode os.FileMode) (err error)
- func Name() string
- func OSRelease(key string, file ...string) (string, error)
- func OnSignal(fn func(), sig ...os.Signal)
- func PowerOFF()
- func PrintBanner(d []byte)
- func Prompt(t string) (string, error)
- func RandStringRunes(n int) string
- func Reboot()
- func SH(c string) (string, error)
- func SHInDir(c, dir string, envs ...string) (string, error)
- func SetEnv(env []string)
- func Shell() *exec.Cmd
- func ShellSTDIN(s, c string) (string, error)
- func SystemdBootConfReader(filePath string) (map[string]string, error)
- func UUID() string
- func WriteEnv(envFile string, config map[string]string) error
- type CleanJob
- type CleanStack
- type KeyNotFoundErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeRecoveryToken ¶ added in v0.0.2
func EncodeRecoveryToken ¶ added in v0.0.2
func ExtractOCIImage ¶ added in v0.0.3
ExtractOCIImage will extract a given targetImage into a given targetDestination
func FindCommand ¶
func GetCurrentPlatform ¶ added in v0.0.3
func GetCurrentPlatform() string
GetCurrentPlatform returns the current platform in docker style `linux/amd64` for use with image utils
func GetEfiGrubFiles ¶ added in v0.0.22
GetEfiGrubFiles Return possible paths for the grub.efi Used in enki and agent
func GetEfiShimFiles ¶ added in v0.0.22
GetEfiShimFiles Return possible paths for the shim.efi Used in enki and agent
func GetImage ¶ added in v0.0.17
func GetImage(targetImage, targetPlatform string, auth *registrytypes.AuthConfig, t http.RoundTripper) (v1.Image, error)
GetImage if returns the proper image to pull with transport and auth tries local daemon first and then fallbacks into remote if auth is nil, it will try to use the default keychain https://github.com/google/go-containerregistry/tree/main/pkg/authn#tldr-for-consumers-of-this-package
func GetInterfaceIP ¶ added in v0.0.2
func GetOCIImageSize ¶ added in v0.0.12
func GetOCIImageSize(targetImage, targetPlatform string, auth *registrytypes.AuthConfig, t http.RoundTripper) (int64, error)
func IsOpenRCBased ¶ added in v0.0.2
func IsOpenRCBased() bool
func ListOutput ¶ added in v0.0.2
func ListToOutput ¶ added in v0.0.2
func OSRelease ¶
OSRelease finds the value of the specified key in the /etc/kairos-release file As a fallback on the /etc/os-release or, if a second argument is passed, on the file specified by the second argument. (optionally file argument is there for testing reasons).
func PrintBanner ¶ added in v0.0.2
func PrintBanner(d []byte)
func RandStringRunes ¶ added in v0.0.2
func ShellSTDIN ¶ added in v0.0.2
func SystemdBootConfReader ¶ added in v0.0.25
SystemdBootConfReader reads a systemd-boot conf file and returns a map with the key/value pairs
Types ¶
type CleanStack ¶ added in v0.0.10
type CleanStack struct {
// contains filtered or unexported fields
}
CleanStack is a basic LIFO stack that resizes as needed.
func NewCleanStack ¶ added in v0.0.10
func NewCleanStack() *CleanStack
NewCleanStack returns a new stack. It's used to push jobs into it that need to be executed in order, like unmounting disks or removing dirs, and it will run those jobs in the order they were pushed into it to maintain order So you can create a dir, push its removal into the stack, mount something into that dir and push its unmounting into the stack and when cleanup is triggered it will first unmount and then remove the dir Usually its setup inside a function with a defer immediately so it auto cleans if you return from anywhere in the function That way you don't need to track on each return what needs to be cleaned and whatnot cleanup := utils.NewCleanStack() defer func() { err = cleanup.Cleanup(err) }()
func (*CleanStack) Cleanup ¶ added in v0.0.10
func (clean *CleanStack) Cleanup(err error) error
Cleanup runs the whole cleanup stack. In case of error it runs all jobs and returns the first error occurrence.
func (*CleanStack) Pop ¶ added in v0.0.10
func (clean *CleanStack) Pop() CleanJob
Pop removes and returns a node from the stack in last to first order.
func (*CleanStack) Push ¶ added in v0.0.10
func (clean *CleanStack) Push(job CleanJob)
Push adds a node to the stack
type KeyNotFoundErr ¶ added in v0.0.20
type KeyNotFoundErr struct {
Err error
}
func (KeyNotFoundErr) Error ¶ added in v0.0.20
func (err KeyNotFoundErr) Error() string