fileutil

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressLogFiles

func CompressLogFiles(compressFile []string, filePath string)

func CreateFile

func CreateFile(filename string) (*os.File, error)

CreateFile creates a new file in the given path, creating parent directories as necessary

func GenerateFileNme

func GenerateFileNme(path string, name string, suffix string, clock interface{ Now() time.Time }, timeFormat string) string

产生新的文件名(用于按大小分割文件)

func GenerateFn

func GenerateFn(pattern *strftime.Strftime, clock interface{ Now() time.Time }, rotationTime time.Duration) string

GenerateFn creates a file name based on the pattern, the current time, and the rotation time.

The bsase time that is used to generate the filename is truncated based on the rotation time.

func GenerateFnForFileSize

func GenerateFnForFileSize(pattern *strftime.Strftime, clock interface{ Now() time.Time }) string

产生新的文件名(用于按大小分割文件)

func GetNewFileName

func GetNewFileName(filePath string, fileName string, rotationSize int64, clock interface{ Now() time.Time }) string

func ParseTimeFromFileName

func ParseTimeFromFileName(fileNameTimeFormat string, fileName string, clock time.Time) time.Time

Types

This section is empty.

Jump to

Keyboard shortcuts

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