utils

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
		" ██████╗ ██████╗ ███╗   ███╗██████╗  █████╗ \n" +
		"██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔══██╗\n" +
		"██║     ██║   ██║██╔████╔██║██████╔╝███████║\n" +
		"██║     ██║   ██║██║╚██╔╝██║██╔═══╝ ██╔══██║\n" +
		"╚██████╗╚██████╔╝██║ ╚═╝ ██║██║     ██║  ██║\n" +
		" ╚═════╝ ╚═════╝ ╚═╝     ╚═╝╚═╝     ╚═╝  ╚═╝\n" +
		colorReset
)
View Source
const KernelName = "compa-kernel"

KernelName is the name of the harness executable the shell supervises. The kernel ships under this one name, beside the shell or on its own.

Variables

This section is empty.

Functions

func ApplyLauncherProcAttrs

func ApplyLauncherProcAttrs(_ *exec.Cmd)

ApplyLauncherProcAttrs is a no-op on non-Windows platforms.

func EnsureOnboarded

func EnsureOnboarded(configPath string) error

func FindKernelBinary

func FindKernelBinary() string

FindKernelBinary locates the compa-kernel executable. Search order:

  1. COMPA_BINARY environment variable (explicit override)
  2. Same directory as the current executable
  3. Falls back to "compa-kernel" and relies on $PATH

func GetDefaultConfigPath

func GetDefaultConfigPath() string

GetDefaultConfigPath returns the default path to the Compa config file.

func GetGlobalIPv6s

func GetGlobalIPv6s() []string

GetGlobalIPv6s returns all IPv6 global unicast addresses.

func GetHome

func GetHome() string

GetHome returns the Compa home directory. Priority: $COMPA_HOME > ~/.compa

func GetLocalIPv4

func GetLocalIPv4() string

GetLocalIPv4 returns the first non-loopback local IPv4 address.

func GetLocalIPv4s

func GetLocalIPv4s() []string

GetLocalIPv4s returns all non-loopback local IPv4 addresses.

func GetLocalIPv6

func GetLocalIPv6() string

GetLocalIPv6 returns the first IPv6 global unicast address.

func KernelBinaryName

func KernelBinaryName() string

KernelBinaryName returns the kernel's executable file name on this platform.

func LauncherExecCommand

func LauncherExecCommand(name string, args ...string) *exec.Cmd

LauncherExecCommand creates an exec.Cmd. On non-Windows platforms, this is a simple wrapper around exec.Command.

func OpenBrowser

func OpenBrowser(url string) error

OpenBrowser automatically opens the given URL in the default browser. The opener is waited for in the background, so it never lingers as a zombie.

Types

This section is empty.

Jump to

Keyboard shortcuts

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