Documentation ¶
Index ¶
- Constants
- func DestroyList(entries []IEntry) error
- type Archive
- func (ego *Archive) Destroy() error
- func (ego *Archive) Extract(entries []IEntry)
- func (ego *Archive) List() []IEntry
- func (ego *Archive) SetAlwaysOverwritesFiles(alwaysOverwriteFiles bool)
- func (ego *Archive) SetAlwaysSkipsFiles(alwaysSkipsFiles bool)
- func (ego *Archive) SetBatch(batch int, entries []IEntry)
- func (ego *Archive) SetCopiesArchiveModificationTimeToEnclosingDirectory(copiesArchiveModificationTimeToEnclosingDirectory bool)
- func (ego *Archive) SetDestination(path string)
- func (ego *Archive) SetEncodingName(encodingName string)
- func (ego *Archive) SetExtractsSubArchives(extractsSubArchives bool)
- func (ego *Archive) SetMacResourceForkStyle(macResourceForkStyle bool)
- func (ego *Archive) SetPassword(password string)
- func (ego *Archive) SetPasswordEncodingName(passEncodingName string)
- func (ego *Archive) SetPropagatesRelevantMetadata(propagatesRelevantMetadata bool)
- type Entry
- func (ego *Entry) Destroy() error
- func (ego *Entry) GetCorrupted() bool
- func (ego *Entry) GetDir() bool
- func (ego *Entry) GetEid() uint32
- func (ego *Entry) GetEncoding() string
- func (ego *Entry) GetEncrypted() bool
- func (ego *Entry) GetError() error
- func (ego *Entry) GetFilename() string
- func (ego *Entry) GetLink() bool
- func (ego *Entry) GetRenaming() string
- func (ego *Entry) GetResource() bool
- func (ego *Entry) GetSize() uint
- func (ego *Entry) SetRenaming(renaming string)
- type IArchive
- type IEntry
Constants ¶
const POINTER_SIZE = bits.UintSize / 8
Variables ¶
This section is empty.
Functions ¶
func DestroyList ¶
Destroys a slice of Entries.
Parameters:
- entries - slice of Entries to be destroyed.
Returns:
- error if any of the Entry has already been destroyed.
Types ¶
type Archive ¶
type Archive struct { Err error // contains filtered or unexported fields }
func NewArchive ¶
Creates a new Archive. Has to be deallocated with Destroy method after use.
Parameters:
- path - path to the existing Archive.
Returns:
- pointer to a new instance of Archive.
func (*Archive) Destroy ¶
Destroys the Archive.
Returns:
- error, if Archive has been already destroyed, nil otherwise.
func (*Archive) Extract ¶
Extract from the Archive. If batch > -1, only batch Entries are extracted.
Parameters:
- entries - slice of Entries.
func (*Archive) List ¶
Lists content of an Archive in form of arrays.
Entry records must be destroyed by DestroyList() call explicitly. Alternatively, it is possible to destroy individual Entries using the Destroy() function.
Returns:
- slice of Entries.
func (*Archive) SetAlwaysOverwritesFiles ¶
Sets if always overwrite files if they are present on the destination path.
Parameters:
- alwaysOverwriteFiles
func (*Archive) SetAlwaysSkipsFiles ¶
Sets if always skip files on error.
Parameters:
- alwaysSkipsFiles
func (*Archive) SetBatch ¶
Sets the batch, which specifies how many Entries to extract. If batch <= -1, everything will be extracted at once.
Parameters:
- batch - number of Entries,
- entries - the slice of Entries.
func (*Archive) SetCopiesArchiveModificationTimeToEnclosingDirectory ¶
func (ego *Archive) SetCopiesArchiveModificationTimeToEnclosingDirectory(copiesArchiveModificationTimeToEnclosingDirectory bool)
Sets if to set Entries modification time also to the destination files.
Parameters:
- copiesArchiveModificationTimeToEnclosingDirectory
func (*Archive) SetDestination ¶
Sets default destination for Entries at extraction. Destination setting is important for not renamed Entries only. Otherwise ignored.
Parameters:
- path - the destination path.
func (*Archive) SetEncodingName ¶
Sets default encoding name for Entries at extraction.
Parameters:
- encodingName - the encoding name.
func (*Archive) SetExtractsSubArchives ¶
Sets if extract also included subarchives. Not recommended set to yes - unsufficient testing.
Parameters:
- extractsSubArchives
func (*Archive) SetMacResourceForkStyle ¶
Sets if to use MacOS forking style. Not recommended - not tested on Linux, just for completeness.
Parameters:
- macResourceForkStyle
func (*Archive) SetPassword ¶
Sets default password for Entries at extraction.
Parameters:
- password - the password.
func (*Archive) SetPasswordEncodingName ¶
Sets default password encoding name for Entries at extraction.
Parameters:
- passEncodingName - the password encoding name.
func (*Archive) SetPropagatesRelevantMetadata ¶
Sets if propagate relevant metadata (passwords etc.). Not recommended set to yes - unsufficient testing.
Parameters:
- propagatesRelevantMetadata
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
func (*Entry) Destroy ¶
Destroys individual Entry.
Returns:
- error if Entry has been already destroyed.
func (*Entry) GetEncrypted ¶
Predicate - is encrypted by using of password?
func (*Entry) GetFilename ¶
Get full path with filename within the archive.
func (*Entry) GetRenaming ¶
Get Entry renaming.
You may set Entry destination by hand by setting this.
func (*Entry) SetRenaming ¶
Sets renaming for the Entry from constant string and allocates copy.
Parameters:
- renaming - path with a new name.
type IArchive ¶
type IArchive interface { List() []IEntry Extract([]IEntry) SetBatch(int, []IEntry) Destroy() error SetDestination(string) SetPassword(string) SetEncodingName(string) SetPasswordEncodingName(string) SetAlwaysOverwritesFiles(bool) SetAlwaysSkipsFiles(bool) SetExtractsSubArchives(bool) SetPropagatesRelevantMetadata(bool) SetCopiesArchiveModificationTimeToEnclosingDirectory(bool) SetMacResourceForkStyle(bool) }
type IEntry ¶
type IEntry interface { GetFilename() string GetDir() bool GetLink() bool GetResource() bool GetCorrupted() bool GetEncrypted() bool GetEid() uint32 GetEncoding() string GetRenaming() string GetError() error GetSize() uint SetRenaming(string) Destroy() error // contains filtered or unexported methods }