Documentation
¶
Index ¶
- Constants
- func IsValueError(err error) bool
- func IsZipfile(path string) bool
- type AttributeError
- type BadZipFile
- type EOFError
- type IndexError
- type KeyError
- type LZMAError
- type NotImplementedError
- type OSError
- type RuntimeError
- type StructError
- type UnicodeEncodeError
- type ValueError
- type WriteFile
- type ZipFile
- type ZipInfo
- type ZipReader
- func (r *ZipReader) Close() error
- func (r *ZipReader) Comment() ([]byte, error)
- func (r *ZipReader) ExtractAll(path *string, members []string) error
- func (r *ZipReader) GetInfo(name string) (*ZipInfo, error)
- func (r *ZipReader) Namelist() []string
- func (r *ZipReader) Open(name string) (io.ReadCloser, error)
- type ZlibError
- type ZstdError
Constants ¶
const ( Bzip2 = 12 LZMA = 14 Zstandard = 93 )
Compression methods the reader decodes beside stored and deflated
const ( Stored = 0 Deflated = 8 Zip64Limit = 1<<31 - 1 FileCountLimit = 1<<16 - 1 )
Variables ¶
This section is empty.
Functions ¶
func IsValueError ¶
Reports whether err is a ValueError or one of its subclasses
Types ¶
type AttributeError ¶
type AttributeError struct{ Msg string }
AttributeError of a seek on a stream that only counts its position
func (*AttributeError) Error ¶
func (e *AttributeError) Error() string
func (*AttributeError) PyTypeName ¶
func (e *AttributeError) PyTypeName() string
type BadZipFile ¶
type BadZipFile struct{ Msg string }
zipfile.BadZipFile raised for a damaged archive or member
func (*BadZipFile) Error ¶
func (e *BadZipFile) Error() string
func (*BadZipFile) PyTypeName ¶
func (e *BadZipFile) PyTypeName() string
type EOFError ¶
type EOFError struct{ Msg string }
EOFError a member read raises when the archive ends inside its data
func (*EOFError) PyTypeName ¶
type IndexError ¶
type IndexError struct{ Msg string }
IndexError of an arcname that normalizes to nothing
func (*IndexError) Error ¶
func (e *IndexError) Error() string
func (*IndexError) PyTypeName ¶
func (e *IndexError) PyTypeName() string
type KeyError ¶
type KeyError struct{ Msg string }
KeyError of a name the archive does not hold
func (*KeyError) PyTypeName ¶
type LZMAError ¶
type LZMAError struct{ Msg string }
lzma.LZMAError of a damaged LZMA member
func (*LZMAError) PyTypeName ¶
type NotImplementedError ¶
type NotImplementedError struct{ Msg string }
NotImplementedError for a compression method this writer has no compressor for
func (*NotImplementedError) Error ¶
func (e *NotImplementedError) Error() string
func (*NotImplementedError) PyTypeName ¶
func (e *NotImplementedError) PyTypeName() string
type OSError ¶
type OSError struct{ Msg string }
OSError the bz2 decompressor raises for a damaged stream
func (*OSError) PyTypeName ¶
type RuntimeError ¶
type RuntimeError struct{ Msg string }
RuntimeError zipfile raises when a member outgrows its header format
func (*RuntimeError) Error ¶
func (e *RuntimeError) Error() string
func (*RuntimeError) PyTypeName ¶
func (e *RuntimeError) PyTypeName() string
type StructError ¶
type StructError struct{ Msg string }
struct.error raised when a header field does not fit its packed width
func (*StructError) Error ¶
func (e *StructError) Error() string
func (*StructError) PyTypeName ¶
func (e *StructError) PyTypeName() string
type UnicodeEncodeError ¶
UnicodeEncodeError of a file name holding undecodable bytes, a ValueError subclass in Python
func (*UnicodeEncodeError) Error ¶
func (e *UnicodeEncodeError) Error() string
func (*UnicodeEncodeError) PyTypeName ¶
func (e *UnicodeEncodeError) PyTypeName() string
type ValueError ¶
type ValueError struct{ Msg string }
ValueError zipfile raises for a refused argument or state
func (*ValueError) Error ¶
func (e *ValueError) Error() string
func (*ValueError) PyTypeName ¶
func (e *ValueError) PyTypeName() string
type WriteFile ¶
type WriteFile struct {
// contains filtered or unexported fields
}
Open member of a ZipFile, finalized into the central directory by Close
type ZipFile ¶
type ZipFile struct {
Fp *os.File
Filelist []*ZipInfo
NameToInfo map[string]*ZipInfo
StartDir int64
// contains filtered or unexported fields
}
Archive opened for writing with zipfile.ZipFile mode w semantics over one file
func Create ¶
New archive at path, truncating it, opened read write and then write only when that open fails
func (*ZipFile) Close ¶
Writes the central directory and end records then closes the file, a close failure winning
func (*ZipFile) Open ¶
Handle writing a new member named name with the archive compression and the 1980 default date
func (*ZipFile) Seekable ¶
Reports whether the archive file supports seeking back to rewrite headers
func (*ZipFile) TruncateAt ¶
Moves to pos and cuts the archive file there
type ZipInfo ¶
type ZipInfo struct {
Filename string
DateTime [6]int
CompressType int
CompressLevel *int
Comment []byte
Extra []byte
CreateSystem int
CreateVersion int
ExtractVersion int
Reserved int
FlagBits int
Volume int
InternalAttr int
ExternalAttr uint32
HeaderOffset int64
CRC uint32
CompressSize int64
FileSize int64
}
Attributes of one archive member, the zipfile.ZipInfo fields the writer packs
func NewZipInfo ¶
Member description with the zipfile defaults, refusing a date before 1980
func ZipInfoFromFile ¶
Member description of a file on disk under arcname, its local mtime, mode bits and size
func (*ZipInfo) FileHeader ¶
Local file header bytes, a ZIP64 extra carrying the sizes when zip64 is set
type ZipReader ¶
type ZipReader struct {
Filelist []*ZipInfo
NameToInfo map[string]*ZipInfo
StartDir int64
IgnoreInvalidNames bool
// contains filtered or unexported fields
}
Archive opened for reading with zipfile.ZipFile mode r semantics
func OpenReader ¶
Opens an archive and reads its table of contents as zipfile.ZipFile does
func (*ZipReader) Comment ¶
zipfile.ZipFile.comment, the comment bytes the end of central directory record carries
func (*ZipReader) ExtractAll ¶
zipfile.ZipFile.extractall into path, the working directory when nil, members nil meaning every name
type ZlibError ¶
type ZlibError struct{ Msg string }
zlib.error raised for a compression level zlib refuses