github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/builtin/providers/cloudflare/config.go (about) 1 package cloudflare 2 3 import ( 4 "fmt" 5 "log" 6 7 "github.com/pearkes/cloudflare" 8 ) 9 10 type Config struct { 11 Email string 12 Token string 13 } 14 15 // Client() returns a new client for accessing cloudflare. 16 func (c *Config) Client() (*cloudflare.Client, error) { 17 client, err := cloudflare.NewClient(c.Email, c.Token) 18 19 if err != nil { 20 return nil, fmt.Errorf("Error setting up client: %s", err) 21 } 22 23 log.Printf("[INFO] CloudFlare Client configured for user: %s", client.Email) 24 25 return client, nil 26 }