Documentation ¶
Overview ¶
Package home contains AdGuard Home's HTTP API methods.
Index ¶
Constants ¶
const ( ClientSourceNone clientSource = iota ClientSourceWHOIS ClientSourceARP ClientSourceRDNS ClientSourceDHCP ClientSourceHostsFile ClientSourcePersistent )
Clients information 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 { SafeSearch filtering.SafeSearch Name string IDs []string Tags []string BlockedServices []string Upstreams []string UseOwnSettings bool FilteringEnabled bool SafeBrowsingEnabled bool ParentalEnabled bool UseOwnBlockedServices bool IgnoreQueryLog bool IgnoreStatistics 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 is a client information about which has been obtained using the source described in the Source field.
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 Theme ¶ added in v0.107.22
type Theme string
Theme is an enum of all allowed UI themes.
Allowed Theme values.
Keep in sync with client/src/helpers/constants.js.
func (*Theme) UnmarshalText ¶ added in v0.107.22
UnmarshalText implements encoding.TextUnmarshaler interface for *Theme.
Source Files ¶
- auth.go
- authglinet.go
- authratelimiter.go
- client.go
- clients.go
- clientshttp.go
- clientstags.go
- config.go
- control.go
- controlinstall.go
- controlupdate.go
- dns.go
- home.go
- i18n.go
- middlewares.go
- mobileconfig.go
- options.go
- pprof.go
- profilehttp.go
- rdns.go
- service.go
- service_linux.go
- tls.go
- upgrade.go
- web.go
- whois.go