save

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFileClosed = errors.New("file is already closed")

ErrFileClosed returned when attempting to write to a closed file

Functions

func RRString

func RRString(rr dns.RR) string

RRString prints IPv4 IPs in AAAA records in IPv6 notation fixes https://github.com/miekg/dns/issues/1107

Types

type File

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

File represents the zone file to create on disk

func New

func New(zone, filename string) *File

New returns a handle to a new zonefile

func (*File) Abort

func (f *File) Abort() error

Abort stops processing the new zone file and removes it from disk

func (*File) AddRR

func (f *File) AddRR(rr dns.RR) error

AddRR adds a record to a zone file

func (*File) Finish

func (f *File) Finish() error

Finish adds closing comments and flushes and closes all buffers/files

func (*File) Records

func (f *File) Records() int64

Records returns the number of records written to the zone file

func (*File) WriteComment

func (f *File) WriteComment(comment string) error

WriteComment adds a comment to the zone file

func (*File) WriteCommentKey

func (f *File) WriteCommentKey(key, value string) error

WriteCommentKey adds a comment to the zone file

Jump to

Keyboard shortcuts

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