Jakub Sokołowski 00d135e3a0
rename infra-sshfp-cf to sshfp-updater
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-08-02 15:23:28 +02:00

25 lines
895 B
Go

package cloudflare
import (
"sshfp-updater/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)
DeleteSSHFPRecordsForHost(hostname string) error
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)
}