Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Downloader ¶ added in v0.3.0
type Downloader interface { // Download all sources in Lists. Download(*Lists) (*set.Set[string], error) }
A Downloader is used to download a set of source lists.
func NewDownloader ¶ added in v0.3.0
func NewDownloader(fwd *agent.Forward, logger output.Logger) Downloader
NewDownloader creates a new Downloader for downloading source lists.
type Getter ¶ added in v0.3.0
type Getter interface { // Get source and extract its domains into a Set. Get(source string) (*set.Set[string], error) }
A Getter is used to download a single source list.
type Lists ¶
type Lists struct { Suspicious []string `json:"suspicious"` Advertising []string `json:"advertising"` Tracking []string `json:"tracking"` Malicious []string `json:"malicious"` Miners []string `json:"miners"` }
Lists represents the embedded JSON file containing default source lists.
func Defaults ¶
func Defaults() *Lists
Defaults returns the default set of source lists.
The default set of source lists are embedded as statics/sources.json which we then simply unmarshal at runtime.
type Sets ¶ added in v0.3.0
type Sets struct {
// contains filtered or unexported fields
}
Sets enables efficient look-ups of whether a domain should be allowable or blocked.
func New ¶ added in v0.3.0
func New(logger output.Logger, cc *agent.CoreConfig) *Sets
New returns a Sets pre-filled according to cc.
func (*Sets) BlockByMatch ¶ added in v0.3.0
BlockByMatch indicates whether domain is on the explicit block-list.
func (*Sets) BlockBySuffix ¶ added in v0.3.0
BlockBySuffix indicates whether domain is on the suffix block-list.