opentofu/builtin/providers/mailgun/config.go
Sander van Harmelen 2cb1fd8987 Updated the provider to make testing a little easier
Also makes the provider more inline with the others following the TF
0.2 approach.
2014-11-18 15:21:32 +01:00

28 lines
412 B
Go

package mailgun
import (
"log"
"github.com/pearkes/mailgun"
)
type Config struct {
APIKey string
}
// Client() returns a new client for accessing mailgun.
//
func (c *Config) Client() (*mailgun.Client, error) {
// We don't set a domain right away
client, err := mailgun.NewClient(c.APIKey)
if err != nil {
return nil, err
}
log.Printf("[INFO] Mailgun Client configured ")
return client, nil
}