opentofu/builtin/providers/heroku/config.go
Sander van Harmelen 1b6f37b6eb Fixed tests and updated the provider schema to use a DefaultFunc
The default stack changed from ‘cedar’ to ‘cedar-14’, so updated the
acceptance tests to reflect this.

Updating the schema makes testing easier and gives you a way to
configure the provider using env variables. It also makes the provider
more inline following the TF 0.2 approach.
2014-11-19 14:25:18 +01:00

30 lines
517 B
Go

package heroku
import (
"log"
"net/http"
"github.com/cyberdelia/heroku-go/v3"
)
type Config struct {
Email string
APIKey string
}
// Client() returns a new Service for accessing Heroku.
//
func (c *Config) Client() (*heroku.Service, error) {
service := heroku.NewService(&http.Client{
Transport: &heroku.Transport{
Username: c.Email,
Password: c.APIKey,
UserAgent: heroku.DefaultUserAgent,
},
})
log.Printf("[INFO] Heroku Client configured for user: %s", c.Email)
return service, nil
}