github.com/chalford/terraform@v0.3.7-0.20150113080010-a78c69a8c81f/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  }