socket

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package socket defines the addressing contract for the proxy's local unix socket. UnixPath derives the path once, from the upstream host:port, and the caller hands that same value to both the proxy, which listens on it, and the dialer, which connects to it. It depends on no other internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnixPath

func UnixPath(hostPort string) (string, error)

UnixPath derives a stable, absolute unix socket path for hostPort, placed under os.TempDir(). It is deterministic for a given hostPort within a process, so a caller that derives it once and passes the same string to both the listener and the dialer never has the two disagree. It returns an error when the resulting path would exceed the platform's sun_path limit, rather than letting the OS silently truncate it (which would break that agreement).

func ValidatePath added in v0.5.0

func ValidatePath(path string) error

ValidatePath returns an error when path would exceed the platform's sun_path limit. Callers that supply their own socket path instead of deriving one with UnixPath use it to fail fast rather than at bind time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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