zone

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyPlaceholder = "placeholder"

EmptyPlaceholder will be used instead of empty ACME TXT because we cannot really set ""

Variables

View Source
var (
	ErrSoaNotFound    = errors.New("SOA not found")
	ErrRecordNotFound = errors.New("record not found")
	ErrNoMatchers     = errors.New("no record matchers provided")
	ErrOriginChanged  = errors.New("zone origin changed")
	ErrZoneNotFound   = errors.New("zone not found")
)

ErrSoaNotFound emited if zone file does not have SOA record, which is mandatory

Functions

func PrintEntries

func PrintEntries(entries []zonefile.Entry, w io.Writer)

func StripOrigin

func StripOrigin(name, origin string) string

Types

type Controller

type Controller interface {
	// UpdateDDNSAddress changes DDNS A/AAAA records
	UpdateDDNSAddress(ctx context.Context, domain string, addrs []netip.Addr) error
	// UpdateACMEChallenge changes ACME TXT record for DNS-01 challenge
	UpdateACMEChallenge(ctx context.Context, domain string, newToken, oldToken string) error
	// ZMUpdateRecord replace record values
	ZMUpdateRecord(ctx context.Context, domain string, typ string, values []string) (changed bool, err error)
}

Controller implements zone file modification methods

func New

func New(zonefiles ...string) (Controller, error)

type DomainCtrl

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

func (*DomainCtrl) UpdateACMEChallenge

func (s *DomainCtrl) UpdateACMEChallenge(ctx context.Context, domain string, newToken, oldToken string) error

func (*DomainCtrl) UpdateDDNSAddress

func (s *DomainCtrl) UpdateDDNSAddress(ctx context.Context, domain string, addrs []netip.Addr) error

func (*DomainCtrl) ZMUpdateRecord added in v0.9.0

func (s *DomainCtrl) ZMUpdateRecord(ctx context.Context, domain string, typ string, values []string) (changed bool, err error)

type File

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

func (*File) UpdateACMEChallenge

func (s *File) UpdateACMEChallenge(ctx context.Context, domain string, newToken, oldToken string) error

func (*File) UpdateDDNSAddress

func (s *File) UpdateDDNSAddress(ctx context.Context, domain string, addrs []netip.Addr) error

func (*File) ZMUpdateRecord added in v0.9.0

func (s *File) ZMUpdateRecord(ctx context.Context, domain string, typ string, newValues []string) (changed bool, err error)

type Matcher added in v0.9.0

type Matcher struct {
	Domain []byte
	RRType uint16
	Values [][]byte
}

func (Matcher) Match added in v0.9.0

func (m Matcher) Match(e zonefile.Entry) bool

func (Matcher) String added in v0.9.0

func (m Matcher) String() string

type Matchers added in v0.9.0

type Matchers []Matcher

func (Matchers) Match added in v0.9.0

func (mm Matchers) Match(e zonefile.Entry) bool

Jump to

Keyboard shortcuts

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