columbus

package module
v0.0.0-...-b491e5e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Columbus

Name

columbus - insert domains to Columbus.

Description

Using columbus insert valid domain (RCODE is 0) from question to Columbus. This plugin uses a channel to buffer the domains to not degrade the performance.

If cache is enabled, cached records are not inserted (columbus comes after cache).

Syntax

columbus [BUFF] [WORKERS]
  • BUFF: Optional argument to set the underlying channel size (default: 10000).
  • WORKERS: Optional argument to set the number of insert workers (default: number of proc).

The BUFF and WORKER needs to be set once.

Examples

Enable with default settings:

. {
    columbus
    forward . 1.1.1.1
}

Set buffer size to 100:

. {
    columbus 100
    forward . 1.1.1.1
}

Set buffer size to 100 with 4 workers:

. {
    columbus 100 4
    forward . 1.1.1.1
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DomainsChan   chan *string = nil
	InsertWorkers *atomic.Bool = nil // Indicate whether insertWokers started
)

Functions

This section is empty.

Types

type Columbus

type Columbus struct {
	Next plugin.Handler
}

func (Columbus) Name

func (e Columbus) Name() string

func (Columbus) Ready

func (e Columbus) Ready() bool

Ready implements the ready.Readiness interface, once this flips to true CoreDNS assumes this plugin is ready for queries; it is not checked again.

func (Columbus) ServeDNS

func (e Columbus) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

type DomainInserter

type DomainInserter struct {
	dns.ResponseWriter
}

func NewDomainInserter

func NewDomainInserter(w dns.ResponseWriter) *DomainInserter

func (*DomainInserter) WriteMsg

func (r *DomainInserter) WriteMsg(res *dns.Msg) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL