socketpath

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package socketpath resolves the unix-socket path that the daemon and its CLI clients agree on. Resolution order: explicit flag, AMBER_STORE_SOCKET env, then a platform default — $XDG_RUNTIME_DIR/amber-store.sock when XDG_RUNTIME_DIR is set and absolute (typical on Linux), otherwise /tmp/amber-store-<uid>.sock.

The fallback deliberately ignores TMPDIR: environments like nix-shell and direnv set a fresh per-shell TMPDIR, so a TMPDIR-derived default would make a daemon and a client started in different shells resolve different "default" paths and never rendezvous. /tmp is stable for every process of a user; the per-uid suffix keeps it from colliding across users, and the socket's file mode (no write permission for group/other) keeps other users from connecting.

Index

Constants

View Source
const EnvVar = "AMBER_STORE_SOCKET"

EnvVar is the environment variable that overrides the default socket path.

Variables

This section is empty.

Functions

func Resolve

func Resolve(flag string) string

Resolve returns the socket path given a possibly-empty flag value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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