mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-15 01:53:51 -06:00
With this refactor the DigitalOcean provider is updated to use the schema.Provider approach released with TF 0.2.
25 lines
423 B
Go
25 lines
423 B
Go
package digitalocean
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/pearkes/digitalocean"
|
|
)
|
|
|
|
type Config struct {
|
|
Token string
|
|
}
|
|
|
|
// Client() returns a new client for accessing digital ocean.
|
|
func (c *Config) Client() (*digitalocean.Client, error) {
|
|
client, err := digitalocean.NewClient(c.Token)
|
|
|
|
log.Printf("[INFO] DigitalOcean Client configured for URL: %s", client.URL)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return client, nil
|
|
}
|