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

     1  // Package dashboards provides a programmatic API for interacting with New Relic dashboards.
     2  package dashboards
     3  
     4  import (
     5  	"github.com/newrelic/newrelic-client-go/internal/http"
     6  	"github.com/newrelic/newrelic-client-go/pkg/config"
     7  	"github.com/newrelic/newrelic-client-go/pkg/logging"
     8  )
     9  
    10  // Dashboards is used to communicate with the New Relic Dashboards product.
    11  type Dashboards struct {
    12  	client http.Client
    13  	config config.Config
    14  	logger logging.Logger
    15  	pager  http.Pager
    16  }
    17  
    18  // New is used to create a new Dashboards client instance.
    19  func New(config config.Config) Dashboards {
    20  	client := http.NewClient(config)
    21  	client.SetAuthStrategy(&http.PersonalAPIKeyCapableV2Authorizer{})
    22  
    23  	pkg := Dashboards{
    24  		client: client,
    25  		config: config,
    26  		logger: config.GetLogger(),
    27  		pager:  &http.LinkHeaderPager{},
    28  	}
    29  
    30  	return pkg
    31  }