paths

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package paths centralizes the local API file names so the server and the CLI client agree without the client importing the server package (which would pull node internals into the thin client).

Index

Constants

View Source
const (
	// SocketFileName is the UDS path inside the data directory.
	SocketFileName = "api.sock"
	// TokenFileName is the bearer token path inside the data directory.
	TokenFileName = "api.token"
	// EndpointFileName is the optional loopback-TCP discovery document.
	EndpointFileName = "api.endpoint.json"

	// DarwinSocketPathLimit is the longest usable sockaddr_un.sun_path value on
	// macOS: the 104-byte field includes the terminating NUL.
	DarwinSocketPathLimit = 103
	// LinuxSocketPathLimit is the longest usable sockaddr_un.sun_path value on
	// Linux: the 108-byte field includes the terminating NUL.
	LinuxSocketPathLimit = 107
)

Variables

This section is empty.

Functions

func EndpointPath

func EndpointPath(dataDir string) string

EndpointPath returns <dataDir>/api.endpoint.json.

func SocketPath

func SocketPath(dataDir string) string

SocketPath returns <dataDir>/api.sock.

func SocketPathLimit

func SocketPathLimit() int

SocketPathLimit returns the platform's sockaddr_un.sun_path limit.

func TokenPath

func TokenPath(dataDir string) string

TokenPath returns <dataDir>/api.token.

func ValidateSocketPath

func ValidateSocketPath(sockPath string) error

ValidateSocketPath rejects a UDS path the kernel cannot represent. The error names the path, its byte length, the platform limit and the fix so callers do not surface the opaque "connect: invalid argument" failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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