Documentation
¶
Overview ¶
Package squashfs is a SquashFS reader and writer using fs.FS
Index ¶
- Variables
- type BuildOption
- func BlockSize(blockSize uint32) BuildOption
- func Compression(c CompressorOptions) BuildOption
- func DefaultModTime(t time.Time) BuildOption
- func DefaultMode(m fs.FileMode) BuildOption
- func DefaultOwner(owner, group uint32) BuildOption
- func ExportTable() BuildOption
- func SqfsModTime(t uint32) BuildOption
- type Builder
- func (b *Builder) Block(p string, deviceNumber uint32, options ...InodeOption) error
- func (b *Builder) Char(p string, deviceNumber uint32, options ...InodeOption) error
- func (b *Builder) Close() error
- func (b *Builder) Dir(p string, options ...InodeOption) error
- func (b *Builder) FIFO(p string, options ...InodeOption) error
- func (b *Builder) File(p string, r io.Reader, options ...InodeOption) error
- func (b *Builder) Socket(p string, options ...InodeOption) error
- func (b *Builder) Symlink(p, dest string, options ...InodeOption) error
- type Compressor
- type CompressorOptions
- type GZipOptions
- type InodeOption
- type LZ4Options
- type LZMAOptions
- type LZOOptions
- type SquashFS
- func (s *SquashFS) LStat(path string) (fs.FileInfo, error)
- func (s *SquashFS) Open(path string) (fs.File, error)
- func (s *SquashFS) ReadDir(name string) ([]fs.DirEntry, error)
- func (s *SquashFS) ReadFile(name string) ([]byte, error)
- func (s *SquashFS) ReadLink(name string) (string, error)
- func (s *SquashFS) Readlink(path string) (string, error)
- func (s *SquashFS) Stat(path string) (fs.FileInfo, error)
- type Stats
- type XZOptions
- type ZStdOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidCompressor = errors.New("invalid or unknown compressor") ErrInvalidCompressionLevel = errors.New("invalid compression level") ErrInvalidWindowSize = errors.New("invalid window size") ErrInvalidCompressionStrategies = errors.New("invalid compression strategies") ErrNoCompressorOptions = errors.New("no compressor options should be supplied") ErrInvalidCompressionAlgorithm = errors.New("invalid compression algorithm") ErrInvalidDictionarySize = errors.New("invalid dictionary size") ErrInvalidFilters = errors.New("invalid filters") ErrInvalidCompressorVersion = errors.New("invalid compressor version") ErrInvalidCompressorFlags = errors.New("invalid compressor flags") ErrUnsupportedCompressor = errors.New("unsupported compressor") ErrInvalidPointer = errors.New("invalid pointer") ErrInvalidBlockHeader = errors.New("invalid block header") ErrInvalidMagicNumber = errors.New("invalid magic number") ErrInvalidBlockSize = errors.New("invalid block size") ErrInvalidVersion = errors.New("invalid version") )
var ( BlockSize4K = BlockSize(minBlockSize) BlockSize16K = BlockSize(1 << 14) BlockSize128K = BlockSize(defaultBlockSize) BlockSize1M = BlockSize(maxBlockSize) )
Functions ¶
This section is empty.
Types ¶
type BuildOption ¶
func BlockSize ¶
func BlockSize(blockSize uint32) BuildOption
func Compression ¶
func Compression(c CompressorOptions) BuildOption
func DefaultModTime ¶
func DefaultModTime(t time.Time) BuildOption
func DefaultMode ¶
func DefaultMode(m fs.FileMode) BuildOption
func DefaultOwner ¶
func DefaultOwner(owner, group uint32) BuildOption
func ExportTable ¶
func ExportTable() BuildOption
func SqfsModTime ¶
func SqfsModTime(t uint32) BuildOption
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) Block ¶
func (b *Builder) Block(p string, deviceNumber uint32, options ...InodeOption) error
type Compressor ¶
type Compressor uint16
const ( CompressorGZIP Compressor = 1 CompressorLZMA Compressor = 2 CompressorLZO Compressor = 3 CompressorXZ Compressor = 4 CompressorLZ4 Compressor = 5 CompressorZSTD Compressor = 6 )
func (Compressor) String ¶
func (c Compressor) String() string
type CompressorOptions ¶
type CompressorOptions interface {
// contains filtered or unexported methods
}
type GZipOptions ¶
func DefaultGzipOptions ¶
func DefaultGzipOptions() *GZipOptions
type InodeOption ¶
type InodeOption func(*commonStat)
func ModTime ¶
func ModTime(t time.Time) InodeOption
func Mode ¶
func Mode(m fs.FileMode) InodeOption
func Owner ¶
func Owner(owner, group uint32) InodeOption
type LZ4Options ¶
type LZMAOptions ¶
type LZMAOptions struct{}
func DefaultLZMAOptions ¶
func DefaultLZMAOptions() LZMAOptions
type LZOOptions ¶
func DefaultLZOOptions ¶
func DefaultLZOOptions() *LZOOptions
type SquashFS ¶
type SquashFS struct {
// contains filtered or unexported fields
}
The SquashFS type implements many of the FS interfaces, such as: fs.FS fs.ReadFileFS fs.ReadDirFS fs.StatFS
and has additional methods for dealing with symlinks.
func Open ¶
Open reads the passed io.ReaderAt as a SquashFS image, returning a fs.FS implementation.
The returned fs.FS, and any files opened from it will cease to work if the io.ReaderAt is closed.
func OpenWithCacheSize ¶
OpenWithCacheSize acts like Open, but allows a custom cache size, which normally defaults to 16MB.
func (*SquashFS) LStat ¶
Lstat returns a FileInfo describing the named file. If the file is a symbolic link, the returned FileInfo describes the symbolic link.
func (*SquashFS) ReadDir ¶
ReadDir returns a sorted list of directory entries for the named directory.
type Stats ¶
type Stats struct { Inodes uint32 ModTime time.Time BlockSize uint32 FragCount uint32 Compressor Compressor Flags uint16 BytesUsed uint64 }
Type Stats contains basic data about the SquashFS file, read from the superblock.
type XZOptions ¶
func DefaultXZOptions ¶
func DefaultXZOptions() *XZOptions
type ZStdOptions ¶
type ZStdOptions struct {
CompressionLevel uint32
}
func DefaultZStdOptions ¶
func DefaultZStdOptions() *ZStdOptions