docker: github.com/docker/docker/volume/testutils Index | Files

package testutils

import "github.com/docker/docker/volume/testutils"

Index

Package Files

testutils.go

func FakeRefs Uses

func FakeRefs(p plugingetter.CompatPlugin) int

FakeRefs checks ref count on a fake plugin.

func MakeFakePlugin Uses

func MakeFakePlugin(d volume.Driver, l net.Listener) (plugingetter.CompatPlugin, error)

MakeFakePlugin creates a fake plugin from the passed in driver Note: currently only "Create" is implemented because that's all that's needed so far. If you need it to test something else, add it here, but probably you shouldn't need to use this except for very specific cases with v2 plugin handling.

func NewFakeDriver Uses

func NewFakeDriver(name string) volume.Driver

NewFakeDriver creates a new FakeDriver with the specified name

func NewFakePluginGetter Uses

func NewFakePluginGetter(pls ...plugingetter.CompatPlugin) plugingetter.PluginGetter

NewFakePluginGetter returns a plugin getter for fake plugins

func NewFakeVolume Uses

func NewFakeVolume(name string, driverName string) volume.Volume

NewFakeVolume creates a new fake volume for testing

type FakeDriver Uses

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

FakeDriver is a driver that generates fake volumes

func (*FakeDriver) Create Uses

func (d *FakeDriver) Create(name string, opts map[string]string) (volume.Volume, error)

Create initializes a fake volume. It returns an error if the options include an "error" key with a message

func (*FakeDriver) Get Uses

func (d *FakeDriver) Get(name string) (volume.Volume, error)

Get gets the volume

func (*FakeDriver) List Uses

func (d *FakeDriver) List() ([]volume.Volume, error)

List lists the volumes

func (*FakeDriver) Name Uses

func (d *FakeDriver) Name() string

Name is the name of the driver

func (*FakeDriver) Remove Uses

func (d *FakeDriver) Remove(v volume.Volume) error

Remove deletes a volume.

func (*FakeDriver) Scope Uses

func (*FakeDriver) Scope() string

Scope returns the local scope

type FakeVolume Uses

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

FakeVolume is a fake volume with a random name

func (FakeVolume) CreatedAt Uses

func (f FakeVolume) CreatedAt() (time.Time, error)

CreatedAt provides the time the volume (directory) was created at

func (FakeVolume) DriverName Uses

func (f FakeVolume) DriverName() string

DriverName is the name of the driver

func (FakeVolume) Mount Uses

func (FakeVolume) Mount(_ string) (string, error)

Mount mounts the volume in the container

func (FakeVolume) Name Uses

func (f FakeVolume) Name() string

Name is the name of the volume

func (FakeVolume) Path Uses

func (FakeVolume) Path() string

Path is the filesystem path to the volume

func (FakeVolume) Status Uses

func (FakeVolume) Status() map[string]interface{}

Status provides low-level details about the volume

func (FakeVolume) Unmount Uses

func (FakeVolume) Unmount(_ string) error

Unmount unmounts the volume from the container

type NoopVolume Uses

type NoopVolume struct{}

NoopVolume is a volume that doesn't perform any operation

func (NoopVolume) CreatedAt Uses

func (NoopVolume) CreatedAt() (time.Time, error)

CreatedAt provides the time the volume (directory) was created at

func (NoopVolume) DriverName Uses

func (NoopVolume) DriverName() string

DriverName is the name of the driver

func (NoopVolume) Mount Uses

func (NoopVolume) Mount(_ string) (string, error)

Mount mounts the volume in the container

func (NoopVolume) Name Uses

func (NoopVolume) Name() string

Name is the name of the volume

func (NoopVolume) Path Uses

func (NoopVolume) Path() string

Path is the filesystem path to the volume

func (NoopVolume) Status Uses

func (NoopVolume) Status() map[string]interface{}

Status provides low-level details about the volume

func (NoopVolume) Unmount Uses

func (NoopVolume) Unmount(_ string) error

Unmount unmounts the volume from the container

Package testutils imports 9 packages (graph). Updated 2018-07-04. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).