mobydriver

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

mobydriver

PkgGoDev License build and test goroutines Coverage

mobydriver is a small convenience wrapper around Docker's/Moby's github.com/docker/go-plugins-helpers, providing handlers that finally have context.Context-aware ServeUnix and Serve methods.

This module does not support Windows external plugin driver handlers.

DevContainer

[!CAUTION]

Do not use VSCode's "Dev Containers: Clone Repository in Container Volume" command, as it is utterly broken by design, ignoring .devcontainer/devcontainer.json.

  1. git clone https://github.com/thediveo/mobydriver
  2. in VSCode: Ctrl+Shift+P, "Dev Containers: Open Workspace in Container..."
  3. select mobydriver.code-workspace and off you go...

Supported Go Versions

mobydriver supports versions of Go that are noted by the Go release policy, that is, major versions N and N-1 (where N is the current major version).

Contributing

Please see CONTRIBUTING.md.

mobydriver is Copyright 2026 Harald Albrecht, and licensed under the Apache License, Version 2.0.

Documentation

Overview

Package mobydriver is a friendly wrapper around Docker's go-plugins-helpers' skd.Handler providing a context.Context-aware ServeUnix method.

Index

Constants

View Source
const PluginSocketDir = "/run/docker/plugins"

PluginSocketDir is the path to the directory containing Docker plugin API unix domain sockets.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Handler interface {
		ServeUnix(addr string, gid int) error
	}
}

Handler wraps Docker's go-plugin-helpers sdk.Handler objects.

func (*Handler) Serve

func (h *Handler) Serve(ctx context.Context, l net.Listener) error

Serve sets up the handler to serve requests on the passed-in listener, stopping when the passed-in context gets cancelled.

func (*Handler) ServeUnix

func (h *Handler) ServeUnix(ctx context.Context, pluginname string, gid int) error

ServeUnix creates a handler that then listens for requests on the plugin's API unix domain socket. It also creates the socket file in the Docker plugins directory where the Docker/Moby engine finds it.

It basically mirrors the Docker plugin helper's sdk.Handler.ServeUnix, but giving us a chance to gracefully shut down the plugin's HTTP server.

Directories

Path Synopsis
Package ipam provides a context.Context-aware Docker IPAM driver plugin handler.
Package ipam provides a context.Context-aware Docker IPAM driver plugin handler.
Package network provides a context.Context-aware Docker network driver plugin handler.
Package network provides a context.Context-aware Docker network driver plugin handler.
Package secrets provides a context.Context-aware Docker secrets driver plugin handler.
Package secrets provides a context.Context-aware Docker secrets driver plugin handler.
Package volume provides a context.Context-aware Docker volume driver plugin handler.
Package volume provides a context.Context-aware Docker volume driver plugin handler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL