Documentation
¶
Index ¶
- type Database
- func (d *Database) CleanupOldData(retentionDays int) error
- func (d *Database) Close() error
- func (d *Database) GetLatestSNMPResult(host string) (*SNMPResult, error)
- func (d *Database) GetOpenPortsForHost(host string) ([]int, error)
- func (d *Database) GetSNMPDevices() ([]string, error)
- func (d *Database) GetTopTalkers(n int) (map[string]int64, error)
- func (d *Database) GetTraceResults(target string) ([]TraceResult, error)
- func (d *Database) SaveSNMPResult(result interface{}) error
- func (d *Database) SaveScanResults(results []interface{}) error
- func (d *Database) SaveTraceResults(target string, results []interface{}) error
- func (d *Database) SaveTrafficStats(stats map[string]int64) error
- type InterfaceInfo
- type SNMPResult
- type ScanResult
- type TraceResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database handles SQLite storage
func NewDatabase ¶
NewDatabase creates a new SQLite database connection
func (*Database) CleanupOldData ¶
CleanupOldData removes data older than the specified retention period
func (*Database) GetLatestSNMPResult ¶
func (d *Database) GetLatestSNMPResult(host string) (*SNMPResult, error)
GetLatestSNMPResult retrieves the latest SNMP result for a specific host
func (*Database) GetOpenPortsForHost ¶
GetOpenPortsForHost retrieves all open ports found for a specific host
func (*Database) GetSNMPDevices ¶
GetSNMPDevices retrieves a list of all SNMP devices from the database
func (*Database) GetTopTalkers ¶
GetTopTalkers retrieves the top n hosts by traffic volume
func (*Database) GetTraceResults ¶
func (d *Database) GetTraceResults(target string) ([]TraceResult, error)
GetTraceResults retrieves traceroute results for a specific target
func (*Database) SaveSNMPResult ¶
SaveSNMPResult saves SNMP polling results to the database
func (*Database) SaveScanResults ¶
SaveScanResults saves port scan results to the database
func (*Database) SaveTraceResults ¶
SaveTraceResults saves traceroute results to the database
type InterfaceInfo ¶
type InterfaceInfo struct {
Index int
Name string
Description string
Type string
Speed uint64
AdminStatus int
OperStatus int
InOctets uint64
OutOctets uint64
}
InterfaceInfo contains information about a network interface
type SNMPResult ¶
type SNMPResult struct {
Host string
SysName string
SysDescr string
SysUpTime string
SysContact string
SysLocation string
Interfaces []InterfaceInfo
Timestamp time.Time
}
SNMPResult represents SNMP data stored in the database
type ScanResult ¶
ScanResult represents a port scan result stored in the database