{"modulePath":"github.com/Docker/cli","version":"v29.10.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package socket\n\n## Constants\n\n```go\nconst EnvKey = \"DOCKER_CLI_PLUGIN_SOCKET\"\n```\nEnvKey represents the well-known environment variable used to pass the plugin being executed the socket name it should listen on to coordinate with the host CLI.\n\n## Functions\n\n```go\nfunc ConnectAndWait(cb func())\n```\nConnectAndWait connects to the socket passed via well-known env var, if present, and attempts to read from it until it receives an EOF, at which point cb is called.\n\n## Types\n\n```go\ntype PluginServer struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPluginServer(h func(net.Conn)) (*PluginServer, error)\n```\nNewPluginServer creates a plugin server that listens on a new Unix domain socket. h is called for each new connection to the socket in a goroutine.\n\n```go\nfunc (pl *PluginServer) Addr() net.Addr\n```\nAddr returns the [net.Addr](/net#Addr) of the underlying [net.Listener](/net#Listener).\n\n```go\nfunc (pl *PluginServer) Close() error\n```\nClose ensures that the server is no longer accepting new connections and closes all existing connections. Existing connections will receive [io.EOF](/io#EOF).\n\nThe error value is that of the underlying [net.Listener.Close](/net#Listener.Close) call.\n\n","path":"github.com/Docker/cli/cli-plugins/socket","name":"socket","synopsis":"","isRedistributable":true}
