Docker Volume Plugin Handler https://godoc.org/go.pedge.io/dockervolume
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmd/dockervolume
example/cmd/dockervolume-example
LICENSE
Makefile
README.md
api_server.go
circle.yml
dockervolume.go
dockervolume.pb.go
dockervolume.pb.gw.go
dockervolume.proto
dockervolume_test.go
volume_driver_client.go

README.md

CircleCI Go Report Card GoDoc MIT License

A small library taking care of the generic code for docker volume plugins written in Go.

This libary was originally inspired by https://github.com/calavera/dkvolume.

Note that most of my work now is going toward the Open Storage Project, however this package is basically feature complete for the current docker volume plugin API.

Usage

Note the custom URL:

go get go.pedge.io/dockervolume/...

And for imports:

import (
  "go.pedge.io/dockervolume"
)

All public functionality is exposed in the dockervolume.go file and the generated dockervolume.pb.go file.

Also see https://go.pedge.io/dockerplugin.

Your volume plugin must implement the VolumeDriver interface.

The API in this package exposes additional functionality on top of the docker volume plugin API. See dockervolume.proto for more details.

To launch your plugin using Unix sockets, do:

func launch(volumeDriver dockervolume.VolumeDriver) error {
  return dockervolume.NewUnixServer(
    volumeDriver,
    "volume_driver_name",
    "root",
    dockervolume.ServerOptions{},
  ).Serve()
}

To launch your plugin using TCP, do:

func launch(volumeDriver dockervolume.VolumeDriver) error {
  return dockervolume.NewTCPServer(
    volumeDriver,
    "volume_driver_name",
    "address",
    dockervolume.ServerOptions{},
  ).Serve()
}

Examples