opentofu/builtin/providers/datadog/config.go
Otto Jongerius 2310316666 provider/datadog: Upgrade to Datadog API v2 (#12098)
* provider/datadog: Pulls v2 and removes v1 of library go-datadog-api.

    See https://github.com/zorkian/go-datadog-api/issues/56 for context.

    * Fixes bug in backoff implementation that decreased performance significantly.
    * Uses pointers for field types, providing support of distinguishing
        between if a value is set, or the default value for that type is
        effective.

* provider/datadog: Convert provider to use v2 of go-datadog-api.

* provider/datadog: Update vendored library.

* provider/datadog: Update dashboard resource to reflect API updates.
2017-02-20 14:48:32 +02:00

23 lines
391 B
Go

package datadog
import (
"log"
"gopkg.in/zorkian/go-datadog-api.v2"
)
// Config holds API and APP keys to authenticate to Datadog.
type Config struct {
APIKey string
APPKey string
}
// Client returns a new Datadog client.
func (c *Config) Client() *datadog.Client {
client := datadog.NewClient(c.APIKey, c.APPKey)
log.Printf("[INFO] Datadog Client configured ")
return client
}