Documentation ¶
Index ¶
- Constants
- func CheckExist(idOrName string) bool
- func CheckNameOrID(args string) string
- func FileInfoHeader(name string, fi os.FileInfo, link string) (*tar.Header, error)
- func GetImageFromDocker(name string) (string, error)
- func GetImageType(imageID string) string
- func ImportDocekrImage(ctx context.Context, name, file string) (string, error)
- func ImportImage(path string) (string, error)
- func ImportSaveDockerImage(ctx context.Context, path string) (string, error)
- func PullDockerImage(ctx context.Context, name string) (string, error)
- func QEMUImageSave(imageName string, imageType string, fileName string) (string, error)
- func RunningInUserNS() bool
- func SplitPathDirEntry(path string) (dir, base string)
- func Untar(tarfile, dstPath string) error
- type IDMap
- type Identity
- type IdentityMapping
- type Image
- type ImageEntry
- func (image *ImageEntry) Export(target string) error
- func (image *ImageEntry) GetName() string
- func (image *ImageEntry) GetPath() string
- func (image *ImageEntry) GetType() (isDocker bool, imageType string)
- func (image *ImageEntry) Register()
- func (image *ImageEntry) Remove() error
- func (image *ImageEntry) Rename(name string) error
- func (image *ImageEntry) UnRegister()
- type WhiteoutFormat
Constants ¶
const WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix
const WhiteoutOpaqueDir = WhiteoutMetaPrefix + ".opq"
const WhiteoutPrefix = ".wh."
Variables ¶
This section is empty.
Functions ¶
func CheckExist ¶
func CheckNameOrID ¶
method to get imageId of a name or id return id
func FileInfoHeader ¶
FileInfoHeader creates a populated Header from fi. Compared to archive pkg this function fills in more information. Also, regardless of Go version, this function fills file type bits (e.g. hdr.Mode |= modeISDIR), which have been deleted since Go 1.9 archive/tar.
func GetImageFromDocker ¶
func GetImageType ¶
func ImportDocekrImage ¶
func ImportImage ¶
func ImportSaveDockerImage ¶
func QEMUImageSave ¶
func RunningInUserNS ¶
func RunningInUserNS() bool
* Detect whether we are currently running in a user namespace. * Copied from github.com/lxc/lxd/shared/util.go
func SplitPathDirEntry ¶
SplitPathDirEntry splits the given path between its directory name and its basename by first cleaning the path but preserves a trailing "." if the original path specified the current directory.
Types ¶
type IDMap ¶
type IDMap struct { ContainerID int `json:"container_id"` HostID int `json:"host_id"` Size int `json:"size"` }
IDMap contains a single entry for user namespace range remapping. An array of IDMap entries represents the structure that will be provided to the Linux kernel for creating a user namespace.
type IdentityMapping ¶
type IdentityMapping struct {
// contains filtered or unexported fields
}
IdentityMapping contains a mappings of UIDs and GIDs
func (*IdentityMapping) Empty ¶
func (i *IdentityMapping) Empty() bool
Empty returns true if there are no id mappings
func (*IdentityMapping) ToContainer ¶
func (i *IdentityMapping) ToContainer(pair Identity) (int, int, error)
ToContainer returns the container UID and GID for the host uid and gid
type Image ¶
type ImageEntry ¶
type ImageEntry struct { Name string `json:"name"` ID string `json:"id"` CreateTime time.Time `json:"create-time"` Type string `json:"type"` // docker_save, docker_raw, kvm_ios, kvm_qcow2 IsDockerImage bool `json:"is_docker_image"` Counter int32 `json:"counter"` }
func ListImage ¶
func ListImage() []*ImageEntry
func (*ImageEntry) Export ¶
func (image *ImageEntry) Export(target string) error
func (*ImageEntry) GetName ¶
func (image *ImageEntry) GetName() string
func (*ImageEntry) GetPath ¶
func (image *ImageEntry) GetPath() string
func (*ImageEntry) GetType ¶
func (image *ImageEntry) GetType() (isDocker bool, imageType string)
func (*ImageEntry) Register ¶
func (image *ImageEntry) Register()
func (*ImageEntry) Remove ¶
func (image *ImageEntry) Remove() error
func (*ImageEntry) Rename ¶
func (image *ImageEntry) Rename(name string) error
func (*ImageEntry) UnRegister ¶
func (image *ImageEntry) UnRegister()
type WhiteoutFormat ¶
type WhiteoutFormat int
const ( // AUFSWhiteoutFormat is the default format for whiteouts AUFSWhiteoutFormat WhiteoutFormat = iota // OverlayWhiteoutFormat formats whiteout according to the overlay // standard. OverlayWhiteoutFormat )