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 (*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 }
Click to show internal directories.
Click to hide internal directories.