add support for a global temp path

Fixes #436
This commit is contained in:
Nicola Murino
2021-05-27 15:38:27 +02:00
parent 7a85c66ee7
commit 3b46e6a6fb
14 changed files with 76 additions and 23 deletions

View File

@@ -30,6 +30,7 @@ var (
// ErrVfsUnsupported defines the error for an unsupported VFS operation
ErrVfsUnsupported = errors.New("not supported")
credentialsDirPath string
tempPath string
sftpFingerprints []string
)
@@ -43,6 +44,16 @@ func GetCredentialsDirPath() string {
return credentialsDirPath
}
// SetTempPath sets the path for temporary files
func SetTempPath(fsPath string) {
tempPath = fsPath
}
// GetTempPath returns the path for temporary files
func GetTempPath() string {
return tempPath
}
// SetSFTPFingerprints sets the SFTP host key fingerprints
func SetSFTPFingerprints(fp []string) {
sftpFingerprints = fp