1
0
mirror of https://github.com/drakkan/sftpgo.git synced 2025-11-23 22:04:50 +02:00

add support for custom actions

Configurable custom commands and/or HTTP notifications on SFTP upload, download, delete or rename
This commit is contained in:
Nicola Murino
2019-07-27 09:38:09 +02:00
parent 70ae68a7c4
commit 48451a9924
12 changed files with 219 additions and 69 deletions

View File

@@ -27,9 +27,10 @@ func GetTimeAsMsSinceEpoch(t time.Time) int64 {
}
// ScanDirContents returns the number of files contained in a directory and their size
func ScanDirContents(path string) (int, int64, error) {
func ScanDirContents(path string) (int, int64, []string, error) {
var numFiles int
var size int64
var fileList []string
var err error
numFiles = 0
size = 0
@@ -42,13 +43,13 @@ func ScanDirContents(path string) (int, int64, error) {
if info != nil && info.Mode().IsRegular() {
size += info.Size()
numFiles++
fileList = append(fileList, path)
}
return err
})
}
return numFiles, size, err
return numFiles, size, fileList, err
}
func isDirectory(path string) (bool, error) {