file

package
v0.0.0-...-3caf815 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZipArchiveFile

func CreateZipArchiveFile(saveAs string, files []ZipFile, ignoreError bool) (err error)

CreateZipArchiveFile create a zip archive file from files

func Exist

func Exist(path string) bool

Exist 判断文件是否存在

func FileGetContents

func FileGetContents(filename string) (string, error)

FileGetContents reads entire file into a string

func InsertSuffix

func InsertSuffix(src string, suffix string) string

InsertSuffix insert a suffix to filepath

func ReplaceExt

func ReplaceExt(src string, ext string) string

ReplaceExt replace ext for src

func Size

func Size(path string) int64

Size return file size for path

Types

type ZipFile

type ZipFile struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

ZipFile is a file wrapper contains filename and path

func CreateZipArchive

func CreateZipArchive(w io.Writer, files []ZipFile, ignoreError bool) ([]ZipFile, error)

CreateZipArchive create a zip archive

func CreateZipArchiveFileWithIgnored

func CreateZipArchiveFileWithIgnored(saveAs string, files []ZipFile, ignoreError bool) (ignoredFiles []ZipFile, err error)

CreateZipArchiveFileWithIgnored create a zip archive file from files, and return all ignored files

Jump to

Keyboard shortcuts

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