package zip

Import Path
	archive/zip (on golang.org and go.dev)

Dependency Relation
	imports 14 packages, and imported by 0 packages

Involved Source Files
	    reader.go
	    register.go
	d-> struct.go
	    writer.go

Exported Type Names

type Compressor (func) A Compressor returns a new compressing writer, writing to w. The WriteCloser's Close method must be used to flush pending data to w. The Compressor itself must be safe to invoke from multiple goroutines simultaneously, but each returned writer will be used only by one goroutine at a time. func RegisterCompressor(method uint16, comp Compressor) func (*Writer).RegisterCompressor(method uint16, comp Compressor)
type Decompressor (func) A Decompressor returns a new decompressing reader, reading from r. The ReadCloser's Close method must be used to release associated resources. The Decompressor itself must be safe to invoke from multiple goroutines simultaneously, but each returned reader will be used only by one goroutine at a time. func RegisterDecompressor(method uint16, dcomp Decompressor) func (*Reader).RegisterDecompressor(method uint16, dcomp Decompressor)
type FileHeader (struct) FileHeader describes a file within a zip file. See the zip spec for details. CRC32 uint32 Comment string CompressedSize uint32 CompressedSize64 uint64 CreatorVersion uint16 ExternalAttrs uint32 Extra []byte Flags uint16 Method uint16 Modified time.Time ModifiedDate uint16 ModifiedTime uint16 Name string NonUTF8 bool ReaderVersion uint16 UncompressedSize uint32 UncompressedSize64 uint64 (*T) FileInfo() os.FileInfo (*T) ModTime() time.Time (*T) Mode() (mode os.FileMode) (*T) SetModTime(t time.Time) (*T) SetMode(mode os.FileMode) func FileInfoHeader(fi os.FileInfo) (*FileHeader, error) func (*Writer).CreateHeader(fh *FileHeader) (io.Writer, error)
type ReadCloser (struct) Reader Reader Reader.Comment string Reader.File []*File (*T) Close() error (*T) RegisterDecompressor(method uint16, dcomp Decompressor) *T : io.Closer func OpenReader(name string) (*ReadCloser, error)
type Reader (struct) Comment string File []*File (*T) RegisterDecompressor(method uint16, dcomp Decompressor) func NewReader(r io.ReaderAt, size int64) (*Reader, error)
type Writer (struct) Writer implements a zip file writer. (*T) Close() error (*T) Create(name string) (io.Writer, error) (*T) CreateHeader(fh *FileHeader) (io.Writer, error) (*T) Flush() error (*T) RegisterCompressor(method uint16, comp Compressor) (*T) SetComment(comment string) error (*T) SetOffset(n int64) *T : io.Closer func NewWriter(w io.Writer) *Writer
Exported Values
const Deflate uint16 = 8 // DEFLATE compressed Compression methods.
func FileInfoHeader(fi os.FileInfo) (*FileHeader, error) FileInfoHeader creates a partially-populated FileHeader from an os.FileInfo. Because os.FileInfo's Name method returns only the base name of the file it describes, it may be necessary to modify the Name field of the returned header to provide the full path name of the file. If compression is desired, callers should set the FileHeader.Method field; it is unset by default.
func NewReader(r io.ReaderAt, size int64) (*Reader, error) NewReader returns a new Reader reading from r, which is assumed to have the given size in bytes.
func NewWriter(w io.Writer) *Writer NewWriter returns a new Writer writing a zip file to w.
func OpenReader(name string) (*ReadCloser, error) OpenReader will open the Zip file specified by name and return a ReadCloser.
func RegisterCompressor(method uint16, comp Compressor) RegisterCompressor registers custom compressors for a specified method ID. The common methods Store and Deflate are built in.
func RegisterDecompressor(method uint16, dcomp Decompressor) RegisterDecompressor allows custom decompressors for a specified method ID. The common methods Store and Deflate are built in.
const Store uint16 = 0 // no compression Compression methods.