Package plugins provides structures and helper functions to manage Docker plugins.
Docker discovers plugins by looking for them in the plugin directory whenever a user or container tries to use one by name. UNIX domain socket files must be located under /run/docker/plugins, whereas spec files can be located either under /etc/docker/plugins or /usr/lib/docker/plugins. This is handled by the Registry interface, which lets you list all plugins or get a plugin by its name if it exists.
The plugins need to implement an HTTP server and bind this to the UNIX socket or the address specified in the spec files. A handshake is send at /Plugin.Activate, and plugins are expected to return a Manifest with a list of Docker subsystems which this plugin implements.
In order to use a plugins, you can use the `Get` with the name of the plugin and the subsystem it implements.
plugin, err := plugins.Get("example", "VolumeDriver") if err != nil { return fmt.Errorf("Error looking up volume plugin example: %v", err) }
const ProtocolSchemeHTTPV1 = "moby.plugins.http/v1"
ProtocolSchemeHTTPV1 is the name of the protocol used for interacting with plugins using this package.
VersionMimetype is the Content-Type the engine sends to plugins.
ErrNotFound plugin not found
ErrNotImplements is returned if the plugin does not implement the requested driver.
func Handle ΒΆHandle adds the specified function to the extpointHandlers.
IsNotFound indicates if the passed in error is from an http.StatusNotFound from the plugin
SpecsPaths returns paths in which to look for plugins, in order of priority.
On Windows:
On Unix in non-rootless mode:
On Unix in rootless-mode:
WithRequestTimeout sets a timeout duration for plugin requests
Client represents a plugin client.
NewClient creates a new plugin client (http).
NewClientWithTimeout creates a new plugin client (http).
Call calls the specified method with the specified arguments for the plugin. It will retry for 30 seconds if a failure occurs when calling.
CallWithOptions is just like call except it takes options
SendFile calls the specified method, and passes through the IO stream
Stream calls the specified method with the specified arguments for the plugin and returns the response body
type LocalRegistry struct { }
LocalRegistry defines a registry that is local (using unix socket).
GetAll returns all the plugins for the specified implementation
Plugin returns the plugin registered with the given name (or returns an error).
Scan scans all the plugin paths and returns all the names it found
type Manifest struct { Implements []string }
Manifest lists what a plugin implements.
Plugin is the definition of a docker plugin.
Get returns the plugin given the specified name and requested implementation.
NewLocalPlugin creates a new local plugin.
Client returns a ready-to-use plugin client that can be used to communicate with the plugin.
IsV1 returns true for V1 plugins and false otherwise.
Name returns the name of the plugin.
Protocol returns the protocol name/version used for plugins in this package.
ScopedPath returns the path scoped to the plugin's rootfs. For v1 plugins, this always returns the path unchanged as v1 plugins run directly on the host.
RequestOpts is the set of options that can be passed into a request
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4