Documentation ¶
Overview ¶
Package querylog defines the AdGuard DNS query log constants and types and provides implementations of the log.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { // RemoteIP is the remote IP address of the client. RemoteIP netip.Addr // RequestResult is the result of filtering the DNS request. RequestResult filter.Result // ResponseResult is the result of filtering the DNS response. ResponseResult filter.Result // Time is the time of receiving the request. Time time.Time // ProfileID is the detected profile ID, if any. ProfileID agd.ProfileID // DeviceID is the detected device ID, if any. DeviceID agd.DeviceID // ClientCountry is the detected country of the client's IP address, if any. ClientCountry geoip.Country // ResponseCountry is the detected country of the first IP in the response // sent to the client, if any. ResponseCountry geoip.Country // DomainFQDN is the fully-qualified name of the requested resource. DomainFQDN string // RequestID is the ID of the request. // // TODO(a.garipov): Remove once not necessary anymore. RequestID agd.RequestID // Elapsed is the time passed since the beginning of the request processing. Elapsed time.Duration // ClientASN is the detected autonomous system number of the client's IP // address, if any. ClientASN geoip.ASN // RequestType is the type of the resource record of the query. RequestType dnsmsg.RRType // ResponseCode is the response code sent to the client. ResponseCode dnsmsg.RCode // Protocol is the DNS protocol used. Protocol agd.Protocol // DNSSEC is set to true if the response was validated with DNSSEC. DNSSEC bool }
Entry is a single query log entry.
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
FileSystem is the file system implementation of the AdGuard DNS query log.
func NewFileSystem ¶
func NewFileSystem(c *FileSystemConfig) (l *FileSystem)
NewFileSystem creates a new file system query log. The log is safe for concurrent use. c must not be nil.
type FileSystemConfig ¶
type FileSystemConfig struct { // Logger is used for debug logging. Logger *slog.Logger // Path is the path to the log file. Path string // RandSeed is used to set the "rn" property in JSON objects. RandSeed uint64 }
FileSystemConfig is the configuration of the file system query log. All fields must not be empty.
Click to show internal directories.
Click to hide internal directories.