This commit is contained in:
Hector 2021-10-12 20:45:09 +01:00
parent 3e56339c71
commit ac3681edb1
4 changed files with 11 additions and 12 deletions

View File

@ -12,11 +12,11 @@ const (
)
type AppSettings struct {
VersionMode bool
MetricsPort int
Fail2BanDbPath string
Fail2BanSocketPath string
FileCollectorPath string
VersionMode bool
MetricsPort int
Fail2BanDbPath string
Fail2BanSocketPath string
FileCollectorPath string
FileCollectorEnabled bool
}

View File

@ -6,14 +6,14 @@ import (
)
type Collector struct {
enabled bool
enabled bool
folderPath string
fileMap map[string]*fileData
fileMap map[string]*fileData
}
type fileData struct {
readErrors int
fileName string
readErrors int
fileName string
fileContents []byte
}

View File

@ -31,8 +31,8 @@ func (c *Collector) collectFileContents() {
continue
}
c.fileMap[fileName] = &fileData{
readErrors: 0,
fileName: fileName,
readErrors: 0,
fileName: fileName,
}
fullPath := filepath.Join(c.folderPath, file.Name())

View File

@ -18,4 +18,3 @@ func (c *Collector) WriteTextFileMetrics(w http.ResponseWriter, r *http.Request)
}
}
}