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

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