dockerdriver

package module
v0.0.0-...-a68c794 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 61

README

dockerdriver

This repo contains a server/client skeleton and the interfaces to to implement a docker volume driver server for use with Diego's volume manager.

Reporting issues and requesting features

Please report all issues and feature requests in cloudfoundry/diego-release.

Development

  • To run the tests, run go run github.com/onsi/ginkgo/v2/ginkgo -r, go test, or ginkgo -r if you have Ginkgo installed.
  • To re-generate the test fakes, run go generate.

Documentation

Index

Constants

View Source
const (
	ActivateRoute     = "activate"
	CreateRoute       = "create"
	GetRoute          = "get"
	ListRoute         = "list"
	MountRoute        = "mount"
	PathRoute         = "path"
	RemoveRoute       = "remove"
	UnmountRoute      = "unmount"
	CapabilitiesRoute = "capabilities"
)

Variables

View Source
var Routes = rata.Routes{
	{Path: "/Plugin.Activate", Method: "POST", Name: ActivateRoute},
	{Path: "/VolumeDriver.Create", Method: "POST", Name: CreateRoute},
	{Path: "/VolumeDriver.Get", Method: "POST", Name: GetRoute},
	{Path: "/VolumeDriver.List", Method: "POST", Name: ListRoute},
	{Path: "/VolumeDriver.Mount", Method: "POST", Name: MountRoute},
	{Path: "/VolumeDriver.Path", Method: "POST", Name: PathRoute},
	{Path: "/VolumeDriver.Remove", Method: "POST", Name: RemoveRoute},
	{Path: "/VolumeDriver.Unmount", Method: "POST", Name: UnmountRoute},
	{Path: "/VolumeDriver.Capabilities", Method: "POST", Name: CapabilitiesRoute},
}

Functions

func WriteDriverSpec

func WriteDriverSpec(logger lager.Logger, pluginsDirectory string, driver string, extension string, contents []byte) error

Types

type ActivateResponse

type ActivateResponse struct {
	Err        string
	Implements []string
}

type CapabilitiesResponse

type CapabilitiesResponse struct {
	Capabilities CapabilityInfo
}

type CapabilityInfo

type CapabilityInfo struct {
	Scope string
}

type CreateRequest

type CreateRequest struct {
	Name string
	Opts map[string]interface{}
}

type Driver

type Driver interface {
	Activate(env Env) ActivateResponse
	Get(env Env, getRequest GetRequest) GetResponse
	List(env Env) ListResponse
	Mount(env Env, mountRequest MountRequest) MountResponse
	Path(env Env, pathRequest PathRequest) PathResponse
	Unmount(env Env, unmountRequest UnmountRequest) ErrorResponse
	Capabilities(env Env) CapabilitiesResponse

	Provisioner
}

type DriverSpec

type DriverSpec struct {
	Name            string     `json:"Name"`
	Address         string     `json:"Addr"`
	TLSConfig       *TLSConfig `json:"TLSConfig"`
	UniqueVolumeIds bool       `json:"UniqueVolumeIds"`
}

func ReadDriverSpec

func ReadDriverSpec(logger lager.Logger, specName string, driverPath string, specFile string) (*DriverSpec, error)

type Env

type Env interface {
	Logger() lager.Logger
	Context() context.Context
}

type ErrorResponse

type ErrorResponse struct {
	Err string
}

type GetRequest

type GetRequest struct {
	Name string
}

type GetResponse

type GetResponse struct {
	Volume VolumeInfo
	Err    string
}

type ListResponse

type ListResponse struct {
	Volumes []VolumeInfo
	Err     string
}

type MatchableDriver

type MatchableDriver interface {
	Matches(lager.Logger, string, *TLSConfig) bool

	Driver
}

type MountRequest

type MountRequest struct {
	Name string
}

type MountResponse

type MountResponse struct {
	Err        string
	Mountpoint string
}

type PathRequest

type PathRequest struct {
	Name string
}

type PathResponse

type PathResponse struct {
	Err        string
	Mountpoint string
}

type Provisioner

type Provisioner interface {
	Create(env Env, createRequest CreateRequest) ErrorResponse
	Remove(env Env, removeRequest RemoveRequest) ErrorResponse
}

type RemoveRequest

type RemoveRequest struct {
	Name string
}

type SafeError

type SafeError struct {
	SafeDescription string `json:"SafeDescription"`
}

func (SafeError) Error

func (s SafeError) Error() string

type TLSConfig

type TLSConfig struct {
	InsecureSkipVerify bool   `json:"InsecureSkipVerify"`
	CAFile             string `json:"CAFile"`
	CertFile           string `json:"CertFile"`
	KeyFile            string `json:"KeyFile"`
}

type UnmountRequest

type UnmountRequest struct {
	Name string
}

type VolumeInfo

type VolumeInfo struct {
	Name       string
	Mountpoint string
	MountCount int
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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