resolvarchive

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package resolvarchive implements a CoreDNS plugin that integrates with luIDS dnsutil.Archive api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archiver

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

Archiver is an archiver with an channel buffer.

func NewArchiver

func NewArchiver(client dnsutil.Archiver, bufsize int, logger yalogi.Logger) *Archiver

NewArchiver returns a new instance.

func (*Archiver) Close

func (a *Archiver) Close() error

Close archiver.

func (*Archiver) SaveResolv

func (a *Archiver) SaveResolv(data *dnsutil.ResolvData)

SaveResolv data in an asyncronous mode.

type Config

type Config struct {
	Service string
	Buffer  int
	//server ip used for storage info
	ServerIP net.IP
	Exclude  IPSet
	IgnoreRC []int
}

Config stores configuration for the plugin.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with default values.

func (*Config) Load

func (cfg *Config) Load(c *caddy.Controller) error

Load configuration from controller.

func (Config) Validate

func (cfg Config) Validate() error

Validate configuration.

type IPSet

type IPSet struct {
	IPs   []net.IP
	CIDRs []*net.IPNet
}

IPSet contains ips and cidrs.

func (*IPSet) Contains

func (f *IPSet) Contains(ip net.IP) bool

Contains returns true if ip exists in the set.

func (*IPSet) Empty

func (f *IPSet) Empty() bool

Empty returns true if ipset is empty

type Plugin

type Plugin struct {
	Next plugin.Handler
	Fall fall.F
	// contains filtered or unexported fields
}

Plugin is the main struct of the plugin.

func New

func New(cfg Config) (*Plugin, error)

New returns a new Plugin.

func (Plugin) Health

func (p Plugin) Health() bool

Health implements plugin health interface.

func (Plugin) Name

func (p Plugin) Name() string

Name implements plugin interface.

func (Plugin) ServeDNS

func (p Plugin) ServeDNS(ctx context.Context, writer dns.ResponseWriter, query *dns.Msg) (int, error)

ServeDNS implements the plugin.Handle interface.

func (*Plugin) Shutdown

func (p *Plugin) Shutdown() error

Shutdown plugin.

func (*Plugin) Start

func (p *Plugin) Start() error

Start plugin.

Jump to

Keyboard shortcuts

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