Documentation ¶
Index ¶
- type API
- type Archive
- type ArchiveEntry
- type LibArchive
- func (la LibArchive) EntryPathname(e ArchiveEntry) string
- func (la LibArchive) EntrySize(e ArchiveEntry) int64
- func (la LibArchive) EntrySizeIsSet(e ArchiveEntry) bool
- func (la LibArchive) NewRead() Archive
- func (la LibArchive) ReadData(a Archive, buffer []byte, length int) (int, error)
- func (la LibArchive) ReadDataSkip(a Archive) error
- func (la LibArchive) ReadFree(a Archive)
- func (la LibArchive) ReadNextHeader(a Archive, e *ArchiveEntry) error
- func (la LibArchive) ReadOpenFileName(a Archive, filename string, blockSize int) error
- func (la LibArchive) ReadSupportFilterAll(a Archive) error
- func (la LibArchive) ReadSupportFormatAll(a Archive) error
- func (la LibArchive) ReadSupportFormatEmpty(a Archive) error
- func (la LibArchive) ReadSupportFormatRaw(a Archive) error
- func (la LibArchive) Unpack(tarballPath string, targetPath string, enableRaw bool) error
- func (la LibArchive) WriteDiskNew() Archive
- func (la LibArchive) WriteDiskSetOptions(a Archive, flags int)
- func (la LibArchive) WriteDiskSetStandardLookup(a Archive)
- func (la LibArchive) WriteFinishEntry(a Archive) error
- func (la LibArchive) WriteFree(a Archive)
- func (la LibArchive) WriteHeader(a Archive, e ArchiveEntry) error
- type Reader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { NewRead() Archive ReadSupportFilterAll(a Archive) error ReadSupportFormatRaw(a Archive) error ReadSupportFormatAll(a Archive) error ReadSupportFormatEmpty(a Archive) error ReadOpenFileName(a Archive, filename string, blockSize int) error ReadFree(a Archive) ReadNextHeader(a Archive, e *ArchiveEntry) error ReadData(a Archive, buffer []byte, length int) (int, error) ReadDataSkip(a Archive) error WriteDiskNew() Archive WriteDiskSetOptions(a Archive, flags int) WriteDiskSetStandardLookup(a Archive) WriteFree(a Archive) WriteHeader(a Archive, e ArchiveEntry) error WriteFinishEntry(a Archive) error EntrySize(e ArchiveEntry) int64 EntrySizeIsSet(e ArchiveEntry) bool EntryPathname(e ArchiveEntry) string Unpack(tarballPath string, targetPath string, enableRaw bool) error }
API is the libarchive API provided by this package
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
Archive is a wrapper for "C.struct_archive"
type ArchiveEntry ¶
type ArchiveEntry struct {
// contains filtered or unexported fields
}
ArchiveEntry is a wrapper for "C.struct_archive_entry"
type LibArchive ¶
type LibArchive struct { }
LibArchive is the default implementation of API
func (LibArchive) EntryPathname ¶
func (la LibArchive) EntryPathname(e ArchiveEntry) string
EntryPathname is a wrapper for ""
func (LibArchive) EntrySize ¶
func (la LibArchive) EntrySize(e ArchiveEntry) int64
EntrySize is a wrapper for "C.archive_entry_size()"
func (LibArchive) EntrySizeIsSet ¶
func (la LibArchive) EntrySizeIsSet(e ArchiveEntry) bool
EntrySizeIsSet is a wrapper for "C.archive_entry_size_is_set()"
func (LibArchive) NewRead ¶
func (la LibArchive) NewRead() Archive
NewRead is a wrapper for "C.archive_read_new()"
func (LibArchive) ReadDataSkip ¶
func (la LibArchive) ReadDataSkip(a Archive) error
ReadDataSkip is a wrapper for "C.archive_read_data_skip()"
func (LibArchive) ReadFree ¶
func (la LibArchive) ReadFree(a Archive)
ReadFree is a wrapper for "C.archive_read_free()"
func (LibArchive) ReadNextHeader ¶
func (la LibArchive) ReadNextHeader(a Archive, e *ArchiveEntry) error
ReadNextHeader is a wrapper for "C.archive_read_next_header()"
func (LibArchive) ReadOpenFileName ¶
func (la LibArchive) ReadOpenFileName(a Archive, filename string, blockSize int) error
ReadOpenFileName is a wrapper for "C.archive_read_open_filename()"
func (LibArchive) ReadSupportFilterAll ¶
func (la LibArchive) ReadSupportFilterAll(a Archive) error
ReadSupportFilterAll is a wrapper for "C.archive_read_support_filter_all()"
func (LibArchive) ReadSupportFormatAll ¶
func (la LibArchive) ReadSupportFormatAll(a Archive) error
ReadSupportFormatAll is a wrapper for "C.archive_read_support_format_all()"
func (LibArchive) ReadSupportFormatEmpty ¶
func (la LibArchive) ReadSupportFormatEmpty(a Archive) error
ReadSupportFormatEmpty is a wrapper for "C.archive_read_support_format_empty()"
func (LibArchive) ReadSupportFormatRaw ¶
func (la LibArchive) ReadSupportFormatRaw(a Archive) error
ReadSupportFormatRaw is a wrapper for "C.archive_read_support_format_raw()"
func (LibArchive) Unpack ¶
func (la LibArchive) Unpack(tarballPath string, targetPath string, enableRaw bool) error
Unpack contains the algorithm to extract files from a tarball and put them on a directory
func (LibArchive) WriteDiskNew ¶
func (la LibArchive) WriteDiskNew() Archive
WriteDiskNew is a wrapper for "C.archive_write_disk_new()"
func (LibArchive) WriteDiskSetOptions ¶
func (la LibArchive) WriteDiskSetOptions(a Archive, flags int)
WriteDiskSetOptions is a wrapper for "C.archive_write_disk_set_options()"
func (LibArchive) WriteDiskSetStandardLookup ¶
func (la LibArchive) WriteDiskSetStandardLookup(a Archive)
WriteDiskSetStandardLookup is a wrapper for "C.archive_write_disk_set_standard_lookup()"
func (LibArchive) WriteFinishEntry ¶
func (la LibArchive) WriteFinishEntry(a Archive) error
WriteFinishEntry is a wrapper for "C.archive_write_finish_entry()"
func (LibArchive) WriteFree ¶
func (la LibArchive) WriteFree(a Archive)
WriteFree is a wrapper for "C.archive_write_free()"
func (LibArchive) WriteHeader ¶
func (la LibArchive) WriteHeader(a Archive, e ArchiveEntry) error
WriteHeader is a wrapper for "C.archive_write_header()"
type Reader ¶
type Reader struct { API // the implementation being used Archive Archive // the Archive being used ChunkSize int // the chunk size being used ArchivePath string // the path of the Archive being used }
Reader is an abstraction that implements the io.Reader interface
func NewReader ¶
NewReader is a factory method used to create a new Reader. Must receive an API implementation, the filePath on which the file will be read and the chunkSize used for reading
func (Reader) ExtractFile ¶
ExtractFile extracts a single file from the associated Archive to the 'target' interface
func (Reader) ReadNextHeader ¶
ReadNextHeader setups the Archive for a set of reads