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 { type AppSettings struct {
VersionMode bool VersionMode bool
MetricsPort int MetricsPort int
Fail2BanDbPath string Fail2BanDbPath string
Fail2BanSocketPath string Fail2BanSocketPath string
FileCollectorPath string FileCollectorPath string
FileCollectorEnabled bool FileCollectorEnabled bool
} }

View File

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

View File

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

View File

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