Documentation ¶
Index ¶
- Variables
- type NameLookupCache
- func (c *NameLookupCache) CreateImageStore(op trace.Operation, storeName string) (*url.URL, error)
- func (c *NameLookupCache) DeleteBranch(op trace.Operation, img *image.Image, keepNodes []*url.URL) ([]*image.Image, error)
- func (c *NameLookupCache) DeleteImage(op trace.Operation, img *image.Image) (*image.Image, error)
- func (c *NameLookupCache) Export(op trace.Operation, store *url.URL, id, ancestor string, ...) (io.ReadCloser, error)
- func (c *NameLookupCache) GetImage(op trace.Operation, store *url.URL, ID string) (*image.Image, error)
- func (c *NameLookupCache) GetImageStore(op trace.Operation, storeName string) (*url.URL, error)
- func (c *NameLookupCache) ImageStorageUsage() int64
- func (c *NameLookupCache) Import(op trace.Operation, store *url.URL, diskID string, spec *archive.FilterSpec, ...) error
- func (c *NameLookupCache) ListImageStores(op trace.Operation) ([]*url.URL, error)
- func (c *NameLookupCache) ListImages(op trace.Operation, store *url.URL, IDs []string) ([]*image.Image, error)
- func (c *NameLookupCache) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
- func (c *NameLookupCache) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)
- func (c *NameLookupCache) SetImageStorageUsage(value int64)
- func (c *NameLookupCache) URL(op trace.Operation, id string) (*url.URL, error)
- func (c *NameLookupCache) UpdateStorageUsage(op trace.Operation, store *url.URL, id string) error
- func (c *NameLookupCache) WriteImage(op trace.Operation, parent *image.Image, ID string, meta map[string][]byte, ...) (*image.Image, error)
Constants ¶
This section is empty.
Variables ¶
var ErrCorruptImageStore = errors.New("Corrupt image store")
Functions ¶
This section is empty.
Types ¶
type NameLookupCache ¶
type NameLookupCache struct { // The image store implementation. This mutates the actual disk images. DataStore image.ImageStorer // contains filtered or unexported fields }
NameLookupCache the global view of all of the image stores. To avoid unnecessary lookups, the image cache keeps an in memory map of the store URI to the map of images on disk.
func NewLookupCache ¶
func NewLookupCache(ds image.ImageStorer) *NameLookupCache
func (*NameLookupCache) CreateImageStore ¶
func (*NameLookupCache) DeleteBranch ¶
func (c *NameLookupCache) DeleteBranch(op trace.Operation, img *image.Image, keepNodes []*url.URL) ([]*image.Image, error)
DeleteBranch deletes a branch of images, starting from nodeID, up to the first node with degree greater than 1. keepNodes is the array of images to keep (and their branches).
func (*NameLookupCache) DeleteImage ¶
DeleteImage deletes an image from the image store. If it is in use or is being inheritted from, then this will return an error.
func (*NameLookupCache) Export ¶
func (c *NameLookupCache) Export(op trace.Operation, store *url.URL, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
func (*NameLookupCache) GetImage ¶
func (c *NameLookupCache) 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 (*NameLookupCache) GetImageStore ¶
GetImageStore checks to see if a named image store exists and returns the URL to it if so or error.
func (*NameLookupCache) ImageStorageUsage ¶
func (c *NameLookupCache) ImageStorageUsage() int64
func (*NameLookupCache) Import ¶
func (c *NameLookupCache) Import(op trace.Operation, store *url.URL, diskID string, spec *archive.FilterSpec, tarStream io.ReadCloser) error
func (*NameLookupCache) ListImageStores ¶
ListImageStores returns a list of strings representing all existing image stores
func (*NameLookupCache) ListImages ¶
func (c *NameLookupCache) ListImages(op trace.Operation, store *url.URL, IDs []string) ([]*image.Image, error)
ListImages returns a list of Images for a list of IDs, or all if no IDs are passed
func (*NameLookupCache) NewDataSource ¶
func (c *NameLookupCache) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
func (*NameLookupCache) Owners ¶
func (c *NameLookupCache) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)
func (*NameLookupCache) SetImageStorageUsage ¶
func (c *NameLookupCache) SetImageStorageUsage(value int64)