fleet/server/kolide/software.go
Zach Wasserman e8669818eb
Initial backend software inventory implementation (#678)
- Maintain software inventory with detail queries.
- Associated database migrations.
- Feature flagged off by default (see documentation for details to turn on).
- Documentation.
- New test helper for slice element comparisons skipping ID.
2021-04-26 08:44:22 -07:00

29 lines
973 B
Go

package kolide
type SoftwareStore interface {
SaveHostSoftware(host *Host) error
LoadHostSoftware(host *Host) error
}
// Software is a named and versioned piece of software installed on a device.
type Software struct {
ID uint `json:"id" db:"id"`
// Name is the reported name.
Name string `json:"name" db:"name"`
// Version is reported version.
Version string `json:"version" db:"version"`
// Source is the source of the data (osquery table name).
Source string `json:"source" db:"source"`
}
// HostSoftware is the set of software installed on a specific host
type HostSoftware struct {
// Software is the software information.
Software []Software `json:"software,omitempty"`
// Modified is a boolean indicating whether this has been modified since
// loading. If Modified is true, datastore implementations should save the
// data. We track this here because saving the software set is likely to be
// an expensive operation.
Modified bool `json:"-"`
}