opentofu/builtin/providers/cloudflare/config.go

21 lines
425 B
Go
Raw Normal View History

2014-07-25 11:21:15 -05:00
package cloudflare
import (
"log"
// NOTE: Temporary until they merge my PR:
"github.com/mitchellh/cloudflare-go"
2014-07-25 11:21:15 -05:00
)
type Config struct {
2014-11-17 11:57:41 -06:00
Email string
Token string
2014-07-25 11:21:15 -05:00
}
// Client() returns a new client for accessing cloudflare.
func (c *Config) Client() (*cloudflare.API, error) {
client := cloudflare.New(c.Token, c.Email)
log.Printf("[INFO] CloudFlare Client configured for user: %s", c.Email)
2014-07-25 11:21:15 -05:00
return client, nil
}