config

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEndpoint

func DefaultEndpoint() string

DefaultEndpoint returns the per-platform default daemon endpoint. Windows talks to a daemon running inside WSL2 over loopback TCP; other platforms use a local Unix socket.

func DefaultPath

func DefaultPath() string

DefaultPath returns the default config file location (~/.jerboa/config.toml).

func ResolveEndpoint

func ResolveEndpoint(override string) string

ResolveEndpoint determines the daemon endpoint using the precedence: explicit override > JERBOA_HOST env var > config file > platform default. override carries the value of an explicit CLI flag (empty if unset).

func ResolveToken

func ResolveToken() string

ResolveToken returns the client auth token: the JERBOA_AUTH_TOKEN environment variable takes precedence over the config file's [daemon] token. Empty means no authentication.

func Save

func Save(path string, cfg *Config) error

Save writes cfg to path, creating parent directories as needed.

Types

type Config

type Config struct {
	Hypervisor string       `toml:"hypervisor"`
	Daemon     DaemonConfig `toml:"daemon"`
}

Config holds global jerboa configuration stored at ~/.jerboa/config.toml.

func Load

func Load(path string) (*Config, error)

Load reads the config file at path. Returns defaults if the file does not exist.

type DaemonConfig

type DaemonConfig struct {
	// Endpoint is the daemon address (e.g. unix:///var/run/jerboad.sock or
	// tcp://127.0.0.1:7890). Empty falls back to the per-platform default.
	Endpoint string `toml:"endpoint"`
	// Distro is the WSL2 distribution to host the daemon on Windows. Empty uses
	// the WSL default distro.
	Distro string `toml:"distro"`
	// JerboadPath is the jerboad binary path inside the WSL distro. Empty resolves
	// "jerboad" on the distro's PATH.
	JerboadPath string `toml:"jerboad_path"`
	// Token is the shared secret sent to the daemon via the Auth.Hello
	// handshake. Overridden by the JERBOA_AUTH_TOKEN environment variable.
	Token string `toml:"token"`
}

DaemonConfig holds client-side daemon connection settings.

Jump to

Keyboard shortcuts

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