docker

package
v0.0.0-...-da19d2a Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Root for mount
	Root       string
	MountPoint string
	// Address and config for ssh
	SSHServer string
	SSHConfig *ssh.ClientConfig
}

Config configures the docker volume plugin

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver implements the interface for a Docker volume plugin

func New

func New(config Config) (*Driver, error)

New instantiates a new driver and returns it

func (*Driver) Capabilities

func (d *Driver) Capabilities() *volume.CapabilitiesResponse

Capabilities Driver

func (*Driver) Create

func (d *Driver) Create(r *volume.CreateRequest) error

Create handles volume creation calls

func (*Driver) Get

Get retrieves a volume

func (*Driver) List

func (d *Driver) List() (*volume.ListResponse, error)

List mounted volumes

func (*Driver) Mount

Mount handles creating and mounting servers

func (*Driver) Path

Path handles calls for mountpoints

func (*Driver) Remove

func (d *Driver) Remove(r *volume.RemoveRequest) error

Remove handles volume removal calls

func (*Driver) Stop

func (d *Driver) Stop() []error

Stop stops all the servers

func (*Driver) Unmount

func (d *Driver) Unmount(r *volume.UnmountRequest) error

Unmount handles unmounting (but not removing) servers

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server wraps SSHFS and tracks connection counts

func NewServer

func NewServer(config *ssh.ClientConfig, mountpoint, server, root string) (*Server, error)

NewServer returns a new server with initial state

func (*Server) Mount

func (s *Server) Mount() error

Mount mounts the wrapped FS on a given mountpoint. It also starts watching for errors, which it will log.

func (*Server) Unmount

func (s *Server) Unmount() error

Unmount stops the wrapped FS. It returns the last error that it sees, but will log any others it receives.

Jump to

Keyboard shortcuts

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