layer

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

* Copyright (c) 2025 System233 * * This software is released under the MIT License. * https://opensource.org/licenses/MIT

Index

Constants

View Source
const DumpErofs = "dump.erofs"
View Source
const ErofsFuse = "erofsfuse"
View Source
const FuserMount = "fusermount"
View Source
const LayerMagic = "<<< deepin linglong layer archive >>>\x00\x00\x00"
View Source
const MkfsErofs = "mkfs.erofs"

Variables

This section is empty.

Functions

func Dump

func Dump(target string) error

func GetTriplet

func GetTriplet() string

func IsValidComponentVersion

func IsValidComponentVersion(version string) bool

func Mount

func Mount(opt *MountOption) error

func NormalizeVersion

func NormalizeVersion(version string) string

func Pack

func Pack(opt *PackOption) error

func Umount

func Umount(opt *UmountOption) error

Types

type Config added in v1.4.6

type Config struct {
	Version string `yaml:"version"`
	Package struct {
		ID          string `yaml:"id"`
		Name        string `yaml:"name"`
		Version     string `yaml:"version"`
		Kind        string `yaml:"kind"`
		Description string `yaml:"description"`
	} `yaml:"package"`
	Command []string `yaml:"command"`
	Base    string   `yaml:"base"`
	Runtime string   `yaml:"runtime,omitempty"`
	Build   string   `yaml:"build"`
}

type DumpErofsOption

type DumpErofsOption struct {
	Args     []string
	ExecPath string
}

type LayerHeader

type LayerHeader struct {
	FileName string
	FileSize int64
	Magic    string
	Info     LayerInfoHeader
	InfoSize int
}

func NewLayerHeader

func NewLayerHeader(file *os.File) (*LayerHeader, error)

func NewLayerHeaderFromFile

func NewLayerHeaderFromFile(filePath string) (*LayerHeader, error)

func (*LayerHeader) DataOffset

func (l *LayerHeader) DataOffset() int

func (*LayerHeader) Print

func (l *LayerHeader) Print()

func (*LayerHeader) PrintAll

func (l *LayerHeader) PrintAll() error

func (*LayerHeader) PrintErofs

func (l *LayerHeader) PrintErofs(opt *DumpErofsOption) error

type LayerInfo

type LayerInfo struct {
	Arch          []string `json:"arch"`
	Base          string   `json:"base"`
	Runtime       string   `json:"runtime,omitempty"`
	Channel       string   `json:"channel"`
	Command       []string `json:"command"`
	Description   string   `json:"description"`
	ID            string   `json:"id"`
	Kind          string   `json:"kind"`
	Module        string   `json:"module"`
	Name          string   `json:"name"`
	SchemaVersion string   `json:"schema_version"`
	Size          int64    `json:"size"`
	Version       string   `json:"version"`
}

func (*LayerInfo) FileName

func (l *LayerInfo) FileName() string

func (*LayerInfo) ParseLayerInfo

func (info *LayerInfo) ParseLayerInfo(config Config) error

func (*LayerInfo) Print

func (info *LayerInfo) Print()

type LayerInfoHeader

type LayerInfoHeader struct {
	Info    LayerInfo `json:"info"`
	Version string    `json:"version"`
}

func NewLayerInfoHeader

func NewLayerInfoHeader(config Config) LayerInfoHeader

func (*LayerInfoHeader) Print

func (l *LayerInfoHeader) Print()

type MountOption

type MountOption struct {
	Source   string
	Target   string
	Args     []string
	ExecPath string
}

type PackOption

type PackOption struct {
	Source     string
	Target     string
	ExecPath   string
	Compressor string
	BlockSize  int
	Uid        int
	Gid        int
	Args       []string
}

type UmountOption

type UmountOption struct {
	Target   string
	Args     []string
	ExecPath string
}

Jump to

Keyboard shortcuts

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