file

package
v0.0.0-...-d7d4aa8 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkdirIfNotExist

func MkdirIfNotExist(path string) error

MkdirIfNotExist *

  • @Description: path if not exist then create this path (dir)
  • @param path
  • @return error

func PathDelete

func PathDelete(path string) error

PathDelete *

  • @Description: del path or file
  • @param path
  • @return error

func PathExistOrNot

func PathExistOrNot(path string) (bool, error)

PathExistOrNot *

  • @Description: path or file exist or not
  • @param path
  • @return bool
  • @return error
Example
fPath := "./test.txt"
b, err := PathExistOrNot(fPath)
if err != nil {
	println(err)
}
if b {
	println("file path is exist")
}
Output:

Types

type CompressType

type CompressType int32
const (
	CompressNil CompressType = iota
	CompressZip
)

type Compressor

type Compressor interface {
	Compress(output string, files ...*os.File) error
	UnCompress(zipFile, output string) error
}

func NewCompressor

func NewCompressor(compressType CompressType) Compressor

NewCompressor *

  • @Description:
  • @param compressType
  • @return Compressor

type ZipCompress

type ZipCompress struct {
	Type CompressType
}

ZipCompress "Zip Compress"

func (*ZipCompress) Compress

func (c *ZipCompress) Compress(output string, files ...*os.File) error

Compress *

  • @Description:
  • @receiver c
  • @param output
  • @param files
  • @return error

func (*ZipCompress) UnCompress

func (c *ZipCompress) UnCompress(zipFile, output string) error

UnCompress *

  • @Description:
  • @receiver c
  • @param zipFile
  • @param output
  • @return error

Jump to

Keyboard shortcuts

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