Documentation ¶
Index ¶
Constants ¶
const ( ARCHIVE_EOF = C.ARCHIVE_EOF ARCHIVE_OK = C.ARCHIVE_OK ARCHIVE_RETRY = C.ARCHIVE_RETRY ARCHIVE_WARN = C.ARCHIVE_WARN ARCHIVE_FAILED = C.ARCHIVE_FAILED ARCHIVE_FATAL = C.ARCHIVE_FATAL )
Variables ¶
var ( FileTypeRegFile = C.AE_IFREG FileTypeSymLink = C.AE_IFLNK FileTypeSocket = C.AE_IFSOCK FileTypeCharDev = C.AE_IFCHR FileTypeBlkDev = C.AE_IFBLK FileTypeDir = C.AE_IFDIR FileTypeFIFO = C.AE_IFIFO )
var ( ErrArchiveEOF = io.EOF ErrArchiveFatal = errors.New("libarchive: FATAL [critical error, archive closing]") )
Functions ¶
This section is empty.
Types ¶
type ArchiveEntry ¶
type ArchiveEntry interface { // FileInfo describing archive_entry Stat() os.FileInfo // The name of the entry PathName() string }
ArchiveEntry represents an libarchive archive_entry
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents libarchive archive
func (*Reader) Free ¶
Free frees the resources the underlying libarchive archive is using calling archive_read_free
func (*Reader) Next ¶
func (r *Reader) Next() (ArchiveEntry, error)
Next calls archive_read_next_header and returns an interpretation of the ArchiveEntry which is a wrapper around libarchive's archive_entry, or Err.
ErrArchiveEOF is returned when there is no more to be read from the archive
type ReedSeeker ¶
type ReedSeeker struct {
// contains filtered or unexported fields
}
ReedSeeker represents libarchive archive
func NewReadSeeker ¶
func NewReadSeeker(reader io.ReadSeeker) (r *ReedSeeker, err error)
NewReader returns new Archive by calling archive_read_open
func (*ReedSeeker) Close ¶
func (r *ReedSeeker) Close() error
Close closes the underlying libarchive archive calling archive read_cloe
func (*ReedSeeker) Free ¶
func (r *ReedSeeker) Free() error
Free frees the resources the underlying libarchive archive is using calling archive_read_free
func (*ReedSeeker) Next ¶
func (r *ReedSeeker) Next() (ArchiveEntry, error)
Next calls archive_read_next_header and returns an interpretation of the ArchiveEntry which is a wrapper around libarchive's archive_entry, or Err.
ErrArchiveEOF is returned when there is no more to be read from the archive
func (*ReedSeeker) Read ¶
func (r *ReedSeeker) Read(b []byte) (n int, err error)
Read calls archive_read_data which reads the current archive_entry. It acts as io.ReedSeeker.Read in any other aspect
func (*ReedSeeker) Seek ¶
func (r *ReedSeeker) Seek(offset int64, whence int) (int64, error)
Seek sets the offset for the next Read to offset
func (*ReedSeeker) Size ¶
func (r *ReedSeeker) Size() int
Size returns compressed size of the current archive entry