prettyzone

package
v3.31.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatLine added in v3.18.1

func FormatLine(lengths []int, fields []string) string

FormatLine formats a zonefile line.

func LabelLess added in v3.24.0

func LabelLess(a, b string) bool

LabelLess provides a "Less" function for two labels as needed for sorting. It sorts labels in prefix order, to make output pretty.

func MostCommonTTL

func MostCommonTTL(records models.Records) uint32

MostCommonTTL returns the most common TTL in a set of records. If there is a tie, the highest TTL is selected. This makes the results consistent. NS records are not included in the analysis because Tom said so.

func WriteZoneFileRC

func WriteZoneFileRC(w io.Writer, records models.Records, origin string, defaultTTL uint32, comments []string) error

WriteZoneFileRC writes a beautifully formatted zone file.

func WriteZoneFileRR

func WriteZoneFileRR(w io.Writer, records []dns.RR, origin string) error

WriteZoneFileRR is a helper for when you have []dns.RR instead of models.Records

Types

type ZoneGenData

type ZoneGenData struct {
	Origin     string
	DefaultTTL uint32
	Records    models.Records
	Comments   []string
}

ZoneGenData is the configuration description for the zone generator.

func PrettySort

func PrettySort(records models.Records, origin string, defaultTTL uint32, comments []string) *ZoneGenData

PrettySort sorts the records in a pretty order.

func (*ZoneGenData) Len

func (z *ZoneGenData) Len() int

func (*ZoneGenData) Less

func (z *ZoneGenData) Less(i, j int) bool

func (*ZoneGenData) Swap

func (z *ZoneGenData) Swap(i, j int)

Jump to

Keyboard shortcuts

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