Documentation
¶
Index ¶
- type Client
- func (c *Client) ForwardDestinations() (*[]ForwardDestination, error)
- func (c *Client) QueryTypes() (*QueryTypes, error)
- func (c *Client) SummaryRaw() (*SummaryRaw, error)
- func (c *Client) TopClients(top int) (*[]TopClient, error)
- func (c *Client) TopItems(top int) (*TopItems, error)
- func (c *Client) Version() (int, error)
- type Configuration
- type ForwardDestination
- type Query
- type QueryTypes
- type SummaryRaw
- type TopAdvertisement
- type TopClient
- type TopItems
- type TopQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents Pihole client.
func New ¶
func New(config Configuration) *Client
func (*Client) ForwardDestinations ¶
func (c *Client) ForwardDestinations() (*[]ForwardDestination, error)
ForwardDestinations does ?getForwardDestinations query. Returns number of queries that have been forwarded to the targets.
func (*Client) QueryTypes ¶
func (c *Client) QueryTypes() (*QueryTypes, error)
QueryTypes does ?getQueryTypes query. Returns number of queries that the Pi-hole’s DNS server has processed.
func (*Client) SummaryRaw ¶
func (c *Client) SummaryRaw() (*SummaryRaw, error)
SummaryRaw does ?summaryRaw query. Returns summary statistics.
func (*Client) TopClients ¶
TopClients does ?topClients query. Returns top sources.
type Configuration ¶
type ForwardDestination ¶
ForwardDestination represents forwarder queries statistics.
type QueryTypes ¶
type QueryTypes struct {
A float64 `json:"A (IPv4)"`
AAAA float64 `json:"AAAA (IPv6)"`
ANY float64
SRV float64
SOA float64
PTR float64
TXT float64
}
QueryTypes represents DNS queries processing statistics.
type SummaryRaw ¶
type SummaryRaw struct {
DomainsBeingBlocked int64 `json:"domains_being_blocked"`
DNSQueriesToday int64 `json:"dns_queries_today"`
AdsBlockedToday int64 `json:"ads_blocked_today"`
AdsPercentageToday float64 `json:"ads_percentage_today"`
UniqueDomains int64 `json:"unique_domains"`
QueriesForwarded int64 `json:"queries_forwarded"`
QueriesCached int64 `json:"queries_cached"`
ClientsEverSeen int64 `json:"clients_ever_seen"`
UniqueClients int64 `json:"unique_clients"`
DNSQueriesAllTypes int64 `json:"dns_queries_all_types"`
ReplyNODATA int64 `json:"reply_NODATA"`
ReplyNXDOMAIN int64 `json:"reply_NXDOMAIN"`
ReplyCNAME int64 `json:"reply_CNAME"`
ReplyIP int64 `json:"reply_IP"`
PrivacyLevel int64 `json:"privacy_level"`
Status string `json:"status"`
GravityLastUpdated struct {
// gravity.list has been removed (https://github.com/pi-hole/pi-hole/pull/2871#issuecomment-520251509)
FileExists bool `json:"file_exists"`
Absolute *int64
} `json:"gravity_last_updated"`
}
SummaryRaw represents summary statistics int raw format (no number formatting applied).
type TopAdvertisement ¶
type TopAdvertisement = TopQuery
TopAdvertisement represents TopAdvertisement.
type TopItems ¶
type TopItems struct {
TopQueries []TopQuery
TopAds []TopAdvertisement
}
TopItems represents top domains and top advertisements' statistics.