removefiles

package
v0.0.0-...-eae3871 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ActivityName = "remove-files-activity"

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

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

func NewActivity

func NewActivity(cfg Config) *Activity

func (*Activity) Execute

func (a *Activity) Execute(ctx context.Context, params *ActivityParams) (*ActivityResult, error)

Execute deletes any file or directory in params.Path (and sub-directories) whose name matches one of the values in params.RemoveNames, and returns a count of deleted items. A deleted directory is counted as one deleted item no matter how many items the directory contains.

RemoveNames should be a comma delimited list of file names, e.g. "Thumbs.db,.DS_Store". Any Unicode whitespace characters are trimmed from each name in the list, so "Thumbs.db, .DS_Store\n" is equivalent to previous example.

If RemoveNames is an empty string, then Execute returns without deleting anything.

type ActivityParams

type ActivityParams struct {
	// Path is the directory from which files should be removed.
	Path string
}

type ActivityResult

type ActivityResult struct {
	// Count is the number of files removed from Path.
	Count int
}

type Config

type Config struct {
	// RemoveNames is the comma separated list of filenames that should be
	// removed from all transfers.
	RemoveNames string
}

Jump to

Keyboard shortcuts

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