Documentation ¶
Overview ¶
Package cache provides support for automatic caching of any image supported by containers/image
Index ¶
- Constants
- func Clean()
- func Library() string
- func LibraryImage(sum, name string) string
- func LibraryImageExists(sum, name string) (bool, error)
- func Net() string
- func NetImage(sum, name string) string
- func NetImageExists(sum, name string) (bool, error)
- func OciBlob() string
- func OciTemp() string
- func OciTempExists(sum, name string) (bool, error)
- func OciTempImage(sum, name string) string
- func Root() string
- func Shub() string
- func ShubImage(sum, name string) string
- func ShubImageExists(sum, name string) (bool, error)
Constants ¶
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" )
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" )
const (
// LibraryDir is the directory inside the cache.Dir where library images are cached
LibraryDir = "library"
)
const (
// NetDir is the directory inside the cache.Dir where net images are cached
NetDir = "net"
)
const (
// ShubDir is the directory inside the cache.Dir where shub images are cached
ShubDir = "shub"
)
Variables ¶
This section is empty.
Functions ¶
func Library ¶
func Library() string
Library returns the directory inside the cache.Dir() where library images are cached
func LibraryImage ¶
LibraryImage creates a directory inside cache.Dir() with the name of the SHA sum of the image
func LibraryImageExists ¶
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 ¶
NetImage creates a directory inside cache.Dir() with the name of the SHA sum of the image
func NetImageExists ¶
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 ¶
OciTempExists returns whether the image with the given sha sum exists in the OciTemp() cache
func OciTempImage ¶
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 ¶
ShubImage creates a directory inside cache.Dir() with the name of the SHA sum of the image
func ShubImageExists ¶
ShubImageExists returns whether the image with the SHA sum exists in the ShubImage cache
Types ¶
This section is empty.