package
0.0.0-20240701071450-45e2431495c8
Repository: https://github.com/docker/go-plugins-helpers.git
Documentation: pkg.go.dev
# README
Docker volume extension api.
Go handler to create external volume extensions for Docker.
Usage
This library is designed to be integrated in your program.
- Implement the
volume.Driver
interface. - Initialize a
volume.Handler
with your implementation. - Call either
ServeTCP
orServeUnix
from thevolume.Handler
.
Example using TCP sockets:
d := MyVolumeDriver{}
h := volume.NewHandler(d)
h.ServeTCP("test_volume", ":8080")
Example using Unix sockets:
d := MyVolumeDriver{}
h := volume.NewHandler(d)
u, _ := user.Lookup("root")
gid, _ := strconv.Atoi(u.Gid)
h.ServeUnix("test_volume", gid)
Full example plugins
# Packages
No description provided by the author
# Functions
NewErrorResponse creates an ErrorResponse with the provided message.
NewHandler initializes the request handler with a driver implementation.
# Constants
DefaultDockerRootDirectory is the default directory where volumes will be created.
# Structs
CapabilitiesResponse structure for a volume capability response.
Capability represents the list of capabilities a volume driver can return.
CreateRequest is the structure that docker's requests are deserialized to.
ErrorResponse is a formatted error message that docker can understand.
GetRequest structure for a volume get request.
GetResponse structure for a volume get response.
Handler forwards requests and responses between the docker daemon and the plugin.
ListResponse structure for a volume list response.
MountRequest structure for a volume mount request.
MountResponse structure for a volume mount response.
PathRequest structure for a volume path request.
PathResponse structure for a volume path response.
RemoveRequest structure for a volume remove request.
UnmountRequest structure for a volume unmount request.
Volume represents a volume object for use with `Get` and `List` requests.
# Interfaces
Driver represent the interface a driver must fulfill.