-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented doRequest helper method (#557)
* Implemented doRequest helper method and added unit tests * Added more detailed response for HTTP errors * Addressed pr comments * Addressed more pr comments
- Loading branch information
1 parent
a83ab1a
commit a9e3be2
Showing
5 changed files
with
451 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package linodego | ||
|
||
import ( | ||
"net/http" | ||
"sync" | ||
"time" | ||
) | ||
|
||
// Client is a wrapper around the Resty client | ||
// | ||
//nolint:unused | ||
type httpClient struct { | ||
//nolint:unused | ||
httpClient *http.Client | ||
//nolint:unused | ||
userAgent string | ||
//nolint:unused | ||
debug bool | ||
//nolint:unused | ||
retryConditionals []RetryConditional | ||
|
||
//nolint:unused | ||
pollInterval time.Duration | ||
|
||
//nolint:unused | ||
baseURL string | ||
//nolint:unused | ||
apiVersion string | ||
//nolint:unused | ||
apiProto string | ||
//nolint:unused | ||
selectedProfile string | ||
//nolint:unused | ||
loadedProfile string | ||
|
||
//nolint:unused | ||
configProfiles map[string]ConfigProfile | ||
|
||
// Fields for caching endpoint responses | ||
//nolint:unused | ||
shouldCache bool | ||
//nolint:unused | ||
cacheExpiration time.Duration | ||
//nolint:unused | ||
cachedEntries map[string]clientCacheEntry | ||
//nolint:unused | ||
cachedEntryLock *sync.RWMutex | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.