github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/builtin/providers/powerdns/config.go (about)

     1  package powerdns
     2  
     3  import (
     4  	"fmt"
     5  	"log"
     6  )
     7  
     8  type Config struct {
     9  	ServerUrl string
    10  	ApiKey    string
    11  }
    12  
    13  // Client returns a new client for accessing PowerDNS
    14  func (c *Config) Client() (*Client, error) {
    15  	client, err := NewClient(c.ServerUrl, c.ApiKey)
    16  
    17  	if err != nil {
    18  		return nil, fmt.Errorf("Error setting up PowerDNS client: %s", err)
    19  	}
    20  
    21  	log.Printf("[INFO] PowerDNS Client configured for server %s", c.ServerUrl)
    22  
    23  	return client, nil
    24  }