github.com/newrelic/newrelic-client-go@v1.1.0/pkg/cloud/cloud.go (about)

     1  package cloud
     2  
     3  import (
     4  	"github.com/newrelic/newrelic-client-go/internal/http"
     5  	"github.com/newrelic/newrelic-client-go/pkg/config"
     6  	"github.com/newrelic/newrelic-client-go/pkg/logging"
     7  )
     8  
     9  type Cloud struct {
    10  	client http.Client
    11  	config config.Config
    12  	logger logging.Logger
    13  	pager  http.Pager
    14  }
    15  
    16  func New(config config.Config) Cloud {
    17  
    18  	client := http.NewClient(config)
    19  	client.SetAuthStrategy(&http.PersonalAPIKeyCapableV2Authorizer{})
    20  
    21  	pkg := Cloud{
    22  		client: client,
    23  		config: config,
    24  		logger: config.GetLogger(),
    25  		pager:  &http.LinkHeaderPager{},
    26  	}
    27  
    28  	return pkg
    29  }