Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ImagesDB is the database used to store image blobs.
ImagesDB = "osimages"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageFilter ¶
ImageFilter is used to query image metadata.
type Metadata ¶
type Metadata struct { ModelUUID string Series string Arch string Kind string Size int64 SHA256 string Created time.Time SourceURL string }
Metadata describes an image blob.
type Storage ¶
type Storage interface { // AddImage adds the image blob and metadata into state, // replacing existing metadata if any exists with the specified version. AddImage(io.Reader, *Metadata) error // DeleteImage deletes the image blob defined by metadata from state. DeleteImage(*Metadata) error // Image returns the Metadata and image blob contents // for the specified kind, series, arch if it exists, else an error // satisfying errors.IsNotFound. Image(kind, series, arch string) (*Metadata, io.ReadCloser, error) // ListImages returns the image metadata matching the specified filter. ListImages(filter ImageFilter) ([]*Metadata, error) }
Storage provides methods for storing and retrieving images by kind, series, and arch.
func NewStorage ¶
NewStorage constructs a new Storage that stores image blobs in an "osimages" database. Image metadata is also stored in this database in the "imagemetadata" collection.
Click to show internal directories.
Click to hide internal directories.