2022-06-24 00:41:58 +00:00
|
|
|
package cloudflare
|
|
|
|
|
|
|
|
import (
|
|
|
|
"infra-sshfp-cf/sshfp"
|
|
|
|
|
|
|
|
"github.com/cloudflare/cloudflare-go"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
FindRecords(hostname string, recordType string) ([]cloudflare.DNSRecord, error)
|
|
|
|
CreateDNSRecord(hostname string, recordType string, payload cloudflare.DNSRecord) (int, error)
|
|
|
|
DeleteDNSRecord(recordID string) error
|
|
|
|
UpdateDNSRecord(hostname string, recordID string, payload cloudflare.DNSRecord) error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Service interface {
|
|
|
|
FindHostByName(hostname string) (bool, error)
|
|
|
|
GetSSHFPRecordsForHost(hostname string) ([]*sshfp.SSHFPRecord, error)
|
2022-06-27 15:47:07 +00:00
|
|
|
DeleteSSHFPRecordsForHost(hostname string) error
|
2022-06-24 00:41:58 +00:00
|
|
|
CreateSSHFPRecord(hostname string, record sshfp.SSHFPRecord) (int, error)
|
|
|
|
DeleteSSHFPRecord(hostname string, record sshfp.SSHFPRecord) error
|
|
|
|
UpdateSSHFPRecord(hostname string, record sshfp.SSHFPRecord) error
|
|
|
|
ApplyConfigPlan(configPlan sshfp.ConfigPlan) (int, error)
|
|
|
|
}
|