Documentation
¶
Overview ¶
* Copyright (c) 2025 System233 * * This software is released under the MIT License. * https://opensource.org/licenses/MIT
Index ¶
- Constants
- func Dump(target string) error
- func GetTriplet() string
- func IsValidComponentVersion(version string) bool
- func IsValidVersion(version string) bool
- func Mount(opt *MountOption) error
- func NormalizeVersion(version string) string
- func Pack(opt *PackOption) error
- func Umount(opt *UmountOption) error
- type Config
- type DumpErofsOption
- type LayerHeader
- type LayerInfo
- type LayerInfoHeader
- type MountOption
- type PackOption
- type UmountOption
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 GetTriplet ¶
func GetTriplet() string
func IsValidComponentVersion ¶
func IsValidVersion ¶ added in v1.5.2
func Mount ¶
func Mount(opt *MountOption) error
func NormalizeVersion ¶
解析规则: * 若是deb版本号格式,去除epoch部分,其余4个部分,每个部分取其中首次出现的数字,如果存在rev,upstream中取3个部分,rev作为最后一个部分,数量不全的部分尾部补0; * 若是其他格式,按点号分割为4个部分,移除其中所有的非数字内容; * 若某个部分没有数字,则补0; * 若数字有前导0,删除前导0; * 删除所有空格;
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 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) ParseLayerInfo ¶
type LayerInfoHeader ¶
func NewLayerInfoHeader ¶
func NewLayerInfoHeader(config Config) LayerInfoHeader
func (*LayerInfoHeader) Print ¶
func (l *LayerInfoHeader) Print()
type MountOption ¶
type PackOption ¶
type UmountOption ¶
Click to show internal directories.
Click to hide internal directories.