Documentation ¶
Overview ¶
Package layer extracts OCI image layer tarballs.
Index ¶
- func ExtractDir(h *tar.Header, _ io.Reader, path string) error
- func ExtractFIFO(h *tar.Header, _ io.Reader, path string) error
- func ExtractFile(h *tar.Header, tr io.Reader, path string) error
- func ExtractSymlink(h *tar.Header, _ io.Reader, path string) error
- type ExtractHandler
- type HeaderHandler
- type HeaderHandlerFn
- type StackingExtractor
- type WhiteoutHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractDir ¶
ExtractDir is a HeaderHandler that creates a directory at the supplied path per the supplied tar header.
func ExtractFIFO ¶
ExtractFIFO is a HeaderHandler that creates a FIFO at the supplied path per the supplied tar header.
func ExtractFile ¶
ExtractFile is a HeaderHandler that creates a regular file at the supplied path per the supplied tar header.
Types ¶
type ExtractHandler ¶
type ExtractHandler struct {
// contains filtered or unexported fields
}
An ExtractHandler extracts from a tarball per the supplied tar header by calling a handler that knows how to extract the type of file.
func NewExtractHandler ¶
func NewExtractHandler() *ExtractHandler
NewExtractHandler returns a HeaderHandler that extracts from a tarball per the supplied tar header by calling a handler that knows how to extract the type of file.
type HeaderHandler ¶
type HeaderHandler interface { // Handle the supplied tarball header by applying it to the supplied path, // e.g. creating a file, directory, etc. The supplied io.Reader is expected // to be a tarball advanced to the supplied header, i.e. via tr.Next(). Handle(h *tar.Header, tr io.Reader, path string) error }
A HeaderHandler handles a single file (header) within a tarball.
type HeaderHandlerFn ¶
A HeaderHandlerFn is a function that acts as a HeaderHandler.
type StackingExtractor ¶
type StackingExtractor struct {
// contains filtered or unexported fields
}
A StackingExtractor is a Extractor that extracts an OCI layer by 'stacking' it atop the supplied root directory.
func NewStackingExtractor ¶
func NewStackingExtractor(h HeaderHandler) *StackingExtractor
NewStackingExtractor extracts an OCI layer by 'stacking' it atop the supplied root directory.
type WhiteoutHandler ¶
type WhiteoutHandler struct {
// contains filtered or unexported fields
}
A WhiteoutHandler handles OCI whiteouts by deleting the corresponding files. It passes anything that is not a whiteout to an underlying HeaderHandler. It avoids deleting any file created by the underling HeaderHandler.
func NewWhiteoutHandler ¶
func NewWhiteoutHandler(hh HeaderHandler) *WhiteoutHandler
NewWhiteoutHandler returns a HeaderHandler that handles OCI whiteouts by deleting the corresponding files.