File: client_http.go

package info (click to toggle)
golang-github-linode-linodego 1.55.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,112 kB
  • sloc: makefile: 96; sh: 52; python: 24
file content (56 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (2)
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
}