cleaner

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package cleaner provides functions to clean old .ts files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(scanDirectory string, opts ...Option) error

Clean removes old .ts files from the scanDirectory.

func CleanPeriodically

func CleanPeriodically(
	ctx context.Context,
	scanDirectory string,
	interval time.Duration,
	opts ...Option,
)

CleanPeriodically runs the Clean function periodically.

func Scan

func Scan(
	scanDirectory string,
	opts ...Option,
) (queueForDeletion []string, queueForRenaming []string, err error)

Scan scans the scanDirectory for old .ts files.

Types

type Option

type Option func(*Options)

Option is the option for the cleaner.

func WithDryRun

func WithDryRun() Option

WithDryRun sets the dryRun option.

func WithEligibleAge

func WithEligibleAge(d time.Duration) Option

WithEligibleAge sets the minimum time since the modtime of the file to be deleted.

func WithoutProbe

func WithoutProbe() Option

WithoutProbe disables the probe.

type Options

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

Options are the options for the cleaner.

Jump to

Keyboard shortcuts

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