abra/pkg/dns/gandi.go
decentral1se 7ea3df45d4
All checks were successful
continuous-integration/drone/push Build is passing
WIP: dns support via libdns
2021-10-18 20:35:43 +02:00

53 lines
937 B
Go

package gandi
import (
"os"
"github.com/AlecAivazis/survey/v2"
"github.com/libdns/gandi"
"github.com/libdns/libdns"
"github.com/sirupsen/logrus"
)
func getToken() (string, error) {
if token, present := os.LookupEnv("GANDI_TOKEN"); present {
return token, nil
}
logrus.Debugf("no GANDI_TOKEN in environment, asking via stdin")
var token string
prompt := &survey.Input{
Message: "Gandi API token?",
}
if err := survey.AskOne(prompt, &token); err != nil {
return "", err
}
return token, nil
}
func getProvider() (gandi.Provider, error) {
token, err := getToken()
if err != nil {
return gandi.Provider{}, err
}
return gandi.Provider{APIToken: token}, nil
}
func ListDomains() ([]libdns.Record, error) {
return []libdns.Record{}, nil
}
func RemoveDomain() (bool, error) {
return false, nil
}
func AddDomain() (bool, error) {
return false, nil
}
func UpdateDomain() (bool, error) {
return false, nil
}