2016-01-26 11:14:10 +00:00
|
|
|
package acme
|
|
|
|
|
|
|
|
import (
|
2016-01-26 11:25:51 +00:00
|
|
|
"fmt"
|
|
|
|
|
2016-01-26 11:14:10 +00:00
|
|
|
"github.com/weppos/go-dnsimple/dnsimple"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DNSProviderDNSimple is an implementation of the DNSProvider interface.
|
|
|
|
type DNSProviderDNSimple struct {
|
|
|
|
client *dnsimple.Client
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewDNSProviderDNSimple returns a DNSProviderDNSimple instance with a configured dnsimple client.
|
|
|
|
// Authentication is either done using the passed credentials.
|
|
|
|
func NewDNSProviderDNSimple(dnsimpleEmail, dnsimpleApiKey string) (*DNSProviderDNSimple, error) {
|
2016-01-26 11:25:51 +00:00
|
|
|
if dnsimpleEmail == "" || dnsimpleApiKey == "" {
|
|
|
|
return nil, fmt.Errorf("DNSimple credentials missing")
|
|
|
|
}
|
|
|
|
|
|
|
|
c := &DNSProviderDNSimple{
|
|
|
|
client: dnsimple.NewClient(dnsimpleApiKey, dnsimpleEmail),
|
|
|
|
}
|
|
|
|
|
|
|
|
return c, nil
|
2016-01-26 11:14:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Present creates a TXT record to fulfil the dns-01 challenge.
|
|
|
|
func (c *DNSProviderDNSimple) Present(domain, token, keyAuth string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// CleanUp removes the TXT record matching the specified parameters.
|
|
|
|
func (c *DNSProviderDNSimple) CleanUp(domain, token, keyAuth string) error {
|
|
|
|
return nil
|
|
|
|
}
|