zdpgo_zip

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 7 Imported by: 0

README

zdpgo_zip

golang实现zip压缩和解压缩

版本历史

  • v0.1.0 2022/05/30 新增:压缩和解压缩

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug       bool   `yaml:"debug" json:"debug"`
	LogFilePath string `yaml:"log_file_path" json:"log_file_path"`
}

type Zip

type Zip struct {
	Config *Config
	Log    *zdpgo_log.Log
}

func New

func New() *Zip

func NewWithConfig

func NewWithConfig(config *Config) *Zip

func (*Zip) Unzip

func (z *Zip) Unzip(zipFileName, saveDir string) error

Unzip 解压缩文件夹

func (*Zip) UnzipToCurrentDir

func (z *Zip) UnzipToCurrentDir(zipFileName string) error

UnzipToCurrentDir 解压到当前目录

func (*Zip) UnzipToCurrentDirAndDelete

func (z *Zip) UnzipToCurrentDirAndDelete(zipFileName string) error

UnzipToCurrentDirAndDelete 解压到当前目录并删除zip文件

func (*Zip) Zip

func (z *Zip) Zip(dirPath, targetName string) error

Zip 压缩文件夹

func (*Zip) ZipAndDelete

func (z *Zip) ZipAndDelete(dirPath, targetName string) error

ZipAndDelete 压缩并删除文件夹

Jump to

Keyboard shortcuts

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