package provider import ( "context" "github.com/vasyakrg/dns-autoresolver/internal/diff" "github.com/vasyakrg/dns-autoresolver/internal/model" ) // Credentials holds the provider-specific secret. It is stored encrypted and, // once decrypted, is a provider-defined value — for Selectel a JSON blob with // the service-user credentials (see selectel.Creds). type Credentials struct { Secret string } // Zone is a provider-neutral DNS zone reference. type Zone struct { ID string Name string } // Provider is implemented per DNS provider (Selectel first). type Provider interface { Name() string ListZones(ctx context.Context, creds Credentials) ([]Zone, error) GetRecords(ctx context.Context, creds Credentials, zoneID string) ([]model.Record, error) ApplyChanges(ctx context.Context, creds Credentials, zoneID string, cs diff.Changeset) error // Validate checks the credentials are usable (e.g. a trial auth), so a // bad account is rejected at creation time rather than at first import. Validate(ctx context.Context, creds Credentials) error }