mirror of
https://github.com/empayre/fleet.git
synced 2024-11-08 09:43:51 +00:00
24 lines
552 B
Go
24 lines
552 B
Go
package inmem
|
|
|
|
import (
|
|
"github.com/kolide/kolide-ose/server/kolide"
|
|
)
|
|
|
|
func (d *Datastore) NewFIMSection(fp *kolide.FIMSection) (*kolide.FIMSection, error) {
|
|
d.mtx.Lock()
|
|
defer d.mtx.Unlock()
|
|
fp.ID = d.nextID(fp)
|
|
d.filePaths[fp.ID] = fp
|
|
return fp, nil
|
|
}
|
|
|
|
func (d *Datastore) FIMSections() (kolide.FIMSections, error) {
|
|
d.mtx.Lock()
|
|
defer d.mtx.Unlock()
|
|
result := make(kolide.FIMSections)
|
|
for _, filePath := range d.filePaths {
|
|
result[filePath.SectionName] = append(result[filePath.SectionName], filePath.Paths...)
|
|
}
|
|
return result, nil
|
|
}
|