image

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	// Id of the image. Normally the digest of image config.
	ID string
	// Other names by which this image is known.
	RepoTags []string
	// Digests by which this image is known.
	RepoDigests []string
	// Size is the compressed size of the image.
	Size int64
	// ImageType is the unikernel type of this image.
	ImageType string
	// Digest is the image tar file's digest, only used for check whether two image is same one.
	Digest godigest.Digest
	// Copies are all image file copy for the image, indexed by image digest or sandbox uuid.
	Copies map[string]Storage
}

Image contains all resources associated with the image.

type ImageFormat

type ImageFormat int
const (
	UNKNOWN ImageFormat = iota
	QCOW2
	RAW
	KERNEL_INITRD
	LINUXKIT_YML
)

type Storage

type Storage struct {
	// UUID is the unique identifier, either generated or binded sandbox's UUID
	UUID string
	// Format is the format of this image
	Format ImageFormat
	// ImageFile is the location of qcow2/raw/kernel/linuxkit_yaml format image file.
	ImageFile string
	// Initrd is the location of image's initrd part
	Initrd string
	// Cmdline is the content of image's cmdline
	Cmdline string
}

Storage is the storage metadata of a image copy.

type Store

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

Store stores all images.

func LoadStore

func LoadStore() *Store

LoadStore loads images from disk. TODO(Crazykev): Implement LoadStore.

func NewStore

func NewStore() *Store

NewStore creates an image store.

func (*Store) Add

func (s *Store) Add(img Image)

Add an image into the store.

func (*Store) Delete

func (s *Store) Delete(id string) error

Delete deletes the image with specified id.

func (*Store) Get

func (s *Store) Get(id string) (Image, error)

Get returns the image with specified id. Returns store.ErrNotExist if the image doesn't exist.

func (*Store) List

func (s *Store) List() []Image

List lists all images.

func (*Store) Update

func (s *Store) Update(id string, u UpdateFunc) error

Update updates image content

type UpdateFunc

type UpdateFunc func(Image) (Image, error)

UpdateFunc is function used to update the image. If there is an error, the update will be rolled back.

Jump to

Keyboard shortcuts

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