cache

package
v3.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package cache provides support for automatic caching of any image supported by containers/image

Index

Constants

View Source
const (
	// DirEnv specifies the environment variable which can set the directory
	// for image downloads to be cached in
	DirEnv = "SINGULARITY_CACHEDIR"

	// RootDefault specifies the directory inside of ${HOME} that images are
	// cached in by default.
	// Uses "~/.singularity/cache" which will not clash with any 2.x cache
	// directory.
	RootDefault = ".singularity/cache"
)
View Source
const (
	// OciBlobDir is the directory inside cache.Dir() where oci images are cached
	OciBlobDir = "oci"
	// OciTempDir is the directory inside cache.Dir() where splatted out oci images live
	OciTempDir = "oci-tmp"
)
View Source
const (
	// LibraryDir is the directory inside the cache.Dir where library images are cached
	LibraryDir = "library"
)
View Source
const (
	// NetDir is the directory inside the cache.Dir where net images are cached
	NetDir = "net"
)
View Source
const (
	// ShubDir is the directory inside the cache.Dir where shub images are cached
	ShubDir = "shub"
)

Variables

This section is empty.

Functions

func Clean

func Clean()

Clean wipes all files in the cache directory

func Library

func Library() string

Library returns the directory inside the cache.Dir() where library images are cached

func LibraryImage

func LibraryImage(sum, name string) string

LibraryImage creates a directory inside cache.Dir() with the name of the SHA sum of the image

func LibraryImageExists

func LibraryImageExists(sum, name string) (bool, error)

LibraryImageExists returns whether the image with the SHA sum exists in the LibraryImage cache

func Net

func Net() string

Net returns the directory inside the cache.Dir() where shub images are cached

func NetImage

func NetImage(sum, name string) string

NetImage creates a directory inside cache.Dir() with the name of the SHA sum of the image

func NetImageExists

func NetImageExists(sum, name string) (bool, error)

NetImageExists returns whether the image with the SHA sum exists in the net cache

func OciBlob

func OciBlob() string

OciBlob returns the directory inside cache.Dir() where oci blobs are cached

func OciTemp

func OciTemp() string

OciTemp returns the directory inside cache.Dir() where splatted out oci images live

func OciTempExists

func OciTempExists(sum, name string) (bool, error)

OciTempExists returns whether the image with the given sha sum exists in the OciTemp() cache

func OciTempImage

func OciTempImage(sum, name string) string

OciTempImage creates a OciTempDir/sum directory and returns the abs path of the image

func Root

func Root() string

Root is the root location where all of singularity caching happens. Library, Shub, and oci image formats supported by containers/image repository will be cached inside

Defaults to ${HOME}/.singularity/cache

func Shub

func Shub() string

Shub returns the directory inside the cache.Dir() where shub images are cached

func ShubImage

func ShubImage(sum, name string) string

ShubImage creates a directory inside cache.Dir() with the name of the SHA sum of the image

func ShubImageExists

func ShubImageExists(sum, name string) (bool, error)

ShubImageExists returns whether the image with the SHA sum exists in the ShubImage cache

Types

This section is empty.

Jump to

Keyboard shortcuts

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