Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogEntryFields ¶
Types ¶
type DatabaseWriter ¶
type DatabaseWriter struct {
// contains filtered or unexported fields
}
func NewDatabaseWriter ¶
func NewDatabaseWriter(ctx context.Context, dbType config.QueryLogType, target string, logRetentionDays uint64, dbFlushPeriod time.Duration, ) (*DatabaseWriter, error)
func (*DatabaseWriter) CleanUp ¶
func (d *DatabaseWriter) CleanUp()
func (*DatabaseWriter) Write ¶
func (d *DatabaseWriter) Write(entry *LogEntry)
type DnstapWriter ¶ added in v0.33.0
type DnstapWriter struct {
// contains filtered or unexported fields
}
func NewDnstapWriter ¶ added in v0.33.0
func (*DnstapWriter) CleanUp ¶ added in v0.33.0
func (d *DnstapWriter) CleanUp()
CleanUp implements the retention-cleanup hook of the Writer interface. dnstap is a streaming export with nothing to prune, so this is a no-op; lifecycle teardown happens in Close instead.
func (*DnstapWriter) Close ¶ added in v0.33.0
func (d *DnstapWriter) Close() error
Close signals shutdown: it stops accepting frames so the run goroutine stops and closes the socket itself. It deliberately does not touch d.writer — run owns it, and the dnstap socketWriter is not safe for a Close concurrent with an in-flight WriteFrame — and never waits on an in-flight WriteFrame, so a stuck collector connection cannot hang shutdown.
func (*DnstapWriter) Write ¶ added in v0.33.0
func (d *DnstapWriter) Write(entry *LogEntry)
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
func NewCSVWriter ¶
func NewCSVWriter(target string, perClient bool, logRetentionDays uint64) (*FileWriter, error)
func (*FileWriter) Write ¶
func (d *FileWriter) Write(entry *LogEntry)
type LogEntry ¶
type LogEntry struct {
Start time.Time
ClientIP string
ClientNames []string
DurationMs int64
ResponseReason string
ResponseType string
ResponseCode string
QuestionType string
QuestionName string
Answer string
BlockyInstance string
QueryWire []byte
ResponseWire []byte
QueryTime time.Time
ResponseTime time.Time
SocketProtocol model.RequestProtocol
}
type LoggerWriter ¶
type LoggerWriter struct {
// contains filtered or unexported fields
}
func NewLoggerWriter ¶
func NewLoggerWriter() *LoggerWriter
func (*LoggerWriter) CleanUp ¶
func (d *LoggerWriter) CleanUp()
func (*LoggerWriter) Write ¶
func (d *LoggerWriter) Write(entry *LogEntry)
type NoneWriter ¶
type NoneWriter struct{}
func NewNoneWriter ¶
func NewNoneWriter() *NoneWriter
func (*NoneWriter) CleanUp ¶
func (d *NoneWriter) CleanUp()
func (*NoneWriter) Write ¶
func (d *NoneWriter) Write(*LogEntry)
Click to show internal directories.
Click to hide internal directories.