Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
// Name 文件名(相对路径),来源于 Central Directory/File Header
Name string
// CompressedSize 压缩后的大小(字节数)
// 对应 Central Directory 中的 compressed size 字段
CompressedSize uint64
// UncompressedSize 解压后的大小(字节数)
// 对应 Central Directory 中的 uncompressed size 字段
UncompressedSize uint64
// Compression 压缩算法标识
// 0 = Store(无压缩),8 = Deflate,其它见 ZIP 规范
Compression uint16
// Offset 文件数据在 ZIP 中的偏移量(相对于整个 ZIP 文件的开头)
// 一般指向对应 Local File Header 的起始位置
Offset uint64
// contains filtered or unexported fields
}
File 表示 ZIP 文件中的一个文件条目(Central Directory 中的记录)
type Reader ¶
Reader 远程 ZIP Reader
func NewReader ¶
OpenReader 打开远程 ZIP 并解析目录
EOCD(End of Central Directory) 标准ZIP --------------------------------------------------------- 4 bytes End of central dir signature (0x06054b50) 2 bytes Number of this disk 2 bytes Number of the disk with the start of the central directory 2 bytes Total number of entries in the central directory on this disk 2 bytes Total number of entries in the central directory 4 bytes Size of the central directory 4 bytes Offset of start of central directory with respect to the starting disk number 2 bytes ZIP file comment length ZIP64 --------------------------------------------------------- 4 bytes Signature 0x06064b50 8 bytes Size of zip64 end of central directory record 2 bytes Version made by 2 bytes Version needed to extract 4 bytes Number of this disk 4 bytes Number of the disk with the start of the central directory 8 bytes Total number of entries in the central directory on this disk 8 bytes Total number of entries in the central directory 8 bytes Size of the central directory 8 bytes Offset of start of central directory
Click to show internal directories.
Click to hide internal directories.