Documentation
¶
Index ¶
- Constants
- type AsarArchive
- func (archive *AsarArchive) AddFromDirectory(path, prefix string) error
- func (archive *AsarArchive) Close() error
- func (archive *AsarArchive) CreateFileEntry(name string, content []byte) error
- func (archive *AsarArchive) CreateLinkEntry(name, link string) error
- func (archive *AsarArchive) DeleteEntry(name string) error
- func (archive *AsarArchive) ExtractAll(path string) error
- func (archive *AsarArchive) GetAllEntries() []*AsarEntry
- func (archive *AsarArchive) GetEntry(name string) (*AsarEntry, error)
- func (archive *AsarArchive) Save(options *WriteOptions) error
- func (archive *AsarArchive) Write(writer io.WriteSeeker, options *WriteOptions) error
- func (archive *AsarArchive) WriteFile(path string, options *WriteOptions) error
- type AsarEntry
- type AsarEntryType
- type AsarHeaderInfo
- type ReadOptions
- type WriteOptions
Constants ¶
View Source
const DEFAULT_BLOCK_SIZE = 4 * 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsarArchive ¶
type AsarArchive struct {
FilePath string
// contains filtered or unexported fields
}
func FromReader ¶
func FromReader(reader io.ReadSeekCloser, options *ReadOptions) (*AsarArchive, error)
Creates an AsarArchive from a Reader The AsarArchive takes ownership of the Reader
func OpenFile ¶
func OpenFile(path string, options *ReadOptions) (*AsarArchive, error)
Opens an ASAR file
func (*AsarArchive) AddFromDirectory ¶
func (archive *AsarArchive) AddFromDirectory(path, prefix string) error
Add files from a directory to the Archive
func (*AsarArchive) CreateFileEntry ¶
func (archive *AsarArchive) CreateFileEntry(name string, content []byte) error
Creates a File entry with the given Content If the Entry exists, it will be overwritten
func (*AsarArchive) CreateLinkEntry ¶ added in v1.1.0
func (archive *AsarArchive) CreateLinkEntry(name, link string) error
Creates a Link entry If the Entry exists, it will be overwritten
func (*AsarArchive) DeleteEntry ¶
func (archive *AsarArchive) DeleteEntry(name string) error
Deletes a entry
func (*AsarArchive) ExtractAll ¶
func (archive *AsarArchive) ExtractAll(path string) error
Extract the Archive
func (*AsarArchive) GetAllEntries ¶
func (archive *AsarArchive) GetAllEntries() []*AsarEntry
Returns all entries
func (*AsarArchive) GetEntry ¶
func (archive *AsarArchive) GetEntry(name string) (*AsarEntry, error)
Returns the entry with the given name
func (*AsarArchive) Save ¶
func (archive *AsarArchive) Save(options *WriteOptions) error
Saves the Archive to the opened File If this throws an error, you may not be able to use the archive after
func (*AsarArchive) Write ¶
func (archive *AsarArchive) Write(writer io.WriteSeeker, options *WriteOptions) error
Writes the Archive to the given Writer
func (*AsarArchive) WriteFile ¶
func (archive *AsarArchive) WriteFile(path string, options *WriteOptions) error
Writes the Archive to the given file
type AsarEntry ¶
type AsarEntry struct {
Type AsarEntryType
Name string
Link string
// contains filtered or unexported fields
}
type AsarEntryType ¶
type AsarEntryType int8
const ( AsarEntryTypeDirectory AsarEntryType = iota AsarEntryTypeFile AsarEntryTypeLink )
func (AsarEntryType) String ¶
func (entryType AsarEntryType) String() string
type AsarHeaderInfo ¶
func ReadAsarHeaderInfo ¶
func ReadAsarHeaderInfo(reader io.ReadSeekCloser) (*AsarHeaderInfo, error)
Reads the Header of an Reader
type ReadOptions ¶
type WriteOptions ¶
type WriteOptions struct {
BlockSize int
}
Click to show internal directories.
Click to hide internal directories.