Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Commit

Permalink
Add ProxyURL API configuration option.
Browse files Browse the repository at this point in the history
  • Loading branch information
billmoritz authored and paultyng committed Aug 6, 2018
1 parent 6300728 commit 0847d10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type ErrorDetail struct {
type Config struct {
APIKey string
BaseURL string
ProxyURL string
Debug bool
TLSConfig *tls.Config
}
Expand All @@ -62,6 +63,11 @@ func New(config Config) Client {
baseURL = "https://api.newrelic.com/v2"
}

proxyURL := config.ProxyURL
if proxyURL != "" {
r.SetProxy(proxyURL)
}

r.SetHeader("X-Api-Key", config.APIKey)
r.SetHostURL(baseURL)

Expand Down

0 comments on commit 0847d10

Please sign in to comment.