cleantemp

package
v3.63.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: AGPL-3.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanTempDir

func CleanTempDir(ctx logContext.Context) error

CleanTempDir removes orphaned temp directories that do not contain running PID values.

func MkdirTemp

func MkdirTemp() (string, error)

MkdirTemp returns a temporary directory path formatted as: trufflehog-<pid>-<randint>

func RunCleanupLoop added in v3.63.2

func RunCleanupLoop(ctx logContext.Context)

RunCleanupLoop runs a loop that cleans up orphaned directories every 15 seconds

Types

type CleanTemp

type CleanTemp interface {
	// CleanTempDir removes orphaned directories from sources. ex: Git
	CleanTempDir(ctx logContext.Context, dirName string, pid int) error
	// CleanTempFiles removes orphaned files/artifacts from sources. ex: Artifactory
	CleanTempFiles(ctx context.Context, fileName string, pid int) error
}

CleanTemp is used to remove orphaned artifacts from aborted scans.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳