Documentation ¶
Overview ¶
Package example is a CoreDNS plugin that prints "example" to stdout on every packet received.
It serves as an example CoreDNS plugin with numerous code comments.
Index ¶
- Variables
- func APIDevices() (map[string]DeviceEntry, error)
- func BoltOpen(filename string) *bolt.DB
- func IPHasTags(IP string, applied_tags []string) bool
- func IPQuarantined(IP string) bool
- type Block
- type BlockMetrics
- type BucketItem
- type DNSBlockEvent
- type DNSBlockRebindingEvent
- type DNSEvent
- type DNSOverrideEvent
- type DeviceEntry
- type DomainOverride
- type DomainValue
- type EventData
- type ListEntry
- type OverrideList
- type PSKEntry
- type ResponseWriterDelay
- type SPRBlockConfig
- type SPRBlockConfigOld
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBucketList = errors.New("error listing buckets") ErrBucketGet = errors.New("error retrieving bucket") ErrBucketMissing = errors.New("bucket doesn't exist") ErrBucketCreate = errors.New("error creating bucket") ErrBucketDelete = errors.New("error deleting bucket") ErrBucketDecodeName = errors.New("error reading bucket name") ErrBucketInvalidName = errors.New("invalid bucket name") ErrBucketItemDecode = errors.New("error reading bucket item") ErrBucketItemEncode = errors.New("error encoding bucket item") ErrBucketItemGet = errors.New("error getting bucket item") ErrBucketItemCreate = errors.New("error creating bucket item") ErrBucketItemUpdate = errors.New("error updating bucket item") ErrBucketItemDelete = errors.New("error deleting bucket item") )
View Source
var BLmtx sync.RWMutex
View Source
var CONFIG_PATH = TEST_PREFIX + "/configs/dns/block_rules.json"
View Source
var Configmtx sync.Mutex
View Source
var DLmtx sync.RWMutex
View Source
var DevicesConfigPath = TEST_PREFIX + "/configs/devices/"
View Source
var DevicesPublicConfigFile = TEST_PREFIX + "/state/public/devices-public.json"
View Source
var Dmtx sync.RWMutex
View Source
var IPPolicyMap = make(map[string][]string)
View Source
var IPTagMap = make(map[string][]string)
View Source
var IPTagmtx sync.RWMutex
View Source
var OLD_CONFIG_PATH = TEST_PREFIX + "/state/dns/block_rules.json"
View Source
var Stagemtx sync.RWMutex
View Source
var TEST_PREFIX = os.Getenv("TEST_PREFIX")
View Source
var UNIX_PLUGIN_LISTENER = TEST_PREFIX + "/state/dns/dns_block_plugin"
Functions ¶
func APIDevices ¶
func APIDevices() (map[string]DeviceEntry, error)
func IPQuarantined ¶
Types ¶
type Block ¶
type Block struct { Db *bolt.DB DbPath string Next plugin.Handler // contains filtered or unexported fields }
Block is the block plugin.
func (*Block) MigrateConfig ¶
func (b *Block) MigrateConfig()
func (*Block) ShouldRetryRefresh ¶
func (*Block) UpdateDomains ¶
func (b *Block) UpdateDomains(update map[string]DomainValue) error
type BlockMetrics ¶
type BucketItem ¶
type BucketItem struct { Key string Value DomainValue }
func (*BucketItem) DecodeValue ¶
func (item *BucketItem) DecodeValue(rawValue []byte) error
func (*BucketItem) EncodeKey ¶
func (item *BucketItem) EncodeKey() []byte
func (*BucketItem) EncodeValue ¶
func (item *BucketItem) EncodeValue() ([]byte, error)
type DNSBlockEvent ¶
func (*DNSBlockEvent) String ¶
func (i *DNSBlockEvent) String() string
type DNSBlockRebindingEvent ¶
func (*DNSBlockRebindingEvent) String ¶
func (i *DNSBlockRebindingEvent) String() string
type DNSEvent ¶
type DNSEvent struct { dns.ResponseWriter // contains filtered or unexported fields }
type DNSOverrideEvent ¶
func (*DNSOverrideEvent) String ¶
func (i *DNSOverrideEvent) String() string
type DeviceEntry ¶
type DomainOverride ¶
type DomainValue ¶
type OverrideList ¶
type OverrideList struct { PermitDomains []DomainOverride BlockDomains []DomainOverride Enabled bool Tags []string Name string }
type ResponseWriterDelay ¶
type ResponseWriterDelay struct {
dns.ResponseWriter
}
type SPRBlockConfig ¶
type SPRBlockConfigOld ¶
type SPRBlockConfigOld struct { BlockLists []ListEntry //list of URIs with DNS block lists PermitDomains []DomainOverride BlockDomains []DomainOverride ClientIPExclusions []string //these IPs should not have ad blocking RefreshSeconds int QuarantineHostIP string //for devices in quarantine mode RebindingCheckDisable bool }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.