gandi

package module
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 10 Imported by: 1

README

Gandi for libdns

godoc reference

This package implements the libdns interfaces for Gandi.

Authenticating

This package supports API Key authentication but does not yet support Sharing ID authentication. Refer to the LiveDNS documentation for more information.

Start by retrieving your API key from the Security section in Gandi account admin panel to be able to make authenticated requests to the API.

Technical limitations

The LiveDNS documentation states that records with the same name and type are merged so that their rrset_values are grouped together.

{
  "rrset_type": "MX",
  "rrset_ttl": 1800,
  "rrset_name": "@",
  "rrset_href": "https://dns.api.gandi.net/api/v5/domains/gconfs.fr/records/@/MX",
  "rrset_values": [
    "1 aspmx.l.google.com.",
    "5 alt1.aspmx.l.google.com.",
    "5 alt2.aspmx.l.google.com.",
    "10 alt3.aspmx.l.google.com."
  ]
}

On the above example, such a design forces us to perform a PUT to add a new @ 1800 IN MX 10 alt4.aspmx.l.google.com. record instead of a simple POST. Thus, we can not use POST to add new records if there is already existing records with the same name and type.

That's why AppendRecord has the same behaviour than SetRecord. Due to these technical limitations, updating or appending records may affect the TTL of similar records which have the same name and type.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	APIToken string `json:"api_token,omitempty"`
	// contains filtered or unexported fields
}

Provider implements the libdns interfaces for Gandi.

func (*Provider) AppendRecords

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

AppendRecords adds records to the zone and returns the records that were created. Due to technical limitations of the LiveDNS API, it may affect the TTL of similar records

func (*Provider) DeleteRecords

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

DeleteRecords deletes records from the zone and 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, and returns the recordsthat were updated. Due to technical limitations of the LiveDNS API, it may affect the TTL of similar records.

Jump to

Keyboard shortcuts

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