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 ¶
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
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.