kopy

package
v0.0.0-...-f8e3b86 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package kopy stored all the copy operations for gokopy.

Index

Constants

View Source
const ComFileFormat = ".tar.gz"

ComFileFormat compression file extentions.

View Source
const ComSingleFileFormat = ".zip"

ComSingleFileFormat use zip compression format for any single file need to be compressed.

Variables

View Source
var BKMaxAgeLogInDays int = 0 // 0 days means, it won't delete older backup logs

BKMaxAgeLogInDays get the max age of a log files in days.

View Source
var BKMaxLogFileSizeInMB int = 100 // mb

BKMaxLogFileSizeInMB gets the max log file size value in megabytes.

View Source
var NumFilesCopied int = 0

NumFilesCopied counts the number of files copied.

View Source
var NumFoldersCopied int = 0

NumFoldersCopied counts the number of folders copied.

Functions

func AddFileToZip

func AddFileToZip(zipWriter *zip.Writer, filename string) error

AddFileToZip where to

func ComFiles

func ComFiles(dest string, files []string) error

ComFiles compresses one or many files into a single zip archive file.

func CompressDIR

func CompressDIR(src string, buf io.Writer, ignoreFT []string) error

CompressDIR compressed the entire folder or directory.

func CopyDir

func CopyDir(src, dst string, isLogCopiedFile bool) (int, int, error)

CopyDir copies a whole directory recursively and its sub-directories.

func CopyFile

func CopyFile(src, dst, bareDst string) error

CopyFile copy a single file from the source to the destination.

func DIRCopyFiles

func DIRCopyFiles(src, dst string) error

DIRCopyFiles copy a single file from the source to the destination.

func ExtractTarGz

func ExtractTarGz(gzipStream io.Reader, src string, isLogCopiedFile bool) error

ExtractTarGz extracts the tar.gz compressed file.

func FileNameWOExt

func FileNameWOExt(fileName string) string

FileNameWOExt gets the filename without its file extension.

func InitConfig

func InitConfig()

InitConfig reads in config file and ENV variables if set.

func LoadInitVars

func LoadInitVars()

LoadInitVars is to load common configurations during init method.

func Unzip

func Unzip(src string, isLogCopiedFile bool) error

Unzip will decompress a zip archive, moving all files and folders within the zip file (parameter 1) to an output directory (parameter 2).

func WalkDIRModLatest

func WalkDIRModLatest(src, dst string, modDays int, logCopiedFile bool) error

WalkDIRModLatest copies the latest modified files based on the modified date and time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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