adguard

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: MIT Imports: 14 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) GetClients added in v1.1.0

func (c *Client) GetClients(ctx context.Context) (*generated.Clients, error)

func (*Client) GetDhcp

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

func (*Client) GetQueryLog

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

func (c *Client) GetQueryLog(ctx context.Context) (map[string]map[string]int, []QueryTime, QueryPerClient, 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 ClientInfo

type ClientInfo struct {
	Whois          map[string]any `json:"whois"`
	Name           string         `json:"name"`
	DisallowedRule string         `json:"disallowed_rule"`
	Disallowed     Bool           `json:"disallowed"`
}

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

type QueryTime struct {
	ElapsedSeconds time.Duration
	Client         string
	ClientName     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"`
}

Directories

Path Synopsis
Package adguard provides primitives to interact with the openapi HTTP API.
Package adguard provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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