storage

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupSandbox

func CleanupSandbox(rootDir string) error

CleanupSandbox removes sandbox dir. This should be done after every build.

Types

type ImageStore

type ImageStore struct {
	RootDir    string
	SandboxDir string
	Manifests  *ManifestStore
	Layers     *LayerTarStore
}

ImageStore contains a manifeststore, a layertarstore, and a sandbox dir.

func NewImageStore

func NewImageStore(rootDir string) (*ImageStore, error)

NewImageStore creates a new ImageStore.

func StoreFixture

func StoreFixture() (*ImageStore, func())

StoreFixture returns test store.

func StoreFixtureWithSampleImage

func StoreFixtureWithSampleImage() (*ImageStore, func())

StoreFixtureWithSampleImage returns test store with sample image.

func (*ImageStore) SaveManifest added in v0.1.14

func (store *ImageStore) SaveManifest(
	distManifest image.DistributionManifest, imageName image.Name) error

type LayerTarStore

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

LayerTarStore manages layer tar files on local disk.

func NewLayerTarStore

func NewLayerTarStore(rootdir string) (*LayerTarStore, error)

NewLayerTarStore initializes and returns a new LayerTarStore object.

func (*LayerTarStore) CreateDownloadFile

func (s *LayerTarStore) CreateDownloadFile(fileName string, len int64) error

CreateDownloadFile creates an empty file in download directory with specified size.

func (*LayerTarStore) DeleteStoreFile

func (s *LayerTarStore) DeleteStoreFile(fileName string) error

DeleteStoreFile deletes a file from store directory.

func (*LayerTarStore) GetDownloadFileReadWriter

func (s *LayerTarStore) GetDownloadFileReadWriter(fileName string) (base.FileReadWriter, error)

GetDownloadFileReadWriter returns a FileReadWriter for a file in download directory.

func (*LayerTarStore) GetDownloadFileReader

func (s *LayerTarStore) GetDownloadFileReader(fileName string) (base.FileReader, error)

GetDownloadFileReader returns a FileReader for a file in download directory.

func (*LayerTarStore) GetDownloadOrCacheFileStat

func (s *LayerTarStore) GetDownloadOrCacheFileStat(fileName string) (os.FileInfo, error)

GetDownloadOrCacheFileStat returns os.FileInfo for a file in download or cache directory.

func (*LayerTarStore) GetStoreFileReader

func (s *LayerTarStore) GetStoreFileReader(fileName string) (base.FileReader, error)

GetStoreFileReader returns a FileReader for a file in store directory.

func (*LayerTarStore) GetStoreFileStat

func (s *LayerTarStore) GetStoreFileStat(fileName string) (os.FileInfo, error)

GetStoreFileStat returns FileInfo of the specified file.

func (*LayerTarStore) LinkStoreFileFrom

func (s *LayerTarStore) LinkStoreFileFrom(fileName, src string) error

LinkStoreFileFrom create a hardlink in store from given source path.

func (*LayerTarStore) LinkStoreFileTo

func (s *LayerTarStore) LinkStoreFileTo(fileName, target string) error

LinkStoreFileTo hardlinks file from store to target

func (*LayerTarStore) MoveDownloadFileToStore

func (s *LayerTarStore) MoveDownloadFileToStore(fileName string) error

MoveDownloadFileToStore moves a file from store directory to cache directory.

type ManifestStore

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

ManifestStore manages image manifest files on local disk. It uses repo/tag as file name, distribution manifest as content. Notice manifest is not the same as image config.

func NewManifestStore

func NewManifestStore(rootdir string) (*ManifestStore, error)

NewManifestStore initializes and returns a new ManifestStore object.

func (*ManifestStore) CreateDownloadFile

func (s *ManifestStore) CreateDownloadFile(repo, tag string, len int64) error

CreateDownloadFile creates an empty file in download directory with specified size.

func (*ManifestStore) DeleteStoreFile

func (s *ManifestStore) DeleteStoreFile(repo, tag string) error

DeleteStoreFile deletes a file from store directory. TODO: deref all layers.

func (*ManifestStore) GetDownloadFileReadWriter

func (s *ManifestStore) GetDownloadFileReadWriter(repo, tag string) (base.FileReadWriter, error)

GetDownloadFileReadWriter returns a FileReadWriter for a file in download directory.

func (*ManifestStore) GetDownloadOrCacheFileStat

func (s *ManifestStore) GetDownloadOrCacheFileStat(repo, tag string) (os.FileInfo, error)

GetDownloadOrCacheFileStat returns os.FileInfo for a file in download or cache directory.

func (*ManifestStore) GetStoreFileReader

func (s *ManifestStore) GetStoreFileReader(repo, tag string) (base.FileReader, error)

GetStoreFileReader returns a FileReader for a file in store directory.

func (*ManifestStore) GetStoreFileStat

func (s *ManifestStore) GetStoreFileStat(repo, tag string) (os.FileInfo, error)

GetStoreFileStat returns os.FileInfo for a file in store directory.

func (*ManifestStore) LinkStoreFileFrom

func (s *ManifestStore) LinkStoreFileFrom(repo, tag, src string) error

LinkStoreFileFrom create a hardlink in store from given source path.

func (*ManifestStore) LinkStoreFileTo

func (s *ManifestStore) LinkStoreFileTo(repo, tag, target string) error

LinkStoreFileTo hardlinks file from store to target

func (*ManifestStore) MoveDownloadFileToStore

func (s *ManifestStore) MoveDownloadFileToStore(repo, tag string) error

MoveDownloadFileToStore moves a file from store directory to cache directory.

type RootPreserver added in v0.1.11

type RootPreserver struct {
	InitialRootDir string
	SavedRootDir   string
	// contains filtered or unexported fields
}

RootPreserver contains the locations of:

  • the "old" root, the one before running makisu that will get removed by `MemFS.Remove()` at the end of the build command
  • the "saved" root, a dir containing a copy of everyfile of the "old" root

func NewRootPreserver added in v0.1.11

func NewRootPreserver(rootDir, storageDir string, blacklist []string) (*RootPreserver, error)

NewRootPreserver creates a new RootPreserver.

func (*RootPreserver) RestoreRoot added in v0.1.11

func (r *RootPreserver) RestoreRoot() error

RestoreRoot will copy the backupDir in the initial root dir

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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