socket

package
v29.9.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 9 Imported by: ? 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

Index

Constants

View Source
const EnvKey = "DOCKER_CLI_PLUGIN_SOCKET"

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

Variables

This section is empty.

Functions

func ConnectAndWait

func ConnectAndWait(cb func())

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

Types

type PluginServer

type PluginServer struct {
	// contains filtered or unexported fields
}

func NewPluginServer

func NewPluginServer(h func(net.Conn)) (*PluginServer, error)

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

func (*PluginServer) Addr

func (pl *PluginServer) Addr() net.Addr

Addr returns the net.Addr of the underlying net.Listener.

func (*PluginServer) Close

func (pl *PluginServer) Close() error

Close ensures that the server is no longer accepting new connections and closes all existing connections. Existing connections will receive io.EOF.

The error value is that of the underlying net.Listener.Close call.

Jump to

Keyboard shortcuts

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