livedns

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 7 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	FQDN               string `json:"fqdn,omitempty"`
	DomainHref         string `json:"domain_href,omitempty"`
	DomainKeysHref     string `json:"domain_keys_href,omitempty"`
	DomainRecordsHref  string `json:"domain_records_href,omitempty"`
	AutomaticSnapshots *bool  `json:"automatic_snapshots,omitempty"`
}

Domain represents a DNS domain

type DomainRecord

type DomainRecord struct {
	RrsetType   string   `json:"rrset_type,omitempty"`
	RrsetTTL    int      `json:"rrset_ttl,omitempty"`
	RrsetName   string   `json:"rrset_name,omitempty"`
	RrsetHref   string   `json:"rrset_href,omitempty"`
	RrsetValues []string `json:"rrset_values,omitempty"`
}

DomainRecord represents a DNS Record

type LiveDNS

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

LiveDNS is the API client to the Gandi v5 LiveDNS API

func New

func New(config config.Config) *LiveDNS

New returns an instance of the LiveDNS API client

func NewFromClient

func NewFromClient(g client.Gandi) *LiveDNS

NewFromClient returns an instance of the LiveDNS API client

func (*LiveDNS) AddSlaveToDomain

func (g *LiveDNS) AddSlaveToDomain(fqdn, host string) (err error)

AddSlaveToDomain adds a slave to a domain

func (*LiveDNS) AddTsigToDomain

func (g *LiveDNS) AddTsigToDomain(fqdn, uuid string) (err error)

AddTsigToDomain adds a tsig to a domain

func (*LiveDNS) AssociateTSIGKeyWithDomain

func (g *LiveDNS) AssociateTSIGKeyWithDomain(fqdn string, id string) (response types.StandardResponse, err error)

AssociateTSIGKeyWithDomain retrieves the specified TSIG key

func (*LiveDNS) CreateDomain

func (g *LiveDNS) CreateDomain(fqdn string, ttl int) (response types.StandardResponse, err error)

CreateDomain adds a domain to a zone

func (*LiveDNS) CreateDomainRecord

func (g *LiveDNS) CreateDomainRecord(fqdn, name, recordtype string, ttl int, values []string) (response types.StandardResponse, err error)

CreateDomainRecord creates a record in the zone attached to a domain

func (*LiveDNS) CreateSnapshot

func (g *LiveDNS) CreateSnapshot(fqdn string) (response types.StandardResponse, err error)

CreateSnapshot creates a snapshot for a domain

func (*LiveDNS) CreateTSIGKey

func (g *LiveDNS) CreateTSIGKey(fqdn string) (response TSIGKey, err error)

CreateTSIGKey creates a TSIG key

func (*LiveDNS) CreateTsig

func (g *LiveDNS) CreateTsig() (tsig Tsig, err error)

CreateTsig creates a tsig

func (*LiveDNS) DelSlaveFromDomain

func (g *LiveDNS) DelSlaveFromDomain(fqdn, host string) (err error)

DelSlaveFromDomain removes a slave from a domain

func (*LiveDNS) DeleteAllDomainRecords

func (g *LiveDNS) DeleteAllDomainRecords(fqdn string) (err error)

DeleteAllDomainRecords deletes all records in the zone attached to a domain

func (*LiveDNS) DeleteDomainKey

func (g *LiveDNS) DeleteDomainKey(fqdn, uuid string) (err error)

DeleteDomainKey deletes a signing key from a domain

func (*LiveDNS) DeleteDomainRecord

func (g *LiveDNS) DeleteDomainRecord(fqdn, name, recordtype string) (err error)

DeleteDomainRecord deletes the record with the given name and the given type in the zone attached to a domain

func (*LiveDNS) DeleteDomainRecordsByName

func (g *LiveDNS) DeleteDomainRecordsByName(fqdn, name string) (err error)

DeleteDomainRecordsByName deletes all records with the given name in the zone attached to a domain

func (*LiveDNS) DeleteSnapshot

func (g *LiveDNS) DeleteSnapshot(fqdn, snapUUID string) (err error)

DeleteSnapshot deletes a snapshot for a domain

func (*LiveDNS) GetDomain

func (g *LiveDNS) GetDomain(fqdn string) (domain Domain, err error)

GetDomain returns a domain

func (*LiveDNS) GetDomainKey

func (g *LiveDNS) GetDomainKey(fqdn, uuid string) (key SigningKey, err error)

GetDomainKey return a specific signing key from a domain

func (*LiveDNS) GetDomainKeys

func (g *LiveDNS) GetDomainKeys(fqdn string) (keys []SigningKey, err error)

GetDomainKeys returns data about the signing keys created for a domain

func (*LiveDNS) GetDomainNS

func (g *LiveDNS) GetDomainNS(fqdn string) (ns []string, err error)

GetDomainNS returns the list of the nameservers for a domain

func (*LiveDNS) GetDomainRecordByNameAndType

func (g *LiveDNS) GetDomainRecordByNameAndType(fqdn, name, recordtype string) (record DomainRecord, err error)

GetDomainRecordByNameAndType gets the record with specific name and type in the zone attached to the domain

func (*LiveDNS) GetDomainRecords

func (g *LiveDNS) GetDomainRecords(fqdn string) (records []DomainRecord, err error)

GetDomainRecords lists all records in the zone associated with a domain

func (*LiveDNS) GetDomainRecordsAsText

func (g *LiveDNS) GetDomainRecordsAsText(uuid string) ([]byte, error)

GetDomainRecordsAsText lists all records in a zone and returns them as a text file ... and by text, I mean a slice of bytes

func (*LiveDNS) GetDomainRecordsByName

func (g *LiveDNS) GetDomainRecordsByName(fqdn, name string) (records []DomainRecord, err error)

GetDomainRecordsByName lists all records with a specific name in a zone

func (*LiveDNS) GetDomainTSIGKeys

func (g *LiveDNS) GetDomainTSIGKeys(fqdn string) (response []TSIGKey, err error)

GetDomainTSIGKeys retrieves the specified TSIG key

func (*LiveDNS) GetSnapshot

func (g *LiveDNS) GetSnapshot(fqdn, snapUUID string) (snapshot Snapshot, err error)

GetSnapshot returns a snapshot for a domain

func (*LiveDNS) GetTSIGKey

func (g *LiveDNS) GetTSIGKey(id string) (response TSIGKey, err error)

GetTSIGKey retrieves the specified TSIG key

func (*LiveDNS) GetTSIGKeys

func (g *LiveDNS) GetTSIGKeys() (response []TSIGKey, err error)

GetTSIGKeys retrieves all the TSIG keys for the account

func (*LiveDNS) GetTsig

func (g *LiveDNS) GetTsig(uuid string) (tsig Tsig, err error)

GetTsig lists more tsig details

func (*LiveDNS) GetTsigBIND

func (g *LiveDNS) GetTsigBIND(uuid string) ([]byte, error)

GetTsigBIND shows a BIND nameserver config, and includes the nameservers available for zone transfers

func (*LiveDNS) GetTsigKnot

func (g *LiveDNS) GetTsigKnot(uuid string) ([]byte, error)

GetTsigKnot shows a Knot nameserver config, and includes the nameservers available for zone transfers

func (*LiveDNS) GetTsigNSD

func (g *LiveDNS) GetTsigNSD(uuid string) ([]byte, error)

GetTsigNSD shows a NSD nameserver config, and includes the nameservers available for zone transfers

func (*LiveDNS) GetTsigPowerDNS

func (g *LiveDNS) GetTsigPowerDNS(uuid string) ([]byte, error)

GetTsigPowerDNS shows a PowerDNS nameserver config, and includes the nameservers available for zone transfers

func (*LiveDNS) ListDomains

func (g *LiveDNS) ListDomains() (domains []Domain, err error)

ListDomains lists all domains

func (*LiveDNS) ListSlavesInDomain

func (g *LiveDNS) ListSlavesInDomain(fqdn string) (slaves []string, err error)

ListSlavesInDomain lists slaves in a domain

func (*LiveDNS) ListSnapshots

func (g *LiveDNS) ListSnapshots(fqdn string) (snapshots []Snapshot, err error)

ListSnapshots lists all snapshots for a domain

func (*LiveDNS) ListTsigs

func (g *LiveDNS) ListTsigs() (tsigs []Tsig, err error)

ListTsigs lists all tsigs

func (*LiveDNS) RemoveTSIGKeyFromDomain

func (g *LiveDNS) RemoveTSIGKeyFromDomain(fqdn string, id string) (err error)

RemoveTSIGKeyFromDomain retrieves the specified TSIG key

func (*LiveDNS) SignDomain

func (g *LiveDNS) SignDomain(fqdn string) (response types.StandardResponse, err error)

SignDomain creates a DNSKEY and asks Gandi servers to automatically sign the domain. The UUID of the created key is stored into the response.UUID field.

func (*LiveDNS) UpdateDomain

func (g *LiveDNS) UpdateDomain(fqdn string, details UpdateDomainRequest) (response types.StandardResponse, err error)

UpdateDomain changes the zone associated to a domain

func (*LiveDNS) UpdateDomainKey

func (g *LiveDNS) UpdateDomainKey(fqdn, uuid string, deleted bool) (err error)

UpdateDomainKey updates a signing key for a domain (only the deleted status, actually...)

func (*LiveDNS) UpdateDomainRecordByNameAndType

func (g *LiveDNS) UpdateDomainRecordByNameAndType(fqdn, name, recordtype string, ttl int, values []string) (response types.StandardResponse, err error)

UpdateDomainRecordByNameAndType changes the record with the given name and the given type in the zone attached to a domain

func (*LiveDNS) UpdateDomainRecords

func (g *LiveDNS) UpdateDomainRecords(fqdn string, records []DomainRecord) (response types.StandardResponse, err error)

UpdateDomainRecords changes all records in the zone attached to a domain

func (*LiveDNS) UpdateDomainRecordsByName

func (g *LiveDNS) UpdateDomainRecordsByName(fqdn, name string, records []DomainRecord) (response types.StandardResponse, err error)

UpdateDomainRecordsByName changes all records with the given name in the zone attached to the domain

type SigningKey

type SigningKey struct {
	Status        string `json:"status,omitempty"`
	UUID          string `json:"id,omitempty"`
	Algorithm     int    `json:"algorithm,omitempty"`
	Deleted       *bool  `json:"deleted,omitempty"`
	AlgorithmName string `json:"algorithm_name,omitempty"`
	FQDN          string `json:"fqdn,omitempty"`
	Flags         int    `json:"flags,omitempty"`
	DS            string `json:"ds,omitempty"`
	PublicKey     string `json:"public_key,omitempty"`
	Tag           int    `json:"tag,omitempty"`
	KeyHref       string `json:"key_href,omitempty"`
}

SigningKey holds data about a DNSSEC signing key

type Snapshot

type Snapshot struct {
	Automatic    *bool          `json:"automatic,omitempty"`
	CreatedAt    time.Time      `json:"created_at,omitempty"`
	ID           string         `json:"id,omitempty"`
	Name         string         `json:"name,omitempty"`
	SnapshotHREF string         `json:"snapshot_href,omitempty"`
	ZoneData     []DomainRecord `json:"zone_data,omitempty"`
}

Snapshot represents a point in time record of a domain

type TSIGKey

type TSIGKey struct {
	KeyHREF       string        `json:"href,omitempty"`
	ID            string        `json:"id,omitempty"`
	KeyName       string        `json:"key_name,omitempty"`
	Secret        string        `json:"secret,omitempty"`
	ConfigSamples configSamples `json:"config_samples,omitempty"`
}

TSIGKey describes the TSIG key associated with an AXFR secondary

type Tsig

type Tsig struct {
	KeyName       string      `json:"key_name,omitempty"`
	Secret        string      `json:"secret,omitempty"`
	UUID          string      `json:"uuid,omitempty"`
	AxfrTsigURL   string      `json:"axfr_tsig_url,omitempty"`
	ConfigSamples interface{} `json:"config_samples,omitempty"`
}

Tsig contains tsig data (no kidding!)

type UpdateDomainRequest

type UpdateDomainRequest struct {
	AutomaticSnapshots *bool `json:"automatic_snapshots,omitempty"`
}

UpdateDomainRequest contains the params for the UpdateDomain method

Jump to

Keyboard shortcuts

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