package
2.12.0+incompatible
Repository: https://github.com/adguardteam/adguarddns.git
Documentation: pkg.go.dev
# Functions
ContextWithRequestInfo returns a copy of the parent context with the request and server group information added.
DeviceTypeFromDNS converts a string into a valid device type.
HumanIDToLower returns a lowercase version of id.
MustRequestInfoFromContext is a helper that wraps a call to RequestInfoFromContext and panics if the request information isn't in the context.
NewDefaultRatelimiter returns a properly initialized *DefaultRatelimiter.
NewDeviceID converts a simple string into a DeviceID and makes sure that it's valid.
NewDeviceName converts a simple string into a DeviceName and makes sure that it's valid.
NewHumanID converts a simple string into a HumanID and makes sure that it's valid.
NewHumanIDLower converts a simple string into a HumanIDLower and makes sure that it's valid and lowercased.
NewHumanIDParser creates a new HumanIDParser.
NewProfileID converts a simple string into a ProfileID and makes sure that it's valid.
NewRequestID returns a new pseudorandom RequestID.
RequestIDFromContext returns the request ID from the context, if any.
RequestInfoFromContext returns the request information from the context, if any.
WithRequestID returns a copy of the parent context with the request ID added.
# Constants
DefaultDirPerm is the default set of permissions for directories.
DefaultPerm is the default set of permissions for non-executable files.
DefaultWOFlags is the default set of flags for opening a write-only files.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
DeviceType values.
The maximum and minimum lengths of a device ID.
MaxDeviceNameRuneLen is the maximum length of a human-readable device name in runes.
MaxHumanIDLen is the maximum length of a human-readable device ID.
MaxProfileIDLen is the maximum length of a profile ID.
The maximum and minimum lengths of a device ID.
MinHumanIDLen is the minimum length of a human-readable device ID.
Protocol value constants.
Protocol value constants.
Protocol value constants.
Protocol value constants.
Protocol value constants.
Protocol value constants.
RatelimitResultDrop means that the request should be dropped.
RatelimitResultPass means that the request should be passed.
RatelimitResultUseGlobal means that the request should be checked with the global ratelimit.
RequestIDLen is the length of a [RequestID] in bytes.
# Structs
ArgumentError is returned by functions when a value of an argument is invalid.
AuthSettings are the authentication settings of a device.
DefaultRatelimiter is the default [Ratelimiter] implementation.
Device is a device of a device attached to a profile.
DeviceResultAuthenticationFailure means that the profile and the device have been found, but the device should have been authenticated but could not.
DeviceResultError is a generic error result.
DeviceResultOK is a successful result that contains the profile and the device data.
DeviceResultUnknownDedicated means that the request has been made for a dedicated IP address with no corresponding profile or device data.
DNSCryptConfig is the DNSCrypt configuration of a DNS server.
EmptyDeviceFinder is an [DeviceFinder] implementation that does nothing.
FilteringGroup represents a set of filtering settings.
GlobalRatelimiter is a [Ratelimiter] implementation that always returns [RatelimitResultUseGlobal] from its Check method.
HumanIDParser normalizes and parses a HumanID from a string.
Profile contains information about an AdGuard DNS profile.
QUICConfig is the QUIC configuration of a DNS server.
RatelimitConfig are the rate-limiting settings of a profile.
RequestInfo contains information about the current request.
RequestServerInfo contains the information about the server and its group relevant to the request.
Server represents a single DNS server.
ServerBindData are the socket binding data for a server.
TCPConfig is the TCP configuration of a DNS server.
TLSConfig is the TLS configuration of a DNS server.
UDPConfig is the UDP configuration of a DNS server.
# Interfaces
DeviceFinder finds the user data, such as the profile and a device for a request.
DeviceResult is the sum type of the results that can be returned by a [DeviceFinder] implementation.
Ratelimiter is the interface for profiles' custom ratelimiters.
# Type aliases
DeviceID is the ID of a device attached to a profile.
DeviceName is the human-readable name of a device attached to a profile.
DeviceType is a type of a device as used in the Backend API.
FilteringGroupID is the ID of a filter group.
HumanID is a more human-readable identifier of a device.
HumanIDLower is the type for [HumanID] values that must be lowercase.
ProfileID is the ID of a profile.
Protocol is a DNS protocol.
RatelimitResult defines what to do with a request.
RequestID is the ID of a request.
ServerGroupName is the name of a server group.
ServerName is the name of a server.