squashfs

package
v0.0.0-...-c7fba9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDate

func BuildDate(path string) time.Time

BuildDate returns the "Creation or last append time" as reported by unsquashfs.

func FileHasSquashfsHeader

func FileHasSquashfsHeader(path string) bool

Types

type BuildOpts

type BuildOpts struct {
	SnapType     string
	Compression  string
	ExcludeFiles []string
}

type MksquashfsError

type MksquashfsError struct {
	// contains filtered or unexported fields
}

func (MksquashfsError) Error

func (m MksquashfsError) Error() string

type Snap

type Snap struct {
	// contains filtered or unexported fields
}

Snap is the squashfs based snap.

func New

func New(snapPath string) *Snap

New returns a new Squashfs snap.

func (*Snap) Build

func (s *Snap) Build(sourceDir string, opts *BuildOpts) error

Build builds the snap.

func (*Snap) BuildDate

func (s *Snap) BuildDate() time.Time

BuildDate returns the "Creation or last append time" as reported by unsquashfs.

func (*Snap) Install

func (s *Snap) Install(targetPath, mountDir string, opts *snap.InstallOptions) (bool, error)

Install installs a squashfs snap file through an appropriate method.

func (*Snap) ListDir

func (s *Snap) ListDir(dirPath string) ([]string, error)

ListDir returns the content of a single directory inside a squashfs snap.

func (*Snap) Path

func (s *Snap) Path() string

Path returns the path of the backing file.

func (*Snap) RandomAccessFile

func (s *Snap) RandomAccessFile(filePath string) (interface {
	io.ReaderAt
	io.Closer
	Size() int64
}, error)

RandomAccessFile returns an implementation to read at any given location for a single file inside the squashfs snap plus information about the file size.

func (*Snap) ReadFile

func (s *Snap) ReadFile(filePath string) (content []byte, err error)

ReadFile returns the content of a single file inside a squashfs snap.

func (*Snap) Size

func (s *Snap) Size() (size int64, err error)

Size returns the size of a squashfs snap.

func (*Snap) Unpack

func (s *Snap) Unpack(src, dstDir string) error

func (*Snap) Walk

func (s *Snap) Walk(relative string, walkFn filepath.WalkFunc) error

Walk (part of snap.Container) is like filepath.Walk, without the ordering guarantee.

type SnapFileOwner

type SnapFileOwner struct {
	UID uint32
	GID uint32
}

Jump to

Keyboard shortcuts

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