Documentation ¶
Index ¶
- type Ceph
- type DataStore
- type Image
- type ImageMap
- type ImageStore
- func (s *ImageStore) CreateImage(i Image) error
- func (s *ImageStore) DeleteImage(ID string) error
- func (s *ImageStore) GetAllImages() ([]Image, error)
- func (s *ImageStore) GetImage(ID string) (Image, error)
- func (s *ImageStore) Init(rawDs RawDataStore, metaDs MetaDataStore) error
- func (s *ImageStore) UpdateImage(i Image) error
- func (s *ImageStore) UploadImage(ID string, body io.Reader) error
- type MetaDataStore
- type MetaDs
- type Noop
- type Posix
- type RawDataStore
- type State
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ceph ¶
type Ceph struct { ImageTempDir string BlockDriver storage.CephDriver }
Ceph implements the DataStore interface for Ceph RBD based storage
func (*Ceph) GetImageSize ¶
GetImageSize returns the size, in bytes, of the block device
type DataStore ¶
type DataStore interface { Init(RawDataStore, MetaDataStore) error CreateImage(Image) error GetAllImages() ([]Image, error) GetImage(string) (Image, error) UpdateImage(Image) error DeleteImage(string) error UploadImage(string, io.Reader) error }
DataStore is the image data storage interface.
type Image ¶
type Image struct { ID string State State TenantID string Name string CreateTime time.Time Type Type Size uint64 }
Image contains the information that ciao will store about the image
func (Image) Visibility ¶
func (i Image) Visibility() image.Visibility
Visibility returns the image visibility
type ImageMap ¶
ImageMap provide Image empty struct generator and mutex control
func (*ImageMap) NewElement ¶
func (i *ImageMap) NewElement() interface{}
NewElement generates a new Image struct
type ImageStore ¶
type ImageStore struct { ImageMap // contains filtered or unexported fields }
ImageStore is an image metadata cache.
func (*ImageStore) CreateImage ¶
func (s *ImageStore) CreateImage(i Image) error
CreateImage will add an image to the datastore.
func (*ImageStore) DeleteImage ¶
func (s *ImageStore) DeleteImage(ID string) error
DeleteImage will delete an existing image.
func (*ImageStore) GetAllImages ¶
func (s *ImageStore) GetAllImages() ([]Image, error)
GetAllImages gets returns all the known images.
func (*ImageStore) GetImage ¶
func (s *ImageStore) GetImage(ID string) (Image, error)
GetImage returns the image specified by the ID string.
func (*ImageStore) Init ¶
func (s *ImageStore) Init(rawDs RawDataStore, metaDs MetaDataStore) error
Init initializes the datastore struct and must be called before anything.
func (*ImageStore) UpdateImage ¶
func (s *ImageStore) UpdateImage(i Image) error
UpdateImage will modify an existing image.
func (*ImageStore) UploadImage ¶
func (s *ImageStore) UploadImage(ID string, body io.Reader) error
UploadImage will read an image, save it and update the image cache.
type MetaDataStore ¶
type MetaDataStore interface { Write(Image) error Delete(ID string) error Get(ID string) (Image, error) GetAll() ([]Image, error) }
MetaDataStore is the metadata storing interface that's used by image cache implementation.
type MetaDs ¶
type MetaDs struct { database.DbProvider DbDir string DbFile string }
MetaDs implements the DataStore interface for persistent data
type Noop ¶
type Noop struct { }
Noop is a Datastore implementation that does nothing. Use it only for development and testing purposes, data will not be persistent with the Noop Datastore interface.
func (*Noop) GetAll ¶
GetAll is the noop image metadata get all images implementation. It drops data.
func (*Noop) GetImageSize ¶
GetImageSize is the noop image implementation of image size querying
type Posix ¶
type Posix struct {
MountPoint string
}
Posix implements the DataStore interface for posix filesystems
func (*Posix) GetImageSize ¶
GetImageSize obtains the image size from the underlying filesystem
type RawDataStore ¶
type RawDataStore interface { Write(ID string, body io.Reader) error Delete(ID string) error GetImageSize(ID string) (uint64, error) }
RawDataStore is the raw data storage interface that's used by the image cache implementation.
type State ¶
type State string
State represents the state of the image.
const ( // Created means that an empty image has been created Created State = "created" // Saving means the image is being saved Saving State = "saving" // Active means that the image is created, uploaded and ready to use. Active State = "active" // Killed means that an image data upload error occurred. Killed State = "killed" )