Documentation
¶
Overview ¶
Package home contains AdGuard Home's HTTP API methods.
Index ¶
Constants ¶
const ( ClientSourceWHOIS clientSource = iota ClientSourceARP ClientSourceRDNS ClientSourceDHCP ClientSourceHostsFile )
Client sources. The order determines the priority.
const MaxConnReadSize = 64 * 1024
MaxConnReadSize is an upper limit in bytes for reading from net.Conn.
const MaxFileSize = 1024 * 1024
MaxFileSize is a maximum file length in bytes.
const PasswordMinRunes = 8
PasswordMinRunes is the minimum length of user's password in runes.
Variables ¶
var Context homeContext
Context - a global context object
var GLMode bool
GLMode - enable GL-Inet compatibility mode
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth - global object
func InitAuth ¶
func InitAuth(dbFilename string, users []webUser, sessionTTL uint32, rateLimiter *authRateLimiter) *Auth
InitAuth - create a global object
func (*Auth) AuthRequired ¶
AuthRequired - if authentication is required
func (*Auth) RemoveSession ¶
RemoveSession - remove session
type Client ¶
type Client struct {
Name string
IDs []string
Tags []string
BlockedServices []string
Upstreams []string
UseOwnSettings bool
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool
// contains filtered or unexported fields
}
Client contains information about persistent clients.
type RDNS ¶
type RDNS struct {
// contains filtered or unexported fields
}
RDNS resolves clients' addresses to enrich their metadata.
func NewRDNS ¶ added in v0.106.0
func NewRDNS( exchanger dnsforward.RDNSExchanger, clients *clientsContainer, usePrivate bool, ) (rDNS *RDNS)
NewRDNS creates and returns initialized RDNS.
type RuntimeClient ¶ added in v0.106.0
type RuntimeClient struct {
WHOISInfo *RuntimeClientWHOISInfo
Host string
Source clientSource
}
RuntimeClient information
type RuntimeClientWHOISInfo ¶ added in v0.107.0
type RuntimeClientWHOISInfo struct {
City string `json:"city,omitempty"`
Country string `json:"country,omitempty"`
Orgname string `json:"orgname,omitempty"`
}
RuntimeClientWHOISInfo is the filtered WHOIS data for a runtime client.
type WHOIS ¶ added in v0.107.0
type WHOIS struct {
// contains filtered or unexported fields
}
WHOIS - module context