Documentation ¶
Overview ¶
Package rulestat contains the filtering rule statistics collector and API.
Index ¶
Constants ¶
const StatFilterListID agd.FilterListID = "adguard_dns_filter"
StatFilterListID is the ID of the filtering rule list for which we collect statistics. This is a temporary restriction.
TODO(ameshkov): Consider making configurable
const StatFilterListLegacyID agd.FilterListID = "15"
StatFilterListLegacyID is the ID of the filtering rule list for which we collect statistics, as understood and accepted by the current backend. This is a temporary restriction.
TODO(ameshkov): Consider making the backend accept the current IDs.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Empty ¶
type Empty struct{}
Empty is an Interface implementation that does nothing.
func (Empty) Collect ¶
func (Empty) Collect(_ context.Context, _ agd.FilterListID, _ agd.FilterRuleText)
Collect implements the Interface interface for Empty.
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP is the filtering rule statistics collector that uploads the statistics to the given URL when it's refreshed.
TODO(a.garipov): Add tests.
func NewHTTP ¶
func NewHTTP(c *HTTPConfig) (s *HTTP)
NewHTTP returns a new statistics collector with HTTP upload.
func (*HTTP) Collect ¶
func (s *HTTP) Collect(_ context.Context, id agd.FilterListID, text agd.FilterRuleText)
Collect implements the Interface interface for *HTTP.
type HTTPConfig ¶
HTTPConfig is the configuration structure for the filtering rule statistics collector that uploads the statistics to a URL. All fields are required.
type Interface ¶
type Interface interface {
Collect(ctx context.Context, id agd.FilterListID, r agd.FilterRuleText)
}
Interface is an ephemeral storage of the filtering rule list statistics interface.
All methods must be safe for concurrent use.