Documentation
¶
Overview ¶
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- type ImgJson
- type ImgTarFs
- type ImgTarLayer
- type LayerInfo
- func (l *LayerInfo) GetDiffPath() string
- func (l *LayerInfo) GetLayerPath() string
- func (l *LayerInfo) GetLayerSize() int64
- func (l *LayerInfo) GetlinkContent() string
- func (l *LayerInfo) SetCacheId(cacheId string)
- func (l *LayerInfo) SetCacheIdPath(cacheidPath string)
- func (l *LayerInfo) SetMetaPath(metaPath string)
- func (l *LayerInfo) SetSizePath(sizePath string)
- type Manifest
- type OriginalLayer
- type ShadowLayer
- func (l *ShadowLayer) Dump()
- func (l *ShadowLayer) DumpLayerSize(size string)
- func (l *ShadowLayer) GetLayerSize() int64
- func (l *ShadowLayer) GetRealPath() string
- func (l *ShadowLayer) Original() OriginalLayer
- func (l *ShadowLayer) Restore()
- func (l *ShadowLayer) SetCacheId(cacheId string)
- func (l *ShadowLayer) SetLayerSize(size string)
- func (l *ShadowLayer) SetLowers(newLowers string)
- func (l *ShadowLayer) TarDiff(destFile string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImgJson ¶
type ImgJson struct {
Created interface{} `json:"created"`
Author interface{} `json:"author"`
Architecture interface{} `json:"architecture"`
Os interface{} `json:"os"`
Config interface{} `json:"config"`
Rootfs struct {
DiffIds []string `json:"diff_ids"` // from bottom to top
Type string `json:"type"`
} `json:"rootfs"`
History interface{} `json:"history"`
}
An ImgJson represents the json file of a docker image in a tar file. See: https://github.com/moby/moby/blob/master/image/spec/v1.2.md
type ImgTarFs ¶
type ImgTarFs struct {
// contains filtered or unexported fields
}
func ParseImgTarFs ¶
ParseImgTarFs parses the filesystem of a docker image in a tar file.
func (*ImgTarFs) DumpImgJson ¶
func (f *ImgTarFs) DumpImgJson()
func (*ImgTarFs) DumpManifest ¶
func (f *ImgTarFs) DumpManifest()
func (*ImgTarFs) GetImageJson ¶
func (*ImgTarFs) GetLayers ¶
func (f *ImgTarFs) GetLayers() []ImgTarLayer
func (*ImgTarFs) GetManifest ¶
func (*ImgTarFs) TarWholeFs ¶
TarWholeFs archives the whole filesystem of the image to a tar file.
type ImgTarLayer ¶
type ImgTarLayer struct {
// contains filtered or unexported fields
}
An ImgTarLayer represents a layer of a docker image in a tar file.
func (*ImgTarLayer) GetLayerTarPath ¶
func (l *ImgTarLayer) GetLayerTarPath() string
GetLayerTarPath returns the path of the layer tar file.
func (*ImgTarLayer) LayerTarSha256Sum ¶
func (l *ImgTarLayer) LayerTarSha256Sum() string
LayerTarSha256Sum returns the sha256 sum of the layer tar file.
func (*ImgTarLayer) RmLayerTar ¶
func (l *ImgTarLayer) RmLayerTar()
type LayerInfo ¶
type LayerInfo struct {
// contains filtered or unexported fields
}
func NewLayerInfo ¶
NewLayerInfo creates a new LayerInfo from a layer path, with some very basic fields
func (*LayerInfo) GetDiffPath ¶
func (*LayerInfo) GetLayerPath ¶
func (*LayerInfo) GetLayerSize ¶
func (*LayerInfo) GetlinkContent ¶
func (*LayerInfo) SetCacheId ¶
func (*LayerInfo) SetCacheIdPath ¶
func (*LayerInfo) SetMetaPath ¶
func (*LayerInfo) SetSizePath ¶
Set size path, this will also set the size field
type OriginalLayer ¶
type OriginalLayer struct {
LayerInfo
}
An OriginalLayer represents an original overlay layer of a docker image.
func NewOriginalLayer ¶
func NewOriginalLayer(layerInfo LayerInfo) OriginalLayer
NewOriginalLayer creates a new OriginalLayer from a LayerInfo
func (*OriginalLayer) Shadow ¶
func (l *OriginalLayer) Shadow() ShadowLayer
Shadow creates a ShadowLayer from an original layer in memory, not create it in the filesystem. It is the counterpart of ShadowLayer.Original.
type ShadowLayer ¶
type ShadowLayer struct {
LayerInfo
// contains filtered or unexported fields
}
A ShadowLayer represents a shadowed overlay layer of a docker image. Each original layer will have a corresponding shadow layer. Files used in an original layer will be copied to the shadow layer.
func NewShadowLayer ¶
func NewShadowLayer(layerInfo LayerInfo) ShadowLayer
NewShadowLayer creates a new ShadowLayer from a LayerInfo
func (*ShadowLayer) Dump ¶
func (l *ShadowLayer) Dump()
Dump creates the shadow layer in the filesystem. It is the counterpart of Restore.
func (*ShadowLayer) DumpLayerSize ¶
func (l *ShadowLayer) DumpLayerSize(size string)
DumpLayerSize writes the size of the layer to the size file. It modifies the filesystem.
func (*ShadowLayer) GetLayerSize ¶
func (l *ShadowLayer) GetLayerSize() int64
func (*ShadowLayer) GetRealPath ¶
func (l *ShadowLayer) GetRealPath() string
func (*ShadowLayer) Original ¶
func (l *ShadowLayer) Original() OriginalLayer
Original returns the original layer from a shadow layer in memory, not create it in the filesystem It is the counterpart of OriginalLayer.Shadow.
func (*ShadowLayer) Restore ¶
func (l *ShadowLayer) Restore()
Restore restores the filesystem of the docker image to the state before shadowing. It modifies the filesystem. It is the counterpart of Dump.
func (*ShadowLayer) SetCacheId ¶
func (l *ShadowLayer) SetCacheId(cacheId string)
func (*ShadowLayer) SetLayerSize ¶
func (l *ShadowLayer) SetLayerSize(size string)
func (*ShadowLayer) SetLowers ¶
func (l *ShadowLayer) SetLowers(newLowers string)
SetLowers replaces existing lowers to new lowers
func (*ShadowLayer) TarDiff ¶
func (l *ShadowLayer) TarDiff(destFile string)
TarDiff archives the diff directory of the shadow layer to a tar file.