client_http.go raw

   1  package linodego
   2  
   3  import (
   4  	"net/http"
   5  	"sync"
   6  	"time"
   7  )
   8  
   9  // Client is a wrapper around the Resty client
  10  //
  11  //nolint:unused
  12  type httpClient struct {
  13  	//nolint:unused
  14  	httpClient *http.Client
  15  	//nolint:unused
  16  	userAgent string
  17  	//nolint:unused
  18  	debug bool
  19  	//nolint:unused
  20  	retryConditionals []httpRetryConditional
  21  	//nolint:unused
  22  	retryAfter httpRetryAfter
  23  
  24  	//nolint:unused
  25  	pollInterval time.Duration
  26  
  27  	//nolint:unused
  28  	baseURL string
  29  	//nolint:unused
  30  	apiVersion string
  31  	//nolint:unused
  32  	apiProto string
  33  	//nolint:unused
  34  	selectedProfile string
  35  	//nolint:unused
  36  	loadedProfile string
  37  
  38  	//nolint:unused
  39  	configProfiles map[string]ConfigProfile
  40  
  41  	// Fields for caching endpoint responses
  42  	//nolint:unused
  43  	shouldCache bool
  44  	//nolint:unused
  45  	cacheExpiration time.Duration
  46  	//nolint:unused
  47  	cachedEntries map[string]clientCacheEntry
  48  	//nolint:unused
  49  	cachedEntryLock *sync.RWMutex
  50  	//nolint:unused
  51  	logger httpLogger
  52  	//nolint:unused
  53  	onBeforeRequest []func(*http.Request) error
  54  	//nolint:unused
  55  	onAfterResponse []func(*http.Response) error
  56  }
  57