Documentation ¶
Overview ¶
Package debugsvc contains the debug HTTP API of AdGuard DNS.
Index ¶
Constants ¶
const ( PathPatternDNSDBCSV = "/dnsdb/csv" PathPatternDebugAPICache = "/debug/api/cache/clear" PathPatternDebugAPIRefresh = "/debug/api/refresh" PathPatternHealthCheck = "/health-check" PathPatternMetrics = "/metrics" )
Path pattern constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { DNSDBHandler http.Handler Logger *slog.Logger Manager *agdcache.DefaultManager Refreshers Refreshers DNSDBAddr string APIAddr string PprofAddr string PrometheusAddr string }
Config is the AdGuard DNS HTTP service configuration structure.
type RefresherID ¶
type RefresherID = string
RefresherID is a type alias for strings that represent IDs of refreshers.
TODO(a.garipov): Consider a newtype with validations.
type Refreshers ¶
type Refreshers map[RefresherID]agdservice.Refresher
Refreshers is a type alias for maps of refresher IDs to Refreshers themselves.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the HTTP service of AdGuard DNS. It serves prometheus metrics, pprof, health check, DNSDB, and other endpoints.
func (*Service) Shutdown ¶
Shutdown implements the service.Interface interface for *Service. It stops serving all endpoints.
func (*Service) Start ¶
Start implements the service.Interface interface for *Service. It starts serving all endpoints but does not wait for them to actually go online. err is always nil, if any endpoint fails to start, it panics.
TODO(a.garipov): Wait for the services to go online.
TODO(a.garipov): Use the context for cancelation.