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 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 // BlockedServices is the configuration of blocked services of a client. BlockedServices *filtering.BlockedServices Name string IDs []string Tags []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.
func (*Client) ShallowClone ¶ added in v0.107.30
ShallowClone returns a deep copy of the client, except upstreamConfig, safeSearchConf, SafeSearch fields, because it's difficult to copy them.
type DHCP ¶ added in v0.107.33
type DHCP interface { // Leases returns all the DHCP leases. Leases() (leases []*dhcpsvc.Lease) // HostByIP returns the hostname of the DHCP client with the given IP // address. The address will be netip.Addr{} if there is no such client, // due to an assumption that a DHCP client must always have an IP address. HostByIP(ip netip.Addr) (host string) // MACByIP returns the MAC address for the given IP address leased. It // returns nil if there is no such client, due to an assumption that a DHCP // client must always have a MAC address. MACByIP(ip netip.Addr) (mac net.HardwareAddr) }
DHCP is an interface for accessing DHCP lease data the [clientsContainer] needs.
type RuntimeClient ¶ added in v0.106.0
type RuntimeClient struct { // WHOIS is the filtered WHOIS data of a client. WHOIS *whois.Info // Host is the host name of a client. Host string // Source is the source from which the information about the client has // been obtained. Source clientSource }
RuntimeClient is a client information about which has been obtained using the source described in the Source field.
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.