metaname

package module
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 11 Imported by: 3

README

Metaname provider for libdns

Go Reference

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

Create a provider with:

provider := metaname.Provider{APIKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    AccountReference: "xxxx"}

(use Endpoint: "https://test.metaname.net/api/1.1" for testing)

From there, the four standard methods work. Updating and deleting with a record reference ID retrieved from GetRecords or from a record in the array returned by AppendRecords and SetRecords works, while "guesswork matching" with only record data works in some cases.

There are three main limitations in the provider currently:

  • Guesswork matching requires a complete match for deletion, or a matching A/AAAA/CNAME type and name for setting.
  • Does not currently support priorities, as Metaname treats these as separate fields not represented in the libdns Record type.
  • Metaname fails with no message for certain erroneous configurations (e.g. additional record with existing CNAME at same name), and these are reported only with Metaname's "Internal error" code.

Samples

There are sample programs using the provider in the samples/ directory. These are usable programs to list/add/delete records, using three environment variables for configuration:

  • api_key
  • account_reference
  • api_endpoint (optional; default is the test endpoint)

A fourth program, exercise, uses the full range of functionality to retrieve, add, update, and remove records in a zone. This one makes non-configurable destructive changes and is only suitable as a basis or for testing.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomRecord added in v0.4.0

type CustomRecord struct {
	libdns.Record
	Metadata map[string]string
}

CustomRecord is a wrapper around libdns.Record to include Metadata.

type Provider

type Provider struct {
	APIKey           string `json:"api_key,omitempty"`
	AccountReference string `json:"account_reference,omitempty"`
	Endpoint         string `json:"endpoint,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with Metaname

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, ensuring that only the input records exist for each (name, type) pair.

Directories

Path Synopsis
samples
add command
delete command
exercise command
list command

Jump to

Keyboard shortcuts

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