package dns

import "fmt"

// Config holds configuration for creating a DNS provider.
type Config struct {
	Token  string
	ZoneID string
}

// NewProvider creates a DNS provider by name.
// Returns nil, nil when providerName is empty (wildcard DNS mode).
func NewProvider(providerName string, cfg Config) (Provider, error) {
	switch providerName {
	case "":
		return nil, nil
	case "cloudflare":
		return NewCloudflare(cfg.Token, cfg.ZoneID)
	default:
		return nil, fmt.Errorf("unsupported DNS provider: %s", providerName)
	}
}
