zipper

package module
v0.0.0-...-2ac2d53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*FileInfo

	io.ReadCloser
}

type FileHeader

type FileHeader struct {
	Comment      string
	Modified     time.Time
	Uncompressed bool
}

type FileInfo

type FileInfo struct {
	FileHeader
	Size int64
	// contains filtered or unexported fields
}

func (*FileInfo) Open

func (fi *FileInfo) Open(ctx context.Context) (*File, error)

func (*FileInfo) OpenAsGzipOrUncompressed

func (fi *FileInfo) OpenAsGzipOrUncompressed(ctx context.Context, allowGzip bool) (*File, bool, int64, error)

OpenAsGzipOrUncompressed returns the optimal file content based on how it is stored within the zip archive. If the compression method is "store" or the client doesn't support gzip, an uncompressed stream is returned. If the compression method is "deflate" and the client supports gzip, the contents is returned without being decompressed, but wrapped as a gzip format. Other methods return an error.

type FileWriter

type FileWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*FileWriter) ContentOffset

func (fw *FileWriter) ContentOffset() int64

ContentOffset is the offset relative to the start of the ZIP archive. FileWriter will start writing at this position. Clients can keep track of this offset if they want to efficiently download the file without reading the central directory entry.

type Pack

type Pack struct {
	// contains filtered or unexported fields
}

func OpenPack

func OpenPack(ctx context.Context, proj *uplink.Project, bucket, key string) (*Pack, error)

func (*Pack) AsFS

func (p *Pack) AsFS(ctx context.Context) fs.FS

func (*Pack) FileInfo

func (p *Pack) FileInfo(ctx context.Context, name string) (*FileInfo, error)

func (*Pack) IsPackagePack

func (p *Pack) IsPackagePack() bool

func (*Pack) List

func (p *Pack) List() []string

TODO

func (*Pack) Open

func (p *Pack) Open(ctx context.Context, name string) (*File, error)

func (*Pack) PackInfo

func (p *Pack) PackInfo() *uplink.Object

type PendingPack

type PendingPack struct {
	// contains filtered or unexported fields
}

func CreatePack

func CreatePack(ctx context.Context, proj *uplink.Project, bucket, key string,
	options *uplink.UploadOptions) (*PendingPack, error)

func (*PendingPack) Abort

func (p *PendingPack) Abort() error

func (*PendingPack) Add

func (p *PendingPack) Add(ctx context.Context, name string, options *FileHeader) (*FileWriter, error)

func (*PendingPack) Commit

func (p *PendingPack) Commit(ctx context.Context) error

func (*PendingPack) SetCustomMetadata

func (p *PendingPack) SetCustomMetadata(custom uplink.CustomMetadata)

Directories

Path Synopsis
cmd
Package zip provides support for reading and writing ZIP archives.
Package zip provides support for reading and writing ZIP archives.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL