| .. | ||
| 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.Driverinterface. - Initialize a
volume.Handlerwith your implementation. - Call either
ServeTCPorServeUnixfrom 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)