plugin

package
v0.0.0-...-a4d57e1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blocker

type Blocker struct {
	// contains filtered or unexported fields
}

func NewBlocker

func NewBlocker(db *sql.DB) (*Blocker, error)

func (*Blocker) Close

func (b *Blocker) Close() error

func (*Blocker) HandlerFunc

func (b *Blocker) HandlerFunc(next HandlerFunc) HandlerFunc

type HandlerFunc

type HandlerFunc func(*dns.Msg) (*dns.Msg, error)

type Logger

type Logger struct{}

func NewLogger

func NewLogger(destination io.Writer) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) HandlerFunc

func (l *Logger) HandlerFunc(next HandlerFunc) HandlerFunc

type Plugin

type Plugin interface {
	HandlerFunc(next HandlerFunc) HandlerFunc
	Close() error
}

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(upstream string) (*Proxy, error)

func (*Proxy) Close

func (p *Proxy) Close() error

func (*Proxy) HandlerFunc

func (p *Proxy) HandlerFunc(next HandlerFunc) HandlerFunc

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func Load

func Load(plugins []Plugin) *Stack

Load registers a list of plugins for later use.

func (*Stack) Close

func (s *Stack) Close() error

Close closes all plugins and returns an error if a plugin has failed.

func (*Stack) Handler

func (s *Stack) Handler(r *dns.Msg) (*dns.Msg, error)

Handler iterates over all loaded plugins. The DNS request is passed from one plugin to the next and returned in the end.

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

func NewStats

func NewStats(opts StatsOpts) (*Stats, error)

func (*Stats) Close

func (s *Stats) Close() error

func (*Stats) HandlerFunc

func (s *Stats) HandlerFunc(next HandlerFunc) HandlerFunc

type StatsOpts

type StatsOpts struct {
	DB           *sql.DB
	TrackStats   bool
	TrackQueries bool
}

Jump to

Keyboard shortcuts

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