gcompress

package
v0.0.0-...-bad6181 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CompNone   = enrollComp("none")
	CompZip    = enrollComp("zip")
	Comp7Z     = enrollComp("7z")
	CompSnappy = enrollComp("snappy")
	CompS2     = enrollComp("s2")
	CompGzip   = enrollComp("gzip")
	CompPgZip  = enrollComp("pgzip")
	CompZStd   = enrollComp("zstd")
	CompZLib   = enrollComp("zlib")
	CompFlate  = enrollComp("flate")

	LevelStore   = enrollLevel("store")
	LevelDeflate = enrollLevel("deflate")

	EncryptAES128 = enrollEncrypt("aes-128")
	EncryptAES192 = enrollEncrypt("aes-192")
	EncryptAES256 = enrollEncrypt("aes-256")
)

Functions

func CompressGzip

func CompressGzip(buf []byte) []byte

CompressGzip compress using Gzip

func UnCompressGzip

func UnCompressGzip(buf []byte) ([]byte, error)

UnCompressGzip un-compress using Gzip

Types

type BufferCompress

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

func NewBufferCompress

func NewBufferCompress(inBuf []byte, outBuf bytes.Buffer, algo Comp) (*BufferCompress, error)

type Comp

type Comp string

func ToComp

func ToComp(algo string) (Comp, error)

type CompFile

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

func NewCompFile

func NewCompFile(filename string, compAlgo Comp, password string, param *CompParam) (*CompFile, error)

NewCompFile open/create compressed file.

func (*CompFile) AddFile

func (cf *CompFile) AddFile(filenameInsideZip string, encrypt Encrypt, level Level) (gio.WriteFlushCloser, error)

AddFile adds new file into zip file.

func (*CompFile) Close

func (cf *CompFile) Close() error

Close implements io.ReadWriteCloser.

func (*CompFile) ReadFile

func (cf *CompFile) ReadFile(filenameInsideZip string) (io.ReadCloser, error)

func (*CompFile) Walk

func (cf *CompFile) Walk() (dirs []string, files []string, err error)

type CompParam

type CompParam struct {
	Level int
}

func (CompParam) Verify

func (p CompParam) Verify(algo Comp) error

type CompReadWriteCloser

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

CompReadWriteCloser implements io.ReadWriteCloser

func NewCompReadWriteCloser

func NewCompReadWriteCloser(compAlgo Comp, param *CompParam, rwc io.ReadWriteCloser) (*CompReadWriteCloser, error)

NewCompReadWriteCloser create compress-orient ReadWriteCloser.

func (*CompReadWriteCloser) Close

func (c *CompReadWriteCloser) Close() error

Close implements io.ReadWriteCloser.

func (*CompReadWriteCloser) Read

func (c *CompReadWriteCloser) Read(p []byte) (n int, err error)

Read implements io.ReadWriteCloser.

func (*CompReadWriteCloser) Write

func (c *CompReadWriteCloser) Write(p []byte) (n int, err error)

Write implements io.ReadWriteCloser.

type Encrypt

type Encrypt string

type Level

type Level string

Directories

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

Jump to

Keyboard shortcuts

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