Documentation
¶
Index ¶
- type Archive
- type ArchiveFactory
- type DefaultArchiveFactory
- func (e DefaultArchiveFactory) Open(filepath string, password string) (Archive, error)
- func (e DefaultArchiveFactory) OpenBytes(data []byte, password string) (Archive, error)
- func (e DefaultArchiveFactory) OpenReader(reader ReaderAtCloser, size int64, password string, minimizeReads bool) (Archive, error)
- type Entry
- type ReaderAtCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive interface {
Entries() []Entry // List of all the archived file entries.
Entry(path string) (Entry, error) // Gets the entry at the given `path`.
Close()
}
Represents an immutable archive.
func NewExplodedArchive ¶
type ArchiveFactory ¶
type ArchiveFactory interface {
Open(filepath string, password string) (Archive, error) // Opens an archive from a local [file].
OpenBytes(data []byte, password string) (Archive, error) // Opens an archive from a [data] slice.
OpenReader(reader ReaderAtCloser, size int64, password string, minimizeReads bool) (Archive, error) // Opens an archive from a reader.
}
type DefaultArchiveFactory ¶
type DefaultArchiveFactory struct {
// contains filtered or unexported fields
}
func NewArchiveFactory ¶
func NewArchiveFactory() DefaultArchiveFactory
func (DefaultArchiveFactory) Open ¶
func (e DefaultArchiveFactory) Open(filepath string, password string) (Archive, error)
Open implements ArchiveFactory
func (DefaultArchiveFactory) OpenBytes ¶
func (e DefaultArchiveFactory) OpenBytes(data []byte, password string) (Archive, error)
OpenBytes implements ArchiveFactory
func (DefaultArchiveFactory) OpenReader ¶
func (e DefaultArchiveFactory) OpenReader(reader ReaderAtCloser, size int64, password string, minimizeReads bool) (Archive, error)
OpenBytes implements ArchiveFactory
type Entry ¶
type Entry interface {
Path() string // Absolute path to the entry in the archive.
Length() uint64 // Uncompressed data length.
CompressedLength() uint64 // Compressed data length.
Read(start int64, end int64) ([]byte, error) // Reads the whole content of this entry, or a portion when [start] or [end] are specified.
Stream(w io.Writer, start int64, end int64) (int64, error) // Streams the whole content of this entry to a writer, or a portion when [start] or [end] are specified.
}
Holds an archive entry's metadata.
Click to show internal directories.
Click to hide internal directories.