zonefile

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExcludeType

func ExcludeType(records []mindnspb.ProtoRR, rrtype mindnspb.Type) []mindnspb.ProtoRR

ExcludeType returns records not matching the given type.

func FilterByType

func FilterByType(records []mindnspb.ProtoRR, rrtype mindnspb.Type) []mindnspb.ProtoRR

FilterByType returns records matching the given type.

func FindSOA

func FindSOA(records []mindnspb.ProtoRR) *mindnspb.SOA

FindSOA searches for the SOA record in the parsed records. Returns nil if no SOA record is found.

func ParseFile

func ParseFile(path, origin string) ([]mindnspb.ProtoRR, error)

ParseFile opens and parses a zone file. origin is the zone origin (e.g., "example.com.").

Types

type Parser

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

Parser parses RFC 1035 zone files into mindns records.

func NewParser

func NewParser(origin, file string) *Parser

NewParser creates a new zone file parser. origin is the zone origin (e.g., "example.com."). file is the filename for error reporting.

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader) ([]mindnspb.ProtoRR, error)

Parse reads a zone file from the reader and returns all records. Records that cannot be converted to mindnspb.ProtoRR are skipped.

Jump to

Keyboard shortcuts

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