debugsvc

package
v0.0.0-...-b6e3791 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package debugsvc contains the debug HTTP API of AdGuard DNS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DNSDBAddr    string
	DNSDBHandler http.Handler

	HealthAddr     string
	PprofAddr      string
	PrometheusAddr string
}

Config is the AdGuard DNS HTTP service configuration structure.

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 New

func New(c *Config) (svc *Service)

New returns a new properly initialized *Service.

func (*Service) Shutdown

func (svc *Service) Shutdown(ctx context.Context) (err error)

Shutdown implements the service.Interface interface for *Service. It stops serving all endpoints.

func (*Service) Start

func (svc *Service) Start(_ context.Context) (err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL