-
Notifications
You must be signed in to change notification settings - Fork 82
/
client_http.go
56 lines (50 loc) · 1.02 KB
/
client_http.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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 []httpRetryConditional
//nolint:unused
retryAfter httpRetryAfter
//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
//nolint:unused
logger httpLogger
//nolint:unused
onBeforeRequest []func(*http.Request) error
//nolint:unused
onAfterResponse []func(*http.Response) error
}