cim

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 19 Imported by: 3

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ImportBlockCIMLayerWithOpts added in v0.14.0

func ImportBlockCIMLayerWithOpts(ctx context.Context, r io.Reader, layer *cimfs.BlockCIM, opts ...BlockCIMLayerImportOpt) (_ int64, err error)

func ImportCimLayerFromTar

func ImportCimLayerFromTar(ctx context.Context, r io.Reader, layerPath, cimPath string, parentLayerPaths, parentLayerCimPaths []string) (_ int64, err error)

ImportCimLayerFromTar reads a layer from an OCI layer tar stream and extracts it into the CIM format at the specified path. `layerPath` is the directory which can be used to store intermediate files generated during layer extraction (and these file are also used when extracting children layers of this layer) `cimPath` is the path to the CIM in which layer files must be stored. Note that region & object files are created when writing to a CIM, these files will be created next to the `cimPath`. `parentLayerCimPaths` are paths to the parent layer CIMs, ordered from highest to lowest, i.e the CIM at `parentLayerCimPaths[0]` will be the immediate parent of the layer that is being extracted here. `parentLayerPaths` are paths to the parent layer directories. Ordered from highest to lowest.

This function returns the total size of the layer's files, in bytes.

func ImportSingleFileCimLayerFromTar added in v0.13.0

func ImportSingleFileCimLayerFromTar(ctx context.Context, r io.Reader, layer *cimfs.BlockCIM, parentLayers []*cimfs.BlockCIM) (_ int64, err error)

ImportSingleFileCimLayerFromTar reads a layer from an OCI layer tar stream and extracts it into the SingleFileCIM format.

func MergeBlockCIMLayersWithOpts added in v0.14.0

func MergeBlockCIMLayersWithOpts(ctx context.Context, sourceCIMs []*cimfs.BlockCIM, mergedCIM *cimfs.BlockCIM, opts ...BlockCIMLayerImportOpt) (retErr error)

MergeBlockCIMLayersWithOpts create a new block CIM at mergedCIM.BlockPath and then creates a new CIM inside that block CIM that merges all the contents of the provided sourceCIMs. Note that this is only a metadata merge, so when this merged CIM is being mounted, all the sourceCIMs must be provided too and they MUST be provided in the same order. Expected order of sourceCIMs is that the base layer should be at the last index and the topmost layer should be at 0'th index. Merge operation can take a long time in certain situations, this function respects context deadlines in such cases. This function is NOT thread safe, it is caller's responsibility to handle thread safety.

Types

type BlockCIMLayerImportOpt added in v0.14.0

type BlockCIMLayerImportOpt func(*blockCIMLayerImportConfig) error

BlockCIMOpt is a function type for configuring block CIM creation options

func WithLayerIntegrity added in v0.14.0

func WithLayerIntegrity() BlockCIMLayerImportOpt

func WithParentLayers added in v0.14.0

func WithParentLayers(parentLayers []*cimfs.BlockCIM) BlockCIMLayerImportOpt

func WithVHDFooter added in v0.14.0

func WithVHDFooter() BlockCIMLayerImportOpt

Jump to

Keyboard shortcuts

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