utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 27 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRecoveryToken added in v0.0.2

func DecodeRecoveryToken(recoverytoken string) []string

func EncodeRecoveryToken added in v0.0.2

func EncodeRecoveryToken(data ...string) string

func Exists

func Exists(path string) bool

func ExtractOCIImage added in v0.0.3

func ExtractOCIImage(targetImage, targetDestination, targetPlatform string, isLocal bool) error

ExtractOCIImage will extract a given targetImage into a given targetDestination and pull from the local repo if set.

func FindCommand

func FindCommand(def string, options []string) string

func Flavor added in v0.0.2

func Flavor() string

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 GetInterfaceIP added in v0.0.2

func GetInterfaceIP(in string) string

func IsOpenRCBased added in v0.0.2

func IsOpenRCBased() bool

func K3sBin added in v0.0.2

func K3sBin() string

func ListOutput added in v0.0.2

func ListOutput(rels []string, output string) []string

func ListToOutput added in v0.0.2

func ListToOutput(rels []string, output string) []string

func Name added in v0.0.2

func Name() string

func OSRelease

func OSRelease(key string) (string, error)

func OnSignal added in v0.0.2

func OnSignal(fn func(), sig ...os.Signal)

func PowerOFF added in v0.0.2

func PowerOFF()

func PrintBanner added in v0.0.2

func PrintBanner(d []byte)

func Prompt added in v0.0.2

func Prompt(t string) (string, error)

func RandStringRunes added in v0.0.2

func RandStringRunes(n int) string

func Reboot added in v0.0.2

func Reboot()

func SH

func SH(c string) (string, error)

func SHInDir

func SHInDir(c, dir string, envs ...string) (string, error)

func SetEnv added in v0.0.2

func SetEnv(env []string)

func Shell added in v0.0.2

func Shell() *exec.Cmd

func ShellSTDIN added in v0.0.2

func ShellSTDIN(s, c string) (string, error)

func UUID

func UUID() string

UUID TODO: move this into a machine submodule

func Version added in v0.0.2

func Version() string

func WriteEnv added in v0.0.2

func WriteEnv(envFile string, config map[string]string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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