Documentation
¶
Index ¶
- type SQLiteBackend
- func (back *SQLiteBackend) Initialize(dbpath string) error
- func (back *SQLiteBackend) NotifyAboutSender(sender string)
- func (back *SQLiteBackend) NotifyAboutSeverity(severity *log.Severity)
- func (back *SQLiteBackend) Shutdown()
- func (back *SQLiteBackend) Vacuum()
- func (back *SQLiteBackend) Write(entry log.Entry) error
- type SQLiteTables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteBackend ¶
type SQLiteBackend struct {
log.CommonBackend
// Tables defines the table names to use for senders, severities, and logs.
Tables SQLiteTables
// contains filtered or unexported fields
}
SQLiteBackend stores log entries in a SQLite database with normalized tables.
func (*SQLiteBackend) Initialize ¶
func (back *SQLiteBackend) Initialize(dbpath string) error
Initialize opens the database, ensures tables exist, and prepares statements.
func (*SQLiteBackend) NotifyAboutSender ¶
func (back *SQLiteBackend) NotifyAboutSender(sender string)
NotifyAboutSender caches the sender row id, inserting it when necessary.
func (*SQLiteBackend) NotifyAboutSeverity ¶
func (back *SQLiteBackend) NotifyAboutSeverity(severity *log.Severity)
NotifyAboutSeverity caches the severity row id, inserting it when necessary.
func (*SQLiteBackend) Shutdown ¶
func (back *SQLiteBackend) Shutdown()
Shutdown vacuums the database to reclaim space.
func (*SQLiteBackend) Vacuum ¶
func (back *SQLiteBackend) Vacuum()
Vacuum runs the SQLite VACUUM command. It is recommended at program termination.
func (*SQLiteBackend) Write ¶
func (back *SQLiteBackend) Write(entry log.Entry) error
Write inserts the entry into the log table after ensuring gate compliance.
type SQLiteTables ¶
type SQLiteTables struct {
// Severities is the table storing severity metadata.
Severities string
// Senders is the table storing sender metadata.
Senders string
// Log is the table storing the actual log entries.
Log string
// Packages stores package names to eliminate duplication.
Packages string
// Files stores file paths to eliminate duplication.
Files string
// Meta stores JSON blobs describing entry metadata.
Meta string
}
SQLiteTables lists the names of the supporting tables.
Source Files
¶
- Backend.go
- Compliance.go
- Configuration.go
- migrations_embed.go
- migrations_runner.go
Click to show internal directories.
Click to hide internal directories.