code: func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
  	if config == nil {
  		return nil, errors.New("rackspace: the configuration of the DNS provider is nil")
  	}
  
  	if config.APIUser == "" || config.APIKey == "" {
  		return nil, fmt.Errorf("rackspace: credentials missing")
  	}
  
  	identity, err := login(config)
  	if err != nil {
  		return nil, fmt.Errorf("rackspace: %v", err)
  	}
  
  	// Iterate through the Service Catalog to get the DNS Endpoint
  	var dnsEndpoint string
  	for _, service := range identity.Access.ServiceCatalog {
  		if service.Name == "cloudDNS" {
  			dnsEndpoint = service.Endpoints[0].PublicURL
  			break
  		}
  	}
  
  	if dnsEndpoint == "" {
  		return nil, fmt.Errorf("rackspace: failed to populate DNS endpoint, check Rackspace API for changes")
  	}
  
  	return &DNSProvider{
  		config:           config,
  		token:            identity.Access.Token.ID,
  		cloudDNSEndpoint: dnsEndpoint,
  	}, nil
  
  }
docs: // NewDNSProviderConfig return a DNSProvider instance configured for Rackspace.
  // It authenticates against the API, also grabbing the DNS Endpoint.