Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadStatusCode = errors.New("bad HTTP status code")
Functions ¶
This section is empty.
Types ¶
type BlackLister ¶ added in v1.6.0
type BlackLister interface { FilterRequest(request *dns.Msg) (blocked bool) FilterResponse(response *dns.Msg) (blocked bool) }
func NewMap ¶ added in v1.6.0
func NewMap(settings Settings) BlackLister
type Builder ¶
type Builder interface { All(ctx context.Context, settings BuilderSettings) ( blockedHostnames []string, blockedIPs []netaddr.IP, blockedIPPrefixes []netaddr.IPPrefix, errs []error) Hostnames(ctx context.Context, blockMalicious, blockAds, blockSurveillance bool, additionalBlockedHostnames, allowedHostnames []string) ( blockedHostnames []string, errs []error) IPs(ctx context.Context, blockMalicious, blockAds, blockSurveillance bool, additionalBlockedIPs []netaddr.IP, additionalBlockedIPPrefixes []netaddr.IPPrefix) ( blockedIPs []netaddr.IP, blockedIPPrefixes []netaddr.IPPrefix, errs []error) }
func NewBuilder ¶
type BuilderSettings ¶ added in v1.6.0
type BuilderSettings struct { BlockMalicious bool BlockAds bool BlockSurveillance bool AllowedHosts []string AddBlockedHosts []string AddBlockedIPs []netaddr.IP AddBlockedIPPrefixes []netaddr.IPPrefix }
func (*BuilderSettings) Lines ¶ added in v1.6.0
func (s *BuilderSettings) Lines(indent, subSection string) (lines []string)
func (*BuilderSettings) String ¶ added in v1.6.0
func (s *BuilderSettings) String() string
type Settings ¶ added in v1.6.0
func (*Settings) AddBlockHostnames ¶ added in v1.6.0
AddBlockHostnames transforms the slice of hostnames given to FQDN hostnames and adds the new hostnames to the settings, removing any duplicate.
func (*Settings) BlockHostnames ¶ added in v1.6.0
BlockHostnames transforms the slice of hostnames given to FQDN hostnames and sets these to the settings.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_blacklist is a generated GoMock package.
|
Package mock_blacklist is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.