All Projects → peter-edge → Dockervolume Go

peter-edge / Dockervolume Go

Licence: mit
Docker Volume Plugin Handler https://godoc.org/go.pedge.io/dockervolume

Programming Languages

go
31211 projects - #10 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].