github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/mailgun/config.go (about) 1 package mailgun 2 3 import ( 4 "log" 5 6 "github.com/pearkes/mailgun" 7 ) 8 9 type Config struct { 10 APIKey string 11 } 12 13 // Client() returns a new client for accessing mailgun. 14 // 15 func (c *Config) Client() (*mailgun.Client, error) { 16 17 // We don't set a domain right away 18 client, err := mailgun.NewClient(c.APIKey) 19 20 if err != nil { 21 return nil, err 22 } 23 24 log.Printf("[INFO] Mailgun Client configured ") 25 26 return client, nil 27 }