Documentation
¶
Index ¶
- Constants
- Variables
- func PrintEntries(entries []zonefile.Entry, w io.Writer)
- func StripOrigin(name, origin string) string
- type Controller
- type DomainCtrl
- func (s *DomainCtrl) DeleteRRSet(ctx context.Context, zoneName, name, typ string) (changed bool, err error)
- func (s *DomainCtrl) GetZone(ctx context.Context, zoneName string) (ZoneSnapshot, error)
- func (s *DomainCtrl) ListZones(ctx context.Context) ([]ZoneSnapshot, error)
- func (s *DomainCtrl) ReplaceRRSet(ctx context.Context, zoneName, name, typ string, ttl int, values []string) (changed bool, err error)
- func (s *DomainCtrl) UpdateACMEChallenge(ctx context.Context, domain string, newToken, oldToken string) error
- func (s *DomainCtrl) UpdateDDNSAddress(ctx context.Context, domain string, addrs []netip.Addr) error
- func (s *DomainCtrl) ZMUpdateRecord(ctx context.Context, domain string, typ string, values []string) (changed bool, err error)
- type File
- func (s *File) DeleteRRSet(ctx context.Context, name, typ string) (changed bool, err error)
- func (s *File) ReplaceRRSet(ctx context.Context, name, typ string, ttl int, values []string) (changed bool, err error)
- func (s *File) Snapshot(_ context.Context) (ZoneSnapshot, error)
- func (s *File) UpdateACMEChallenge(ctx context.Context, domain string, newToken, oldToken string) error
- func (s *File) UpdateDDNSAddress(ctx context.Context, domain string, addrs []netip.Addr) error
- func (s *File) ZMUpdateRecord(ctx context.Context, domain string, typ string, newValues []string) (changed bool, err error)
- type Matcher
- type Matchers
- type RRSet
- type ZoneSnapshot
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 StripOrigin ¶
Types ¶
type Controller ¶
type Controller interface {
// ListZones returns all managed zones.
ListZones(ctx context.Context) ([]ZoneSnapshot, error)
// GetZone returns a managed zone by its origin name.
GetZone(ctx context.Context, zoneName string) (ZoneSnapshot, error)
// 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
// ReplaceRRSet replaces or creates the requested RRSet in a specific zone.
ReplaceRRSet(ctx context.Context, zoneName, name, typ string, ttl int, values []string) (changed bool, err error)
// DeleteRRSet removes the requested RRSet from a specific zone.
DeleteRRSet(ctx context.Context, zoneName, name, typ string) (changed bool, err 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) DeleteRRSet ¶ added in v0.11.0
func (*DomainCtrl) GetZone ¶ added in v0.11.0
func (s *DomainCtrl) GetZone(ctx context.Context, zoneName string) (ZoneSnapshot, error)
func (*DomainCtrl) ListZones ¶ added in v0.11.0
func (s *DomainCtrl) ListZones(ctx context.Context) ([]ZoneSnapshot, error)
func (*DomainCtrl) ReplaceRRSet ¶ added in v0.11.0
func (*DomainCtrl) UpdateACMEChallenge ¶
func (*DomainCtrl) UpdateDDNSAddress ¶
func (*DomainCtrl) ZMUpdateRecord ¶ added in v0.9.0
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) DeleteRRSet ¶ added in v0.11.0
func (*File) ReplaceRRSet ¶ added in v0.11.0
func (*File) Snapshot ¶ added in v0.11.0
func (s *File) Snapshot(_ context.Context) (ZoneSnapshot, error)
func (*File) UpdateACMEChallenge ¶
func (*File) UpdateDDNSAddress ¶
Click to show internal directories.
Click to hide internal directories.