fake

package
v17.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FakeStorageDriverName = "fake"
	FakePoolAttribute     = "pool"
)

Variables

This section is empty.

Functions

func NewFakeStorageDriverConfigJSON

func NewFakeStorageDriverConfigJSON(
	name string,
	protocol config.Protocol,
	pools map[string]*FakeStoragePool,
) (string, error)

Types

type FakeStorageDriver

type FakeStorageDriver struct {
	Config FakeStorageDriverConfig

	// DestroyedVolumes is here so that tests can check whether destroy
	// has been called on a volume during or after bootstrapping, since
	// different driver instances with the same config won't actually share
	// state.
	DestroyedVolumes map[string]bool
	// contains filtered or unexported fields
}

func (*FakeStorageDriver) Attach

func (d *FakeStorageDriver) Attach(name, mountpoint string, opts map[string]string) error

func (*FakeStorageDriver) Create

func (d *FakeStorageDriver) Create(name string, sizeBytes uint64, opts map[string]string) error

func (*FakeStorageDriver) CreateClone

func (d *FakeStorageDriver) CreateClone(name, source, snapshot string, opts map[string]string) error

func (*FakeStorageDriver) Destroy

func (d *FakeStorageDriver) Destroy(name string) error

func (*FakeStorageDriver) Detach

func (d *FakeStorageDriver) Detach(name, mountpoint string) error

func (*FakeStorageDriver) Get

func (d *FakeStorageDriver) Get(name string) error

func (*FakeStorageDriver) Initialize

func (d *FakeStorageDriver) Initialize(
	context dvp.DriverContext, configJSON string, commonConfig *dvp.CommonStorageDriverConfig,
) error

func (*FakeStorageDriver) List

func (d *FakeStorageDriver) List() ([]string, error)

func (*FakeStorageDriver) Name

func (d *FakeStorageDriver) Name() string

func (*FakeStorageDriver) SnapshotList

func (d *FakeStorageDriver) SnapshotList(name string) ([]dvp.CommonSnapshot, error)

func (*FakeStorageDriver) Validate

func (d *FakeStorageDriver) Validate(context dvp.DriverContext) error

type FakeStorageDriverConfig

type FakeStorageDriverConfig struct {
	*dvp.CommonStorageDriverConfig
	Protocol config.Protocol `json:"protocol"`
	// pools represents the possible buckets into which a given volume should go
	Pools        map[string]*FakeStoragePool `json:"pools"`
	InstanceName string                      `json:"instanceName"`
}

type FakeStoragePool

type FakeStoragePool struct {
	Attrs map[string]sa.Offer `json:"attributes"`
	Bytes uint64              `json:"sizeBytes"`
}

func (*FakeStoragePool) UnmarshalJSON

func (p *FakeStoragePool) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler and allows FakeStoragePool to be unmarshaled with the Attrs map correctly defined.

type FakeVolume

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

Jump to

Keyboard shortcuts

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