DockerCLI/cli-plugins
Brian Goff d68cc0e8d0
plugin: closer-based plugin notification socket
This changes things to rely on a plugin server that manages all
connections made to the server.

An optional handler can be passed into the server when the caller wants
to do extra things with the connection.

It is the caller's responsibility to close the server.
When the server is closed, first all existing connections are closed
(and new connections are prevented).

Now the signal loop only needs to close the server and not deal with
`net.Conn`'s directly (or double-indirects as the case was before this
change).

The socket, when present in the filesystem, is no longer unlinked
eagerly, as reconnections require it to be present for the lifecycle of
the plugin server.

Co-authored-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
2024-03-21 15:08:19 -06:00
..
examples/helloworld cli-plugins: helloworld: rename var that collided with import 2024-01-11 22:25:15 +01:00
manager plugins: fix encoding for OTEL env var passed to plugin 2024-02-28 12:43:07 -08:00
plugin cli-plugins: move socket code into common package 2024-01-12 11:49:25 -07:00
socket plugin: closer-based plugin notification socket 2024-03-21 15:08:19 -06:00