package cim
import "github.com/Microsoft/hcsshim/internal/wclayer/cim"
Index ¶
- func DestroyCimLayer(ctx context.Context, layerPath string) error
- func GetCimDirFromLayer(layerPath string) string
- func GetCimNameFromLayer(layerPath string) string
- func GetCimPathFromLayer(layerPath string) string
- func IsCimLayer(layerPath string) bool
- type CimLayerWriter
- func NewCimLayerWriter(ctx context.Context, path string, parentLayerPaths []string) (_ *CimLayerWriter, err error)
- func (cw *CimLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo, fileSize int64, securityDescriptor []byte, extendedAttributes []byte, reparseData []byte) error
- func (cw *CimLayerWriter) AddAlternateStream(name string, size uint64) error
- func (cw *CimLayerWriter) AddLink(name string, target string) error
- func (cw *CimLayerWriter) Close(ctx context.Context) (retErr error)
- func (cw *CimLayerWriter) Remove(name string) error
- func (cw *CimLayerWriter) Write(b []byte) (int, error)
Functions ¶
func DestroyCimLayer ¶
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 ¶
CimDir is the directory inside which all cims are stored.
func GetCimNameFromLayer ¶
CimName is the filename (<layerid>.cim) of the file representing the cim
func GetCimPathFromLayer ¶
CimPath is the path to the CimDir/<layerid>.cim file that represents a layer cim.
func IsCimLayer ¶
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 (*CimLayerWriter) AddLink ¶
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.
Source Files ¶
LayerWriter.go bcd.go common.go file_writer.go pending.go process.go registry.go
- Version
- v0.12.0-rc.1
- Published
- Nov 2, 2023
- Platform
- linux/amd64
- Imports
- 31 packages
- Last checked
- 30 minutes ago –
Tools for package owners.