cim

package
v0.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyCimLayer

func DestroyCimLayer(ctx context.Context, layerPath string) error

DestroyCimLayer destroys a cim layer i.e it removes all the cimfs files for the given layer as well as all of the other files that are stored in the layer directory (at path `layerPath`). If this is not a cimfs layer (i.e a cim file for the given layer does not exist) then nothing is done.

func GetCimDirFromLayer

func GetCimDirFromLayer(layerPath string) string

CimDir is the directory inside which all cims are stored.

func GetCimNameFromLayer

func GetCimNameFromLayer(layerPath string) string

CimName is the filename (<layerid>.cim) of the file representing the cim

func GetCimPathFromLayer

func GetCimPathFromLayer(layerPath string) string

CimPath is the path to the CimDir/<layerid>.cim file that represents a layer cim.

func IsCimLayer

func IsCimLayer(layerPath string) bool

IsCimLayer returns `true` if the layer at path `layerPath` is a cim layer. Returns `false` otherwise.

Types

type CimLayerWriter

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

A CimLayerWriter implements the wclayer.LayerWriter interface to allow writing container image layers in the cim format. A cim layer consist of cim files (which are usually stored in the `cim-layers` directory and some other files which are stored in the directory of that layer (i.e the `path` directory).

func NewCimLayerWriter

func NewCimLayerWriter(ctx context.Context, path string, parentLayerPaths []string) (_ *CimLayerWriter, err error)

func (*CimLayerWriter) Add

func (cw *CimLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo, fileSize int64, securityDescriptor []byte, extendedAttributes []byte, reparseData []byte) error

Add adds a file to the layer with given metadata.

func (*CimLayerWriter) AddAlternateStream

func (cw *CimLayerWriter) AddAlternateStream(name string, size uint64) error

AddAlternateStream creates another alternate stream at the given path. Any writes made after this call will go to that stream.

func (cw *CimLayerWriter) AddLink(name string, target string) error

AddLink adds a hard link to the layer. The target must already have been added.

func (*CimLayerWriter) Close

func (cw *CimLayerWriter) Close(ctx context.Context) (retErr error)

Close finishes the layer writing process and releases any resources.

func (*CimLayerWriter) Remove

func (cw *CimLayerWriter) Remove(name string) error

Remove removes a file that was present in a parent layer from the layer.

func (*CimLayerWriter) Write

func (cw *CimLayerWriter) Write(b []byte) (int, error)

Write writes data to the current file. The data must be in the format of a Win32 backup stream.

Jump to

Keyboard shortcuts

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