dockervol

package
v4.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

(c) Copyright 2017 Hewlett Packard Enterprise Development LP

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	//ActivateURI is /Plugin.Activate
	ActivateURI = "/Plugin.Activate"
	//CreateURI is /VolumeDriver.Create
	CreateURI = "/VolumeDriver.Create"
	//UpdateURI = "/VolumeDriver.Update"
	UpdateURI = "/VolumeDriver.Update"
	//ListURI is /VolumeDriver.List
	ListURI = "/VolumeDriver.List"
	//CapabilitiesURI is /VolumeDriver.Capabilities
	CapabilitiesURI = "/VolumeDriver.Capabilities"
	//RemoveURI is /VolumeDriver.Remove
	RemoveURI = "/VolumeDriver.Remove"
	//MountURI is /VolumeDriver.Mount
	MountURI = "/VolumeDriver.Mount"
	//UnmountURI is /VolumeDriver.Unmount
	UnmountURI = "/VolumeDriver.Unmount"
	//GetURI is /VolumeDriver.Get
	GetURI = "/VolumeDriver.Get"
	//NotFound describes the beginning of the not found error message
	NotFound = "Unable to find"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CapResponse

type CapResponse struct {
	Capabilities PluginCapabilities `json:"Capabilities,omitempty"`
}

CapResponse describes the capabilities of the plugin

type DockerVolume

type DockerVolume struct {
	Name       string                 `json:"Name,omitempty"`
	Mountpoint string                 `json:"Mountpoint,omitempty"`
	Status     map[string]interface{} `json:"Status,omitempty"`
}

DockerVolume represents the details about a docker volume

type DockerVolumePlugin

type DockerVolumePlugin struct {
	ListOfStorageResourceOptions []string
	FactorForConversion          int
	// contains filtered or unexported fields
}

DockerVolumePlugin is the client to a specific docker volume plugin

func NewDockerVolumePlugin

func NewDockerVolumePlugin(options *Options) (*DockerVolumePlugin, error)

NewDockerVolumePlugin creates a DockerVolumePlugin which can be used to communicate with a Docker Volume Plugin. options.socketPath can be the full path to the socket file or the name of a Docker V2 plugin. In the case of the V2 plugin, the name of th plugin is used to look up the full path to the socketfile.

func (*DockerVolumePlugin) Capabilities

func (dvp *DockerVolumePlugin) Capabilities() (*CapResponse, error)

Capabilities returns the capabilities supported by the plugin

func (*DockerVolumePlugin) Create

func (dvp *DockerVolumePlugin) Create(name string, options map[string]interface{}) (string, error)

Create a docker volume returning the docker volume name nolint Create and Update have same signature. For maintaining backward compatibility we need these two definitions

func (*DockerVolumePlugin) Delete

func (dvp *DockerVolumePlugin) Delete(name string, managerName string) error

Delete calls the delete function of the plugin

func (*DockerVolumePlugin) Get

func (dvp *DockerVolumePlugin) Get(name string) (*GetResponse, error)

Get a docker volume by docker name returning the response from the driver

func (*DockerVolumePlugin) List

func (dvp *DockerVolumePlugin) List() (*GetListResponse, error)

List the docker volumes returning the response from the driver

func (*DockerVolumePlugin) Mount

func (dvp *DockerVolumePlugin) Mount(name, mountID string) (string, error)

Mount attaches and mounts a nimble volume returning the path

func (*DockerVolumePlugin) Unmount

func (dvp *DockerVolumePlugin) Unmount(name, mountID string) error

Unmount and detaches volume for maxTries

func (*DockerVolumePlugin) Update

func (dvp *DockerVolumePlugin) Update(name string, options map[string]interface{}) (string, error)

Update the docker volumes nolint Create and Update have same signature. For maintaining backward compatibility we need these two definitions

type Errorer

type Errorer interface {
	// contains filtered or unexported methods
}

Errorer describes the ability get the embedded error

type GetListResponse

type GetListResponse struct {
	Volumes []DockerVolume `json:"Volumes,omitempty"`
	Err     string         `json:"Err,omitempty"`
}

GetListResponse is returned from the volume driver list request

type GetResponse

type GetResponse struct {
	Volume DockerVolume `json:"Volume,omitempty"`
	Err    string       `json:"Err,omitempty"`
}

GetResponse is returned from the volume driver

type MountRequest

type MountRequest struct {
	Name string `json:"Name,omitempty"`
	ID   string `json:"ID,omitempty"`
}

MountRequest is used to mount and unmount volumes

type MountResponse

type MountResponse struct {
	Mountpoint string `json:"Mountpoint,omitempty"`
	Err        string `json:"Err,omitempty"`
}

MountResponse is returned from the volume driver

type Options

type Options struct {
	SocketPath                   string
	StripK8sFromOptions          bool
	LogFilePath                  string
	Debug                        bool
	CreateVolumes                bool
	ListOfStorageResourceOptions []string
	FactorForConversion          int
	SupportsCapabilities         bool
}

Options for volumedriver

type PluginCapabilities

type PluginCapabilities struct {
	Scope string `json:"Scope,omitempty"`
}

PluginCapabilities includes the scope of the plugin

type Request

type Request struct {
	Name string                 `json:"Name,omitempty"`
	Opts map[string]interface{} `json:"Opts,omitempty"`
}

Request is the basic request to use when talking to the driver

Jump to

Keyboard shortcuts

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