cleaner

package
v1.8.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 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