github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/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  }