plugins

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action uint64
const (
	Noop Action = iota
	Question
	Reply
	Rewrite
	Deny
)

type Plugins

type Plugins struct {
	PreHandler  []PreHandler
	PostHandler []PostHandler
}

func Load

func Load(cfg *config.Config) *Plugins

type PostHandler

type PostHandler interface {
	ProcessQuery(p PreOrPost, ip string, m *dns.Msg, q *dns.Question) (*Update, error)
}

type PostParam

type PostParam struct {
	RemoteIp  string
	QueryType string
	Question  string
}

type PreHandler

type PreHandler interface {
	ProcessQuery(p PreOrPost, ip string, m *dns.Msg, q *dns.Question) (*Update, error)
}

type PreOrPost

type PreOrPost uint64
const (
	Pre PreOrPost = iota
	Post
)

type PreParam

type PreParam struct {
	RemoteIp  string
	QueryType string
	Question  string
}

type Update

type Update struct {
	Action   Action
	Stop     bool // Stop processing plugins
	Done     bool // Stop processing question
	Question *dns.Question
	RR       []dns.RR
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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