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 LibArchiveVersion = C.ARCHIVE_VERSION_ONLY_STRING LibArchiveVersionInt = C.ARCHIVE_VERSION_NUMBER )
var ( ErrArchiveEOF = io.EOF ErrArchiveFatal = wrapError{/* contains filtered or unexported fields */} ErrArchiveFailed = wrapError{/* contains filtered or unexported fields */} ErrArchiveRetry = wrapError{/* contains filtered or unexported fields */} ErrArchiveWarn = wrapError{/* contains filtered or unexported fields */} ErrArchiveFatalClosing = ErrArchiveFatal.wrap("critical error, archive closing") ErrUnexpectedEOF = fmt.Errorf("unexpected end of file") ErrInvalidHeaderSignature = fmt.Errorf("invalid header signature") )
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
Symlink() string
Hardlink() string
IsHardlink() bool
}
ArchiveEntry represents an libarchive archive_entry
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents libarchive archive
func NewReaderWithBufferSize ¶
NewReaderWithBufferSize returns new Archive by calling archive_read_open with specified buffer size
func (*Reader) Close ¶
Close closes the underlying libarchive archive and frees it, using Close since its more common in go to always call Close (rather than having two methods)
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
func (*Reader) Read ¶
Read calls archive_read_data which reads the current archive_entry. It acts as io.Reader.Read in any other aspect