autozone

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package autozone implements an on-the-fly loading file backend.

Package autozone implements a on-the-fly loading file backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Autozone

type Autozone struct {
	Next plugin.Handler
	*Zones
	// contains filtered or unexported fields
}

Autozone holds the zones and the loader configuration for automatically loading zones.

func (Autozone) Name

func (a Autozone) Name() string

Name implements the Handler interface.

func (Autozone) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

func (Autozone) Walk

func (a Autozone) Walk() error

Walk will recursively walk of the file under l.directory and adds the one that match l.re.

type Zones

type Zones struct {
	Z map[string]*file.Zone // A map mapping zone (origin) to the Zone's data.

	sync.RWMutex
	// contains filtered or unexported fields
}

Zones maps zone names to a *Zone. This keeps track of what zones we have loaded at any one time.

func (*Zones) Add

func (z *Zones) Add(zo *file.Zone, name string)

Add adds a new zone into z. If zo.NoReload is false, the reload goroutine is started.

func (*Zones) Names

func (z *Zones) Names() []string

Names returns the names from z.

func (*Zones) Origins

func (z *Zones) Origins() []string

Origins returns the origins from z.

func (*Zones) Remove

func (z *Zones) Remove(name string)

Remove removes the zone named name from z. It also stops the zone's reload goroutine.

func (*Zones) Zones

func (z *Zones) Zones(name string) *file.Zone

Zones returns a zone with origin name from z, nil when not found.

Jump to

Keyboard shortcuts

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