Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParseState ¶
ParseState represents the current state of the zone parser. ParseState is used by parseZone and does not need to be used manually.
type Zone ¶
Zone represents a DNS zone. It can either be instantiated manually or by using ToZoneFile
func (*Zone) AddPTR ¶
AddPTR adds a creates a PTR from an IP address and adds it to the zone. If Ttl is 0 the default TTl from the zone is being used. Note: Legacy IP is currently not supported.
func (*Zone) ToZoneFile ¶
ToZoneFile returns a string containing a bind-like zone file from the provided zone
func (*Zone) UpdateSerial ¶
func (z *Zone) UpdateSerial()
UpdateSerial updates the serial number of the record with the current Unix time stamp. Note: This does not follow the official recommendation for zone serial numbers. Use UpdateSerialRFC instead, if you want RFC compliant serial numbers.
func (*Zone) UpdateSerialRFC ¶
UpdateSerialRFC updates the serial number of the record with the current date and a two digit serial.
type ZoneSOA ¶
type ZoneSOA struct { Host string Email string Nameserver string Serial string Refresh string Retry string Expire string Minimum string }
ZoneSOA represents an SOA record
type ZoneScanner ¶
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 (*ZoneScanner) HasNext ¶
func (z *ZoneScanner) HasNext() bool
HasNext returns whether the scanner has a next char.
func (*ZoneScanner) Next ¶
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 ¶
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 ¶
func (z *ZoneScanner) SkipToEoL()
SkipToEoL goes to the end of the line
func (*ZoneScanner) SkipWhitespace ¶
func (z *ZoneScanner) SkipWhitespace()
SkipWhitespace goes to the next char that is not whitespace