fkfile

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 7 Imported by: 1

README

fk_file

golang file utilities

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressFile

func CompressFile(src, dst string, removeSrc bool) error

Compress a file with gz algorithm

func EnsureDir

func EnsureDir(path string) error

EnsureDir ensures that the directory exists

func ReadTextFile

func ReadTextFile(filename string) (text string, err error)

ReadTextFile returns text of a file

Types

type ZipFile added in v1.1.0

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

ZipFile defines a zip file

func NewZipFile added in v1.1.0

func NewZipFile(file *os.File) (zipFile *ZipFile, err error)

NewZipFile creates a new zip file

func (*ZipFile) AddEntry added in v1.1.0

func (zipFile *ZipFile) AddEntry(name string, reader io.Reader) error

AddEntry adds a file to the zip file

func (*ZipFile) AddFile added in v1.1.0

func (zipFile *ZipFile) AddFile(name string) error

AddFile adds a file to the zip file

func (*ZipFile) Close added in v1.1.0

func (zipFile *ZipFile) Close() error

Close closes the zip file

Jump to

Keyboard shortcuts

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