zone_parser

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: LGPL-2.1 Imports: 8 Imported by: 0

README

Zone Parser

Zone Parser is a simple to use Go library that can parse bind like DNS-Zones.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParseState added in v0.1.0

type ParseState struct {
	Parenthesis  bool
	PreviousName string
}

ParseState represents the current state of the zone parser. ParseState is used by parseZone and does not need to be used manually.

type Record

type Record struct {
	Class   string
	Content string
	Host    string
	Ttl     uint
	Type    string
}

type Zone

type Zone struct {
	Origin        string
	Records       []Record
	SOAEmail      string
	SOANameserver string
	Ttl           uint
	Serial        uint
}

type ZoneSOA added in v0.1.0

type ZoneSOA struct {
	Email      string
	Nameserver string
	Serial     string
	Refresh    string
	Retry      string
	Expire     string
	Minimum    string
}

type ZoneScanner added in v0.1.0

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

ZoneScanner is a simple scanner that provides functionality for zone files. It should not be instantiated manually, instead use NewZoneScanner

func NewZoneScanner added in v0.1.0

func NewZoneScanner(zone string) *ZoneScanner

NewZoneScanner returnes a new ZoneScanner with the zones content.

func (*ZoneScanner) HasNext added in v0.1.0

func (z *ZoneScanner) HasNext() bool

func (*ZoneScanner) Next added in v0.1.0

func (z *ZoneScanner) Next(n int) string

Next Returns the next n chars of the scanners content and sets the new position. If n is greater than the remaining content, only the remaining content will be returned.

func (*ZoneScanner) Peek added in v0.1.0

func (z *ZoneScanner) Peek(n int) string

Peek Returns the next n chars of the scanners content without changing the position. If n is greater than the remaining content, only the remaining content will be returned.

func (*ZoneScanner) SkipToEoL added in v0.1.0

func (z *ZoneScanner) SkipToEoL()

SkipToEoL goes to the end of the line

func (*ZoneScanner) SkipWhitespace added in v0.1.0

func (z *ZoneScanner) SkipWhitespace()

SkipWhitespace goes to the next char that is not whitespace

Jump to

Keyboard shortcuts

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