paq

package
v0.0.0-...-759cef8 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DirBlock = iota
	DataBlock
	PointerBlock
)
View Source
const (
	NoEnc = iota
	DeflateEnc
)
View Source
const (
	HeaderMagic    = 0x529ab12b
	HeaderSize     = 44
	BigHeaderMagic = 0x25a9
	BlockMagic     = 0x198a1cbf
	BlockSize      = 12
	BigBlockMagic  = 0x91a8
	TrailerMagic   = 0x6b46e688
	TrailerSize    = 28
	Version        = 1
	MaxBlockSize   = 512 * 1024
	MinBlockSize   = 512
	MinDirSize     = 28
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Magic    uint32
	Size     uint32
	Type     uint8
	Encoding uint8
	Adler32  uint32
}

type Dir

type Dir struct {
	Qid    uint32
	Mode   uint32
	Mtime  uint32
	Length uint32
	Offset uint32
	Name   string
	Uid    string
	Gid    string
}
type Header struct {
	Magic     uint32
	Version   uint16
	BlockSize uint32
	Time      uint32
	Label     [32]byte
}

type Trailer

type Trailer struct {
	Magic uint32
	Root  uint32
	Sha1  [20]byte
}

type WriteOptions

type WriteOptions struct {
	Time      time.Time
	Compress  bool
	Label     string
	Version   int
	BlockSize int
	Uid       string
	Gid       string
}

func DefaultWriteOptions

func DefaultWriteOptions() *WriteOptions

type Writer

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

func NewWriter

func NewWriter(w io.Writer, o *WriteOptions) (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) WriteBlock

func (w *Writer) WriteBlock(b []byte, typ int) int64

func (*Writer) WriteBlockDir

func (w *Writer) WriteBlockDir(d *Dir) int64

func (*Writer) WriteDir

func (w *Writer) WriteDir(dir string, di os.FileInfo) (*Dir, error)

func (*Writer) WriteFile

func (w *Writer) WriteFile(r io.Reader, fi os.FileInfo) (*Dir, error)

func (*Writer) WriteHeader

func (w *Writer) WriteHeader()

func (*Writer) WriteTrailer

func (w *Writer) WriteTrailer(root uint32)

Jump to

Keyboard shortcuts

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