adguard

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool bool

func (Bool) Int

func (b Bool) Int() int

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf config.Config) *Client

func (*Client) GetDhcp

func (c *Client) GetDhcp(ctx context.Context) (*DhcpStatus, error)

func (*Client) GetQueryLog added in v1.1.7

func (c *Client) GetQueryLog(ctx context.Context) (map[string]int, []QueryTime, error)

func (*Client) GetStats

func (c *Client) GetStats(ctx context.Context) (*Stats, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) (*Status, error)

func (*Client) Url

func (c *Client) Url() string

type DhcpLease

type DhcpLease struct {
	Mac      string     `json:"mac"`
	IP       string     `json:"ip"`
	Hostname string     `json:"hostname"`
	Expires  *time.Time `json:"expires,omitempty"`
	Type     string
}

type DhcpStatus

type DhcpStatus struct {
	Enabled       Bool        ` json:"enabled"`
	DynamicLeases []DhcpLease `json:"leases"`
	StaticLeases  []DhcpLease `json:"static_leases"`
	Leases        []DhcpLease
}

type QueryTime added in v1.1.7

type QueryTime struct {
	Elapsed  time.Duration
	Client   string
	Upstream string
}

type Stats

type Stats struct {
	TotalQueries                int                  `json:"num_dns_queries"`
	BlockedFilteredQueries      int                  `json:"num_blocked_filtering"`
	ReplacedSafebrowsingQueries int                  `json:"num_replaced_safebrowsing"`
	ReplacedSafesearchQueries   int                  `json:"num_replaced_safesearch"`
	ReplacedParentalQueries     int                  `json:"num_replaced_parental"`
	AvgProcessingTime           float32              `json:"avg_processing_time"`
	TopQueriedDomains           []map[string]int     `json:"top_queried_domains"`
	TopBlockedDomains           []map[string]int     `json:"top_blocked_domains"`
	TopClients                  []map[string]int     `json:"top_clients"`
	TopUpstreamsResponses       []map[string]int     `json:"top_upstreams_responses"`
	TopUpstreamsAvgTimes        []map[string]float32 `json:"top_upstreams_avg_time"`
}

type Status

type Status struct {
	ProtectionEnabled Bool   `json:"protection_enabled"`
	Version           string `json:"version"`
	Running           Bool   `json:"running"`
}

Jump to

Keyboard shortcuts

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