mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-15 18:08:30 -07:00
all: upd docs
This commit is contained in:
parent
1118006161
commit
21e03e4d5a
@ -154,8 +154,8 @@ func pathsToPatterns(fsys fs.FS, paths []string) (patterns []string, err error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handleEvents concurrently handles the file system events. It closes the
|
// handleEvents concurrently handles the file system events. It closes the
|
||||||
// update channel of HostsContainer when finishes. It's used to be called
|
// update channel of HostsContainer when finishes. It is intended to be used as
|
||||||
// within a separate goroutine.
|
// a goroutine.
|
||||||
func (hc *HostsContainer) handleEvents() {
|
func (hc *HostsContainer) handleEvents() {
|
||||||
defer log.OnPanic(fmt.Sprintf("%s: handling events", hostsContainerPrefix))
|
defer log.OnPanic(fmt.Sprintf("%s: handling events", hostsContainerPrefix))
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ func NewOSWritesWatcher() (w FSWatcher, err error) {
|
|||||||
return fsw, nil
|
return fsw, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleErrors handles accompanying errors. It used to be called in a separate
|
// handleErrors handles accompanying errors. It is intended to be used as a
|
||||||
// goroutine.
|
// goroutine.
|
||||||
func (w *osWatcher) handleErrors() {
|
func (w *osWatcher) handleErrors() {
|
||||||
defer log.OnPanic(fmt.Sprintf("%s: handling errors", osWatcherPref))
|
defer log.OnPanic(fmt.Sprintf("%s: handling errors", osWatcherPref))
|
||||||
@ -100,7 +100,7 @@ func (w *osWatcher) Close() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handleEvents notifies about the received file system's event if needed. It
|
// handleEvents notifies about the received file system's event if needed. It
|
||||||
// used to be called in a separate goroutine.
|
// is intended to be used as a goroutine.
|
||||||
func (w *osWatcher) handleEvents() {
|
func (w *osWatcher) handleEvents() {
|
||||||
defer log.OnPanic(fmt.Sprintf("%s: handling events", osWatcherPref))
|
defer log.OnPanic(fmt.Sprintf("%s: handling events", osWatcherPref))
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@ func setOtherDHCPResult(ifaceName string, result *dhcpSearchResult) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// parseLease parses a lease from r. If there is no error returns DHCPServer
|
// parseLease parses a lease from r. If there is no error returns DHCPServer
|
||||||
// and *Lease. r must be non-nil.
|
// and *Lease. r must be non-nil.
|
||||||
func (s *server) parseLease(r io.Reader) (srv DHCPServer, lease *dhcpsvc.Lease, err error) {
|
func (s *server) parseLease(r io.Reader) (srv DHCPServer, lease *dhcpsvc.Lease, err error) {
|
||||||
l := &leaseStatic{}
|
l := &leaseStatic{}
|
||||||
err = json.NewDecoder(r).Decode(l)
|
err = json.NewDecoder(r).Decode(l)
|
||||||
|
@ -40,7 +40,7 @@ type ClientsContainer interface {
|
|||||||
) (conf *proxy.CustomUpstreamConfig, err error)
|
) (conf *proxy.CustomUpstreamConfig, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config represents the DNS filtering configuration of AdGuard Home. The zero
|
// Config represents the DNS filtering configuration of AdGuard Home. The zero
|
||||||
// Config is empty and ready for use.
|
// Config is empty and ready for use.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Callbacks for other modules
|
// Callbacks for other modules
|
||||||
|
@ -140,8 +140,7 @@ func (clients *clientsContainer) Init(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handleHostsUpdates receives the updates from the hosts container and adds
|
// handleHostsUpdates receives the updates from the hosts container and adds
|
||||||
// them to the clients container. It's used to be called in a separate
|
// them to the clients container. It is intended to be used as a goroutine.
|
||||||
// goroutine.
|
|
||||||
func (clients *clientsContainer) handleHostsUpdates() {
|
func (clients *clientsContainer) handleHostsUpdates() {
|
||||||
for upd := range clients.etcHosts.Upd() {
|
for upd := range clients.etcHosts.Upd() {
|
||||||
clients.addFromHostsFile(upd)
|
clients.addFromHostsFile(upd)
|
||||||
|
@ -283,7 +283,7 @@ type queryLogConfig struct {
|
|||||||
|
|
||||||
type statsConfig struct {
|
type statsConfig struct {
|
||||||
// DirPath is the custom directory for statistics. If it's empty the
|
// DirPath is the custom directory for statistics. If it's empty the
|
||||||
// default directory will be used. See [homeContext.getDataDir].
|
// default directory is used. See [homeContext.getDataDir].
|
||||||
DirPath string `yaml:"dir_path"`
|
DirPath string `yaml:"dir_path"`
|
||||||
|
|
||||||
// Ignored is the list of host names, which should not be counted.
|
// Ignored is the list of host names, which should not be counted.
|
||||||
|
@ -704,9 +704,9 @@ const (
|
|||||||
keyTypeRSA = "RSA"
|
keyTypeRSA = "RSA"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates
|
// Attempt to parse the given private key DER block. OpenSSL 0.9.8 generates
|
||||||
// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys.
|
// PKCS#1 private keys by default, while OpenSSL 1.0.0 generates PKCS#8 keys.
|
||||||
// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three.
|
// OpenSSL ecparam generates SEC1 EC private keys for ECDSA. We try all three.
|
||||||
//
|
//
|
||||||
// TODO(a.garipov): Find out if this version of parsePrivateKey from the stdlib
|
// TODO(a.garipov): Find out if this version of parsePrivateKey from the stdlib
|
||||||
// is actually necessary.
|
// is actually necessary.
|
||||||
|
@ -49,8 +49,8 @@ func (l *queryLog) client(clientID, ip string, cache clientCache) (c *Client, er
|
|||||||
// the total amount of records in the buffer at the moment of searching.
|
// the total amount of records in the buffer at the moment of searching.
|
||||||
// l.confMu is expected to be locked.
|
// l.confMu is expected to be locked.
|
||||||
func (l *queryLog) searchMemory(params *searchParams, cache clientCache) (entries []*logEntry, total int) {
|
func (l *queryLog) searchMemory(params *searchParams, cache clientCache) (entries []*logEntry, total int) {
|
||||||
// We use this configuration check because a buffer can contain a single log
|
// Check memory size, as the buffer can contain a single log record. See
|
||||||
// record. See [newQueryLog].
|
// [newQueryLog].
|
||||||
if l.conf.MemSize == 0 {
|
if l.conf.MemSize == 0 {
|
||||||
return nil, 0
|
return nil, 0
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ func (l *queryLog) setQLogReader(olderThan time.Time) (qr *qLogReader, err error
|
|||||||
return r, nil
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// readEntries reads entries from the reader to totalLimit. By default, we do
|
// readEntries reads entries from the reader to totalLimit. By default, we do
|
||||||
// not scan more than maxFileScanEntries at once. The idea is to make search
|
// not scan more than maxFileScanEntries at once. The idea is to make search
|
||||||
// calls faster so that the UI could handle it and show something quicker.
|
// calls faster so that the UI could handle it and show something quicker.
|
||||||
// This behavior can be overridden if maxFileScanEntries is set to 0.
|
// This behavior can be overridden if maxFileScanEntries is set to 0.
|
||||||
|
@ -314,7 +314,7 @@ func (u *Updater) clean() {
|
|||||||
_ = os.RemoveAll(u.updateDir)
|
_ = os.RemoveAll(u.updateDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxPackageFileSize is a maximum package file length in bytes. The largest
|
// MaxPackageFileSize is a maximum package file length in bytes. The largest
|
||||||
// package whose size is limited by this constant currently has the size of
|
// package whose size is limited by this constant currently has the size of
|
||||||
// approximately 9 MiB.
|
// approximately 9 MiB.
|
||||||
const MaxPackageFileSize = 32 * 1024 * 1024
|
const MaxPackageFileSize = 32 * 1024 * 1024
|
||||||
|
Loading…
Reference in New Issue
Block a user