plugin

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotPlugin       = errors.New("target does not appear to be a valid plugin")
	ErrNotVolumePlugin = errors.New("plugin is not a volume plugin")
	ErrPluginRemoved   = errors.New("plugin is no longer available (shut down?)")
)

Functions

This section is empty.

Types

type VolumePlugin

type VolumePlugin struct {
	// Name is the name of the volume plugin. This will be used to refer to
	// it.
	Name string
	// SocketPath is the unix socket at which the plugin is accessed.
	SocketPath string
	// Client is the HTTP client we use to connect to the plugin.
	Client *http.Client
}

VolumePlugin is a single volume plugin.

func GetVolumePlugin

func GetVolumePlugin(name string, path string, timeout int) (*VolumePlugin, error)

GetVolumePlugin gets a single volume plugin, with the given name, at the given path.

func (*VolumePlugin) CreateVolume

func (p *VolumePlugin) CreateVolume(req *volume.CreateRequest) error

CreateVolume creates a volume in the plugin.

func (*VolumePlugin) GetVolume

func (p *VolumePlugin) GetVolume(req *volume.GetRequest) (*volume.Volume, error)

GetVolume gets a single volume from the plugin.

func (*VolumePlugin) GetVolumePath

func (p *VolumePlugin) GetVolumePath(req *volume.PathRequest) (string, error)

GetVolumePath gets the path the given volume is mounted at.

func (*VolumePlugin) ListVolumes

func (p *VolumePlugin) ListVolumes() ([]*volume.Volume, error)

ListVolumes lists volumes available in the plugin.

func (*VolumePlugin) MountVolume

func (p *VolumePlugin) MountVolume(req *volume.MountRequest) (string, error)

MountVolume mounts the given volume. The ID argument is the ID of the mounting container, used for internal record-keeping by the plugin. Returns the path the volume has been mounted at.

func (*VolumePlugin) RemoveVolume

func (p *VolumePlugin) RemoveVolume(req *volume.RemoveRequest) error

RemoveVolume removes a single volume from the plugin.

func (*VolumePlugin) UnmountVolume

func (p *VolumePlugin) UnmountVolume(req *volume.UnmountRequest) error

UnmountVolume unmounts the given volume. The ID argument is the ID of the container that is unmounting, used for internal record-keeping by the plugin.

Jump to

Keyboard shortcuts

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