Documentation ¶
Index ¶
- Constants
- func GetEmptyAnswerForQuestionType(questionType uint16, domain string) dns.RR
- type BlockDomainsDecider
- func NewBlockDomainsDeciderABP(blocklistResolver *BlocklistResolver, logger Logger) BlockDomainsDecider
- func NewBlockDomainsDeciderHosts(resolver *BlocklistResolver, logger Logger) BlockDomainsDecider
- func PrepareBlocklist(uri string, blocklistUpdateFrequency string, blocklistType string, ...) (BlockDomainsDecider, []func() error, error)
- type BlockDomainsDeciderABP
- type BlockDomainsDeciderHosts
- type Blocker
- type BlocklistResolver
- type BlocklistType
- type Logger
Constants ¶
View Source
const MetadataRequestBlocked = "blocker/request-blocked"
View Source
const PluginName = "blocker"
View Source
const RequiredArgs = 3
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockDomainsDecider ¶
type BlockDomainsDecider interface { IsDomainBlocked(domain string) bool UpdateBlocklist(contents string) error }
BlockDomainsDecider is the interface which must be implemented by any type which intends to become a blocker. The purpose of each of the functions is described below.
func NewBlockDomainsDeciderABP ¶
func NewBlockDomainsDeciderABP(blocklistResolver *BlocklistResolver, logger Logger) BlockDomainsDecider
Name ...
func NewBlockDomainsDeciderHosts ¶
func NewBlockDomainsDeciderHosts(resolver *BlocklistResolver, logger Logger) BlockDomainsDecider
Name ...
func PrepareBlocklist ¶
func PrepareBlocklist(uri string, blocklistUpdateFrequency string, blocklistType string, logger Logger) (BlockDomainsDecider, []func() error, error)
PrepareBlocklist ...
type BlockDomainsDeciderABP ¶
type BlockDomainsDeciderABP struct {
// contains filtered or unexported fields
}
func (*BlockDomainsDeciderABP) IsDomainBlocked ¶
func (d *BlockDomainsDeciderABP) IsDomainBlocked(domain string) bool
IsDomainBlocked ...
func (*BlockDomainsDeciderABP) UpdateBlocklist ¶
func (d *BlockDomainsDeciderABP) UpdateBlocklist(contents string) error
UpdateBlocklist ...
type BlockDomainsDeciderHosts ¶
type BlockDomainsDeciderHosts struct {
// contains filtered or unexported fields
}
func (*BlockDomainsDeciderHosts) IsDomainBlocked ¶
func (d *BlockDomainsDeciderHosts) IsDomainBlocked(domain string) bool
IsDomainBlocked ...
func (*BlockDomainsDeciderHosts) UpdateBlocklist ¶
func (d *BlockDomainsDeciderHosts) UpdateBlocklist(contents string) error
UpdateBlocklist ...
type Blocker ¶
type Blocker struct { Next plugin.Handler Decider BlockDomainsDecider }
type BlocklistResolver ¶
type BlocklistResolver struct {
// contains filtered or unexported fields
}
func NewBlocklistResolver ¶
func (*BlocklistResolver) ScheduleUpdate ¶
func (resolver *BlocklistResolver) ScheduleUpdate()
func (*BlocklistResolver) Start ¶
func (resolver *BlocklistResolver) Start()
func (*BlocklistResolver) Stop ¶
func (resolver *BlocklistResolver) Stop()
func (*BlocklistResolver) Subscribe ¶
func (resolver *BlocklistResolver) Subscribe(ch chan string)
type BlocklistType ¶
type BlocklistType string
const BlocklistType_ABP BlocklistType = "abp"
const BlocklistType_Hosts BlocklistType = "hosts"
type Logger ¶
type Logger interface { // Copied from the list of functions provided by https://pkg.go.dev/github.com/coredns/coredns/plugin/pkg/log Debug(v ...interface{}) Debugf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Warning(v ...interface{}) Warningf(format string, v ...interface{}) }
Click to show internal directories.
Click to hide internal directories.