Docker provides extensibility through a plugin system, of which several types are available. This provides an initial library API for communicating with one type of plugins, volume plugins. Volume plugins allow for an external service to create and manage a volume on Podman's behalf. This does not integrate the plugin system into Libpod or Podman yet; that will come in subsequent pull requests. Signed-off-by: Matthew Heon <mheon@redhat.com> |
||
---|---|---|
.. | ||
README.md | ||
api.go |
README.md
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)