Help us shape the future of Go! Take the 2026 Go Developer Survey

cleaner

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 5 Imported by: 1

README

文件清理工具

设置文件保留时间,自动清理过期文件

特性

  • 按指定时间周期清理
  • 指定检查频率
  • 指定每次清理文件(夹)个数
  • 指定跳过清理的文件规则

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FCleaner

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

func New

func New(root string, expire time.Duration, interval time.Duration, batchNum int64) *FCleaner

New new a Cleaner root - root directory expire - expire time interval - scan interval batchNum - every scan remove batch number limit

func (*FCleaner) SetFilter

func (fc *FCleaner) SetFilter(filter func(path string, info os.FileInfo) (willClean bool))

func (*FCleaner) StartCleanTask

func (fc *FCleaner) StartCleanTask()

StartCleanTask start the cleaning task

Jump to

Keyboard shortcuts

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