Documentation ¶
Index ¶
- Constants
- Variables
- type CorruptedZip
- func (cz *CorruptedZip) Body() io.Reader
- func (cz *CorruptedZip) CRC32() uint32
- func (cz *CorruptedZip) Close()
- func (cz *CorruptedZip) CompressedSize() uint64
- func (cz *CorruptedZip) Err() error
- func (cz *CorruptedZip) IsDir() bool
- func (cz *CorruptedZip) Method() uint16
- func (cz *CorruptedZip) Name() string
- func (cz *CorruptedZip) OriginalSize() uint64
- func (cz *CorruptedZip) RegisterNameDecoder(f func([]byte) (string, error))
- func (cz *CorruptedZip) RegisterPasswordHandler(f func(filename string) (password []byte, err error))
- func (cz *CorruptedZip) Scan() bool
- type ErrPassword
Constants ¶
const ( Store = 0 Deflate = 8 )
Variables ¶
var (
ErrLocalFileHeaderSignatureNotFound = errors.New("signature not found")
)
Functions ¶
This section is empty.
Types ¶
type CorruptedZip ¶
type CorruptedZip struct { LastModificationTime time.Time LastAccessTime time.Time CreationTime time.Time // Debug outputs debug-log. When the field is not set, debug-log is dropped. Debug func(...any) // contains filtered or unexported fields }
CorruptedZip is a reader for a ZIP archive that reads from io.Reader instead of io.ReaderAt
func New ¶
func New(r io.Reader) *CorruptedZip
New returns a CorruptedZip instance that reads a ZIP archive.
func (*CorruptedZip) Body ¶ added in v0.1.0
func (cz *CorruptedZip) Body() io.Reader
Body returns the reader of the most recent file by a call to Scan.
func (*CorruptedZip) CRC32 ¶ added in v0.4.1
func (cz *CorruptedZip) CRC32() uint32
CRC32 returns the current file's CRC32 written in "local file header" or "data descriptor". When an "data descriptor" exists, it waits until file data stream is read all. This field is sed by Scan method
func (*CorruptedZip) Close ¶ added in v0.7.1
func (cz *CorruptedZip) Close()
Close releases resources used on the Scan method previous called.
func (*CorruptedZip) CompressedSize ¶ added in v0.4.0
func (cz *CorruptedZip) CompressedSize() uint64
CompressedSize returns the current file's compressed size written in "local file header" or "data descriptor". When an "data descriptor" exists, it waits until file data stream is read all. This field is sed by Scan method
func (*CorruptedZip) Err ¶ added in v0.1.0
func (cz *CorruptedZip) Err() error
Err returns the error encountered by the CorruptedZip.
func (*CorruptedZip) IsDir ¶ added in v0.7.1
func (cz *CorruptedZip) IsDir() bool
IsDir returns true when the current file is a directory.
func (*CorruptedZip) Method ¶ added in v0.4.1
func (cz *CorruptedZip) Method() uint16
Method returns the mothod to compress the current entry data
func (*CorruptedZip) Name ¶ added in v0.1.0
func (cz *CorruptedZip) Name() string
Name returns the name of the most recent file by a call to Scan.
func (*CorruptedZip) OriginalSize ¶ added in v0.4.0
func (cz *CorruptedZip) OriginalSize() uint64
originalSize returns the current file's uncompressed size written in "local file header" or "data descriptor". When an "data descriptor" exists, it waits until file data stream is read all. This field is sed by Scan method
func (*CorruptedZip) RegisterNameDecoder ¶ added in v0.7.1
func (cz *CorruptedZip) RegisterNameDecoder(f func([]byte) (string, error))
RegisterNameDecoder sets callback function to translate nonUTF8 filename to UTF8
func (*CorruptedZip) RegisterPasswordHandler ¶ added in v0.6.0
func (cz *CorruptedZip) RegisterPasswordHandler(f func(filename string) (password []byte, err error))
RegisterPasswordHandler sets a callback function to query password to an user.
func (*CorruptedZip) Scan ¶
func (cz *CorruptedZip) Scan() bool
Scan advances the CorruptedZip to the next single file in a ZIP archive.
type ErrPassword ¶ added in v0.4.0
type ErrPassword struct {
// contains filtered or unexported fields
}
ErrPassword is an error reporting that password is invalid.
func (*ErrPassword) Error ¶ added in v0.4.0
func (e *ErrPassword) Error() string
Error returns an error message.
func (*ErrPassword) Name ¶ added in v0.4.0
func (e *ErrPassword) Name() string
Name returns a entry filename where an error occured