mock

package
v1.5.2-dev Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockDataStore

type MockDataStore struct {
	object.DatastorePath
	// contains filtered or unexported fields
}

func NewMockDataStore

func NewMockDataStore(images map[url.URL]map[string]*image.Image) *MockDataStore

func (*MockDataStore) CreateImageStore

func (c *MockDataStore) CreateImageStore(op trace.Operation, storeName string) (*url.URL, error)

func (*MockDataStore) DeleteImage

func (c *MockDataStore) DeleteImage(op trace.Operation, image *image.Image) (*image.Image, error)

DeleteImage removes an image from the image store

func (*MockDataStore) DeleteImageStore

func (c *MockDataStore) DeleteImageStore(op trace.Operation, storeName string) error

func (*MockDataStore) Export

func (m *MockDataStore) Export(op trace.Operation, child, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)

func (*MockDataStore) GetImage

func (c *MockDataStore) GetImage(op trace.Operation, store *url.URL, ID string) (*image.Image, error)

GetImage gets the specified image from the given store by retreiving it from the cache.

func (*MockDataStore) GetImageLayerStorageUsage

func (c *MockDataStore) GetImageLayerStorageUsage(op trace.Operation, storeName, ID string) (int64, error)

func (*MockDataStore) GetImageStorageUsage

func (c *MockDataStore) GetImageStorageUsage(op trace.Operation, storeName string) (int64, error)

func (*MockDataStore) GetImageStore

func (c *MockDataStore) GetImageStore(op trace.Operation, storeName string) (*url.URL, error)

GetImageStore checks to see if a named image store exists and returls the URL to it if so or error.

func (*MockDataStore) Import

func (m *MockDataStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, tarstream io.ReadCloser) error

func (*MockDataStore) ListImageStores

func (c *MockDataStore) ListImageStores(op trace.Operation) ([]*url.URL, error)

func (*MockDataStore) ListImages

func (c *MockDataStore) ListImages(op trace.Operation, store *url.URL, IDs []string) ([]*image.Image, error)

ListImages resturns a list of Images for a list of IDs, or all if no IDs are passed

func (*MockDataStore) NewDataSink

func (m *MockDataStore) NewDataSink(op trace.Operation, id string) (storage.DataSink, error)

func (*MockDataStore) NewDataSource

func (m *MockDataStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)

func (*MockDataStore) Owners

func (c *MockDataStore) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)

func (*MockDataStore) SetCreateImageStoreError

func (c *MockDataStore) SetCreateImageStoreError(err error)

SetCreateImageStoreError injects an error to be returned on next call to CreateImageStore

func (*MockDataStore) SetWriteImageError

func (c *MockDataStore) SetWriteImageError(err error)

SetWriteImageError injects an error to be returned on next call to WriteImage

func (*MockDataStore) URL

func (c *MockDataStore) URL(op trace.Operation, id string) (*url.URL, error)

func (*MockDataStore) WriteImage

func (c *MockDataStore) WriteImage(op trace.Operation, parent *image.Image, ID string, meta map[string][]byte, sum string, r io.Reader) (*image.Image, error)

func (*MockDataStore) WriteMetadata

func (c *MockDataStore) WriteMetadata(op trace.Operation, storeName string, ID string, meta map[string][]byte) error

Jump to

Keyboard shortcuts

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