Skip to content

libdns/luadns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaDNS for libdns

Go Reference

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

Usage:

// Init Provider struct.
provider := luadns.Provider{
	Email:  email,
	APIKey: key,
}

// List zone records.
records, err := provider.GetRecords(ctx, zone)
if err != nil {
	log.Fatalln(err)
}

// Set zone records.
records, err = provider.SetRecords(ctx, zone, records)
if err != nil {
	log.Fatalln(err)
}

// Append new records.
records, err = provider.AppendRecords(ctx, zone, []libdns.Record{
	libdns.Record{Name: "_acme-challenge", Type: "TXT", Value: "Hello, world!", TTL: 3600 * time.Second},
})
if err != nil {
	log.Fatalln(err)
}

// Delete a list of records.
_, err = provider.DeleteRecords(ctx, zone, records)
if err != nil {
	log.Fatalln(err)
}

For a complete example see _examples/main.go.

About

LuaDNS provider implementation for libdns

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages