Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Status chan *ClientChannel // contains filtered or unexported fields }
Client struct is a PI-Hole client to request an instance of a PI-Hole ad blocker.
func (*Client) CollectMetrics ¶ added in v0.1.0
func (*Client) CollectMetricsAsync ¶ added in v0.3.0
func (c *Client) CollectMetricsAsync(writer http.ResponseWriter, request *http.Request)
func (*Client) GetHostname ¶ added in v0.1.0
type ClientChannel ¶ added in v0.3.0
type ClientChannel struct { Status ClientStatus Err error }
func (*ClientChannel) String ¶ added in v0.3.0
func (c *ClientChannel) String() string
type ClientStatus ¶ added in v0.3.0
type ClientStatus byte
const ( MetricsCollectionInProgress ClientStatus = iota MetricsCollectionSuccess MetricsCollectionError MetricsCollectionTimeout )
func (ClientStatus) String ¶ added in v0.3.0
func (status ClientStatus) String() string
type Stats ¶
type Stats struct { DomainsBeingBlocked int `json:"domains_being_blocked"` DNSQueriesToday int `json:"dns_queries_today"` AdsBlockedToday int `json:"ads_blocked_today"` AdsPercentageToday float64 `json:"ads_percentage_today"` UniqueDomains int `json:"unique_domains"` QueriesForwarded int `json:"queries_forwarded"` QueriesCached int `json:"queries_cached"` ClientsEverSeen int `json:"clients_ever_seen"` UniqueClients int `json:"unique_clients"` DNSQueriesAllTypes int `json:"dns_queries_all_types"` ReplyUnknown int `json:"reply_UNKNOWN"` ReplyNoData int `json:"reply_NODATA"` ReplyNxDomain int `json:"reply_NXDOMAIN"` ReplyCname int `json:"reply_CNAME"` ReplyIP int `json:"reply_IP"` ReplyDomain int `json:"reply_DOMAIN"` ReplyRRName int `json:"reply_RRNAME"` ReplyServFail int `json:"reply_SERVFAIL"` ReplyRefused int `json:"reply_REFUSED"` ReplyNotImp int `json:"reply_NOTIMP"` ReplyOther int `json:"reply_OTHER"` ReplyDNSSEC int `json:"reply_DNSSEC"` ReplyNone int `json:"reply_NONE"` ReplyBlob int `json:"reply_BLOB"` TopQueries map[string]int `json:"top_queries"` TopAds map[string]int `json:"top_ads"` TopSources map[string]int `json:"top_sources"` ForwardDestinations map[string]float64 `json:"forward_destinations"` QueryTypes map[string]float64 `json:"querytypes"` Status string `json:"status"` }
Stats struct is the PI-Hole statistics JSON API corresponding model.
Click to show internal directories.
Click to hide internal directories.