regfish

package module
v0.0.0-...-8b64bd8 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 9 Imported by: 1

README

regfish for libdns

Go Reference

This package implements the libdns interfaces for regfish DNS API, allowing you to manage DNS records.

Compatibility

This provider is compatible with libdns v1.1.0 and supports the following record types:

  • A/AAAA records - IPv4 and IPv6 addresses (using libdns.Address)
  • MX records - Mail exchange records with preference values (using libdns.MX)
  • TXT records - Text records (using libdns.TXT)
  • CNAME records - Canonical name records (using libdns.CNAME)
  • NS records - Name server records (using libdns.NS)
  • SRV records - Service records with priority, weight, and port (using libdns.SRV)
  • CAA records - Certificate Authority Authorization records (using libdns.CAA)
  • Other record types - Fallback to generic RR format (using libdns.RR)

Configuration

The provider expects the following configuration:

  • APIToken - a regfish API key (from Account, Security, API keys)

Features

  • Automatic parsing of MX record preference values from parsed records
  • Support for SRV record priority values
  • Proper handling of IPv4 and IPv6 addresses
  • Thread-safe operations with mutex protection
  • Comprehensive error handling and validation

Notes

This project was authored to support the needs for Caddy Server

Documentation

Overview

Package regfish implements a DNS record management client compatible with the libdns interfaces for regfish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	APIToken string
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with regfish.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the records from the zone. It returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone.

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones. It returns the updated records.

Jump to

Keyboard shortcuts

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