diff --git a/.golangci.yml b/.golangci.yml index 01c8b690c..79823aa57 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -31,9 +31,9 @@ linters-settings: include-go-root: false packages: - github.com/davecgh/go-spew/spew - # misspell: - # ignore-words: - # - newrelic + misspell: + ignore-words: + - newrelic lll: # max line length, lines longer will be reported. Default is 120. # '\t' is counted as 1 character by default, and can be changed with the tab-width option @@ -51,12 +51,12 @@ linters: enable: - errcheck - gocyclo - # - gofmt + - gofmt - revive - gosimple - govet - ineffassign - # - misspell + - misspell - staticcheck - unconvert - unused diff --git a/build/lint.mk b/build/lint.mk index f15d42605..312be2e5f 100644 --- a/build/lint.mk +++ b/build/lint.mk @@ -22,7 +22,7 @@ PROJECT_MODULE ?= $(shell $(GO) list -m) GO_MOD_OUTDATED ?= go-mod-outdated -lint: deps lint-commit golangci goimports outdated # spell-check gofmt +lint: deps spell-check gofmt lint-commit golangci goimports outdated lint-fix: deps spell-check-fix gofmt-fix goimports # diff --git a/internal/http/graphql.go b/internal/http/graphql.go index 0d4fb09cc..5e52464f6 100644 --- a/internal/http/graphql.go +++ b/internal/http/graphql.go @@ -94,7 +94,8 @@ func (r *GraphQLErrorResponse) IsPaymentRequired(resp *http.Response) bool { // is deprecated. We want to bubble that up, but not stop returning data // // Example deprecation message: -// This field is deprecated! Please use `relatedEntities` instead. +// +// This field is deprecated! Please use `relatedEntities` instead. func (r *GraphQLErrorResponse) IsDeprecated() bool { for _, err := range r.Errors { if strings.HasPrefix(err.Message, "This field is deprecated!") { diff --git a/newrelic/doc.go b/newrelic/doc.go index 4c68444e8..7e628bdac 100644 --- a/newrelic/doc.go +++ b/newrelic/doc.go @@ -3,13 +3,12 @@ Package newrelic is a convenience package that provides a programmatic API surfa area for interacting with all the New Relic One products encompassed by this project. Refer to each package's documentation to learn more about its capabilities. -Authentication +# Authentication You will need a valid Personal API to communicate with the backend New Relic APIs that this client communicates with. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package newrelic diff --git a/pkg/accountmanagement/accountmanagement_integration_test.go b/pkg/accountmanagement/accountmanagement_integration_test.go index a4f29242f..5fed396a6 100644 --- a/pkg/accountmanagement/accountmanagement_integration_test.go +++ b/pkg/accountmanagement/accountmanagement_integration_test.go @@ -3,8 +3,9 @@ package accountmanagement import ( "testing" - mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" "github.com/stretchr/testify/require" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) func TestIntegrationCreateAccount(t *testing.T) { diff --git a/pkg/accounts/doc.go b/pkg/accounts/doc.go index d083ecfce..61456f62b 100644 --- a/pkg/accounts/doc.go +++ b/pkg/accounts/doc.go @@ -2,13 +2,12 @@ Package accounts provides a programmatic API for interacting with New Relic accounts. It can be used to retrieve details about all accounts the user is authorized to view. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package accounts diff --git a/pkg/agentapplications/agentapplications_integration_test.go b/pkg/agentapplications/agentapplications_integration_test.go index 63a4f6e9e..5846e2f80 100644 --- a/pkg/agentapplications/agentapplications_integration_test.go +++ b/pkg/agentapplications/agentapplications_integration_test.go @@ -6,9 +6,10 @@ package agentapplications import ( "testing" + "github.com/stretchr/testify/require" + "github.com/newrelic/newrelic-client-go/v2/pkg/common" "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" - "github.com/stretchr/testify/require" ) // GUID for Dummy App in integration test account diff --git a/pkg/alerts/doc.go b/pkg/alerts/doc.go index 3f9028d63..bc63d2eca 100644 --- a/pkg/alerts/doc.go +++ b/pkg/alerts/doc.go @@ -22,7 +22,7 @@ Alerts product. It can be used for a variety of operations, including: - Associating one or more alert conditions with a policy -Authentication +# Authentication You will need a valid API key to communicate with the backend New Relic APIs that provide this functionality. Use a Personal API key for authentication. @@ -30,6 +30,5 @@ See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package alerts diff --git a/pkg/alerts/nrql_conditions_integration_test.go b/pkg/alerts/nrql_conditions_integration_test.go index 71af61611..0ec623d30 100644 --- a/pkg/alerts/nrql_conditions_integration_test.go +++ b/pkg/alerts/nrql_conditions_integration_test.go @@ -228,7 +228,7 @@ var ( } ) -//REST API integration test (deprecated) +// REST API integration test (deprecated) func TestIntegrationNrqlConditions(t *testing.T) { t.Parallel() diff --git a/pkg/apiaccess/insights_keys_integration_test.go b/pkg/apiaccess/insights_keys_integration_test.go index f510d0f52..2d42cf95d 100644 --- a/pkg/apiaccess/insights_keys_integration_test.go +++ b/pkg/apiaccess/insights_keys_integration_test.go @@ -73,7 +73,7 @@ func TestIntegrationAPIAccess_InsightsQueryKeys(t *testing.T) { require.NotNil(t, deleteResult) } -//nolint: unused +// nolint: unused func newIntegrationTestClient(t *testing.T) APIAccess { tc := mock.NewIntegrationTestConfig(t) diff --git a/pkg/apiaccess/keys.go b/pkg/apiaccess/keys.go index 3dd586ca3..b20e8400e 100644 --- a/pkg/apiaccess/keys.go +++ b/pkg/apiaccess/keys.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "github.com/newrelic/newrelic-client-go/v2/internal/http" ) diff --git a/pkg/apiaccess/keys_integration_test.go b/pkg/apiaccess/keys_integration_test.go index 65a72509c..c9e8089f1 100644 --- a/pkg/apiaccess/keys_integration_test.go +++ b/pkg/apiaccess/keys_integration_test.go @@ -4,11 +4,13 @@ package apiaccess import ( - mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" - "github.com/stretchr/testify/require" "regexp" "strings" "testing" + + "github.com/stretchr/testify/require" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) func TestIntegrationAPIAccess_IngestKeys(t *testing.T) { diff --git a/pkg/apm/doc.go b/pkg/apm/doc.go index a52849440..5beb9ce6e 100644 --- a/pkg/apm/doc.go +++ b/pkg/apm/doc.go @@ -10,7 +10,7 @@ APM product. It can be used for a variety of operations, including: - Creating, reading, and deleting APM labels -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic APIs that provide this functionality. See the API key documentation below for @@ -18,7 +18,7 @@ more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys -Labels +# Labels New Relic One entity tags are currently the preferred method for organizing your New Relic resources. Consider using entity tags via the `entities` package if @@ -26,6 +26,5 @@ you are just getting started. More information about entity tags and APM labels can be found at the following URL: https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/tagging-use-tags-organize-group-what-you-monitor#labels - */ package apm diff --git a/pkg/cloud/cloud_api_integration_test.go b/pkg/cloud/cloud_api_integration_test.go index 3282b7cfe..0a7ed828b 100644 --- a/pkg/cloud/cloud_api_integration_test.go +++ b/pkg/cloud/cloud_api_integration_test.go @@ -8,8 +8,9 @@ import ( "strings" "testing" - mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" "github.com/stretchr/testify/require" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) func TestCloudAccount_Basic(t *testing.T) { diff --git a/pkg/cloud/cloud_api_unit_test.go b/pkg/cloud/cloud_api_unit_test.go index 44d9439aa..c130b8a01 100644 --- a/pkg/cloud/cloud_api_unit_test.go +++ b/pkg/cloud/cloud_api_unit_test.go @@ -8,8 +8,9 @@ import ( "strconv" "testing" - mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" "github.com/stretchr/testify/assert" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) var ( diff --git a/pkg/config/doc.go b/pkg/config/doc.go index fbfe14e7f..d5b2407bf 100644 --- a/pkg/config/doc.go +++ b/pkg/config/doc.go @@ -2,13 +2,12 @@ Package config provides a configuration surface area for configuring the underlying client. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic APIs that power the client. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package config diff --git a/pkg/dashboards/doc.go b/pkg/dashboards/doc.go index b7af2988b..4efac3e26 100644 --- a/pkg/dashboards/doc.go +++ b/pkg/dashboards/doc.go @@ -6,13 +6,12 @@ on working with these resources: https://docs.newrelic.com/docs/insights/insights-api/manage-dashboards/insights-dashboard-api -Authentication +# Authentication You will need a Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package dashboards diff --git a/pkg/edge/doc.go b/pkg/edge/doc.go index f16d30cb6..c9d6fd90d 100644 --- a/pkg/edge/doc.go +++ b/pkg/edge/doc.go @@ -3,13 +3,12 @@ Package edge provides a programmatic API for interacting with New Relic Edge wit infinite tracing. It can be used to enable New Relic Edge and retrieve relevant config parameters. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package edge diff --git a/pkg/entities/doc.go b/pkg/entities/doc.go index a5864915c..5267e0dd9 100644 --- a/pkg/entities/doc.go +++ b/pkg/entities/doc.go @@ -6,13 +6,12 @@ entities. It can be used for a variety of operations, including: - Creating, reading, updating, and deleting New Relic One entity tags -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package entities diff --git a/pkg/entities/entities_api.go b/pkg/entities/entities_api.go index 55f0afaa7..fa7110374 100644 --- a/pkg/entities/entities_api.go +++ b/pkg/entities/entities_api.go @@ -9,9 +9,10 @@ import ( ) // Adds the provided tags to your specified entity, without deleting existing ones. -// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingAddTagsToEntity( gUID common.EntityGUID, tags []TaggingTagInput, @@ -23,9 +24,10 @@ func (a *Entities) TaggingAddTagsToEntity( } // Adds the provided tags to your specified entity, without deleting existing ones. -// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// The maximum number of tag-values per entity is 100; if the sum of existing and new tag-values if over the limit this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingAddTagsToEntityWithContext( ctx context.Context, gUID common.EntityGUID, @@ -64,7 +66,7 @@ const TaggingAddTagsToEntityMutation = `mutation( // Delete specific tag keys from the entity. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingDeleteTagFromEntity( gUID common.EntityGUID, tagKeys []string, @@ -77,7 +79,7 @@ func (a *Entities) TaggingDeleteTagFromEntity( // Delete specific tag keys from the entity. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingDeleteTagFromEntityWithContext( ctx context.Context, gUID common.EntityGUID, @@ -116,7 +118,7 @@ const TaggingDeleteTagFromEntityMutation = `mutation( // Delete specific tag key-values from the entity. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingDeleteTagValuesFromEntity( gUID common.EntityGUID, tagValues []TaggingTagValueInput, @@ -129,7 +131,7 @@ func (a *Entities) TaggingDeleteTagValuesFromEntity( // Delete specific tag key-values from the entity. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingDeleteTagValuesFromEntityWithContext( ctx context.Context, gUID common.EntityGUID, @@ -167,9 +169,10 @@ const TaggingDeleteTagValuesFromEntityMutation = `mutation( } }` // Replaces the entity's entire set of tags with the provided tag set. -// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingReplaceTagsOnEntity( gUID common.EntityGUID, tags []TaggingTagInput, @@ -181,9 +184,10 @@ func (a *Entities) TaggingReplaceTagsOnEntity( } // Replaces the entity's entire set of tags with the provided tag set. -// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. // -// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). +// The maximum number of tag-values per entity is 100; if more than 100 tag-values are provided this mutation will fail. +// +// For details and mutation examples, visit [our docs](https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-tagging-api-tutorial). func (a *Entities) TaggingReplaceTagsOnEntityWithContext( ctx context.Context, gUID common.EntityGUID, diff --git a/pkg/events/doc.go b/pkg/events/doc.go index d19f57be4..86d51555f 100644 --- a/pkg/events/doc.go +++ b/pkg/events/doc.go @@ -1,13 +1,12 @@ /* Package events provides a programmatic API for creating custom events in New Relic. -Authentication +# Authentication You will need a valid Insights insert key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package events diff --git a/pkg/events/events_batch.go b/pkg/events/events_batch.go index f357565e2..1c1f4efb8 100644 --- a/pkg/events/events_batch.go +++ b/pkg/events/events_batch.go @@ -136,11 +136,9 @@ func (e *Events) Flush() error { return nil } -// // batchWorker reads []byte from the queue until a threshold is passed, // then copies the []byte it has read and sends that batch along to Insights // in its own goroutine. -// func (e *Events) batchWorker(ctx context.Context, id int) (err error) { if e == nil { return errors.New("batchWorker: invalid Events, unable to start worker") @@ -173,10 +171,8 @@ func (e *Events) batchWorker(ctx context.Context, id int) (err error) { } } -// // watchdog has a Timer that will send the results once the // it has expired. -// func (e *Events) watchdog(ctx context.Context) (err error) { if e.eventTimer == nil { return errors.New("invalid timer for watchdog()") diff --git a/pkg/logconfigurations/grok_pattern_check_integration_test.go b/pkg/logconfigurations/grok_pattern_check_integration_test.go index 5be3a7713..fb8df4ce2 100644 --- a/pkg/logconfigurations/grok_pattern_check_integration_test.go +++ b/pkg/logconfigurations/grok_pattern_check_integration_test.go @@ -4,9 +4,11 @@ package logconfigurations import ( - mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" + + mock "github.com/newrelic/newrelic-client-go/v2/pkg/testhelpers" ) func TestIntegrationTestGrok_WithMatch(t *testing.T) { diff --git a/pkg/logs/example_log_batch_test.go b/pkg/logs/example_log_batch_test.go index 5bda57894..20c093fa1 100644 --- a/pkg/logs/example_log_batch_test.go +++ b/pkg/logs/example_log_batch_test.go @@ -16,7 +16,7 @@ const ( BatchTimeoutSeconds = 5 ) -//func TestExample_log_batch(t *testing.T) { +// func TestExample_log_batch(t *testing.T) { func Example_basic() { // Initialize the client configuration. A New Relic License Key is required to communicate with the backend API. cfg := config.New() diff --git a/pkg/logs/logs_batch.go b/pkg/logs/logs_batch.go index a7d9c4f59..c4ec91427 100644 --- a/pkg/logs/logs_batch.go +++ b/pkg/logs/logs_batch.go @@ -130,11 +130,9 @@ func (e *Logs) Flush() error { return nil } -// // batchWorker reads []byte from the queue until a threshold is passed, // then copies the []byte it has read and sends that batch along to Logs // in its own goroutine. -// func (e *Logs) batchWorker(ctx context.Context, id int) (err error) { e.logger.Trace("batchWorker") @@ -166,10 +164,8 @@ func (e *Logs) batchWorker(ctx context.Context, id int) (err error) { } } -// // watchdog has a Timer that will send the results once the // it has expired. -// func (e *Logs) watchdog(ctx context.Context) (err error) { e.logger.Trace("watchdog") if e.logTimer == nil { diff --git a/pkg/nerdgraph/doc.go b/pkg/nerdgraph/doc.go index 0665833fe..9c63b2a27 100644 --- a/pkg/nerdgraph/doc.go +++ b/pkg/nerdgraph/doc.go @@ -6,13 +6,12 @@ the NerdGraph API: https://api.newrelic.com/graphiql?# -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package nerdgraph diff --git a/pkg/nerdstorage/doc.go b/pkg/nerdstorage/doc.go index 880aa591a..8a1b312c6 100644 --- a/pkg/nerdstorage/doc.go +++ b/pkg/nerdstorage/doc.go @@ -8,13 +8,12 @@ documentation: https://developer.newrelic.com/build-tools/new-relic-one-applications/nerdstorage -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package nerdstorage diff --git a/pkg/nrdb/doc.go b/pkg/nrdb/doc.go index a94fef43c..db913f15e 100644 --- a/pkg/nrdb/doc.go +++ b/pkg/nrdb/doc.go @@ -5,13 +5,12 @@ the New Relic Query Language are available here: https://docs.newrelic.com/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package nrdb diff --git a/pkg/plugins/doc.go b/pkg/plugins/doc.go index 2db13d82c..afb849d7a 100644 --- a/pkg/plugins/doc.go +++ b/pkg/plugins/doc.go @@ -8,13 +8,12 @@ Plugins product. It can be used for a variety of operations, including: - Reading plugin component metric data -Authentication +# Authentication You will need a Personal API key to communicate with the backend New Relic APIs that provide this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package plugins diff --git a/pkg/synthetics/doc.go b/pkg/synthetics/doc.go index 87653baef..450d01c2a 100644 --- a/pkg/synthetics/doc.go +++ b/pkg/synthetics/doc.go @@ -16,14 +16,12 @@ More information can be found here: https://discuss.newrelic.com/t/end-of-life-notice-synthetics-labels-and-synthetics-apm-group-by-tag/103781 - -Authentication +# Authentication You will need a Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this keys: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package synthetics diff --git a/pkg/synthetics/monitor_scripts.go b/pkg/synthetics/monitor_scripts.go index 2b93e3420..85604a758 100644 --- a/pkg/synthetics/monitor_scripts.go +++ b/pkg/synthetics/monitor_scripts.go @@ -37,8 +37,9 @@ func (s *Synthetics) GetMonitorScriptWithContext(ctx context.Context, monitorID } // Deprecated: Use one of following instead: -// synthetics.SyntheticsUpdateScriptAPIMonitor -// synthetics.SyntheticsUpdateScriptBrowserMonitor +// +// synthetics.SyntheticsUpdateScriptAPIMonitor +// synthetics.SyntheticsUpdateScriptBrowserMonitor // // UpdateMonitorScript is used to add a script to an existing New Relic Synthetics monitor_script. func (s *Synthetics) UpdateMonitorScript(monitorID string, script MonitorScript) (*MonitorScript, error) { @@ -46,8 +47,9 @@ func (s *Synthetics) UpdateMonitorScript(monitorID string, script MonitorScript) } // Deprecated: Use one of following instead: -// synthetics.SyntheticsUpdateScriptAPIMonitorWithContext -// synthetics.SyntheticsUpdateScriptBrowserMonitorWithContext +// +// synthetics.SyntheticsUpdateScriptAPIMonitorWithContext +// synthetics.SyntheticsUpdateScriptBrowserMonitorWithContext // // UpdateMonitorScriptWithContext is used to add a script to an existing New Relic Synthetics monitor_script. func (s *Synthetics) UpdateMonitorScriptWithContext(ctx context.Context, monitorID string, script MonitorScript) (*MonitorScript, error) { diff --git a/pkg/synthetics/monitors.go b/pkg/synthetics/monitors.go index a36179539..dcb7781fa 100644 --- a/pkg/synthetics/monitors.go +++ b/pkg/synthetics/monitors.go @@ -128,25 +128,25 @@ func (s *Synthetics) GetMonitorWithContext(ctx context.Context, monitorID string } // CreateMonitor is used to create a New Relic Synthetics monitor. -//Deprecated: Use one of the following methods instead based on your needs - -//syntheticsCreateBrokenLinksMonitor(Broken links monitor), -//syntheticsCreateCertCheckMonitor(Cert Check Monitor), +// Deprecated: Use one of the following methods instead based on your needs - +// syntheticsCreateBrokenLinksMonitor(Broken links monitor), +// syntheticsCreateCertCheckMonitor(Cert Check Monitor), // syntheticsCreateScriptBrowserMonitor(Script Browser Monitor), -//syntheticsCreateSimpleBrowserMonitor(Simple Browser Monitor), -//syntheticsCreateSimpleMonitor(Simple Monitor), -//syntheticsCreateStepMonitor(Step Monitor). +// syntheticsCreateSimpleBrowserMonitor(Simple Browser Monitor), +// syntheticsCreateSimpleMonitor(Simple Monitor), +// syntheticsCreateStepMonitor(Step Monitor). func (s *Synthetics) CreateMonitor(monitor Monitor) (*Monitor, error) { return s.CreateMonitorWithContext(context.Background(), monitor) } // CreateMonitorWithContext is used to create a New Relic Synthetics monitor. -//Deprecated: Use one of the following methods instead based on your needs - -//syntheticsCreateBrokenLinksMonitorWithContext(Broken links monitor), -//syntheticsCreateCertCheckMonitorWithContext(Cert Check Monitor), +// Deprecated: Use one of the following methods instead based on your needs - +// syntheticsCreateBrokenLinksMonitorWithContext(Broken links monitor), +// syntheticsCreateCertCheckMonitorWithContext(Cert Check Monitor), // syntheticsCreateScriptBrowserMonitorWithContext(Script Browser Monitor), -//syntheticsCreateSimpleBrowserMonitorWithContext(Simple Browser Monitor), -//syntheticsCreateSimpleMonitorWithContext(Simple Monitor), -//syntheticsCreateStepMonitorWithContext(Step Monitor). +// syntheticsCreateSimpleBrowserMonitorWithContext(Simple Browser Monitor), +// syntheticsCreateSimpleMonitorWithContext(Simple Monitor), +// syntheticsCreateStepMonitorWithContext(Step Monitor). func (s *Synthetics) CreateMonitorWithContext(ctx context.Context, monitor Monitor) (*Monitor, error) { resp, err := s.client.PostWithContext(ctx, s.config.Region().SyntheticsURL("/v4/monitors"), nil, &monitor, nil) @@ -163,25 +163,25 @@ func (s *Synthetics) CreateMonitorWithContext(ctx context.Context, monitor Monit } // UpdateMonitor is used to update a New Relic Synthetics monitor. -//Deprecated: Use one of the following methods instead based on your needs - -//syntheticsUpdateBrokenLinksMonitor(Broken links monitor), -//syntheticsUpdateCertCheckMonitor(Cert Check Monitor), +// Deprecated: Use one of the following methods instead based on your needs - +// syntheticsUpdateBrokenLinksMonitor(Broken links monitor), +// syntheticsUpdateCertCheckMonitor(Cert Check Monitor), // syntheticsUpdateScriptBrowserMonitor(Script Browser Monitor), -//syntheticsUpdateSimpleBrowserMonitor(Simple Browser Monitor), -//syntheticsUpdateSimpleMonitor(Simple Monitor), -//syntheticsUpdateStepMonitor(Step Monitor). +// syntheticsUpdateSimpleBrowserMonitor(Simple Browser Monitor), +// syntheticsUpdateSimpleMonitor(Simple Monitor), +// syntheticsUpdateStepMonitor(Step Monitor). func (s *Synthetics) UpdateMonitor(monitor Monitor) (*Monitor, error) { return s.UpdateMonitorWithContext(context.Background(), monitor) } // UpdateMonitorWithContext is used to update a New Relic Synthetics monitor. -//Deprecated: Use one of the following methods instead based on your needs - -//syntheticsUpdateBrokenLinksMonitorWithContext(Broken links monitor), -//syntheticsUpdateCertCheckMonitorWithContext(Cert Check Monitor), +// Deprecated: Use one of the following methods instead based on your needs - +// syntheticsUpdateBrokenLinksMonitorWithContext(Broken links monitor), +// syntheticsUpdateCertCheckMonitorWithContext(Cert Check Monitor), // syntheticsUpdateScriptBrowserMonitorWithContext(Script Browser Monitor), -//syntheticsUpdateSimpleBrowserMonitorWithContext(Simple Browser Monitor), -//syntheticsUpdateSimpleMonitorWithContext(Simple Monitor), -//syntheticsUpdateStepMonitorWithContext(Step Monitor). +// syntheticsUpdateSimpleBrowserMonitorWithContext(Simple Browser Monitor), +// syntheticsUpdateSimpleMonitorWithContext(Simple Monitor), +// syntheticsUpdateStepMonitorWithContext(Step Monitor). func (s *Synthetics) UpdateMonitorWithContext(ctx context.Context, monitor Monitor) (*Monitor, error) { _, err := s.client.PutWithContext(ctx, s.config.Region().SyntheticsURL("/v4/monitors", monitor.ID), nil, &monitor, nil) @@ -194,14 +194,14 @@ func (s *Synthetics) UpdateMonitorWithContext(ctx context.Context, monitor Monit // DeleteMonitor is used to delete a New Relic Synthetics monitor. // Deprecated: Use the following method to delete all New Relic Synthetics Monitors. -//SyntheticsDeleteMonitor +// SyntheticsDeleteMonitor func (s *Synthetics) DeleteMonitor(monitorID string) error { return s.DeleteMonitorWithContext(context.Background(), monitorID) } // DeleteMonitorWithContext is used to delete a New Relic Synthetics monitor. // Deprecated: Use the following method to delete all New Relic Synthetics Monitors. -//SyntheticsDeleteMonitorWithContext +// SyntheticsDeleteMonitorWithContext func (s *Synthetics) DeleteMonitorWithContext(ctx context.Context, monitorID string) error { _, err := s.client.DeleteWithContext(ctx, s.config.Region().SyntheticsURL("/v4/monitors", monitorID), nil, nil) diff --git a/pkg/users/doc.go b/pkg/users/doc.go index 0b92d182d..d44621bf4 100644 --- a/pkg/users/doc.go +++ b/pkg/users/doc.go @@ -2,13 +2,12 @@ Package users provides a programmatic API for interacting with New Relic users. It can be used to retrieve details about the user. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package users diff --git a/pkg/workflows/workflows_unit_test.go b/pkg/workflows/workflows_unit_test.go index 98e248997..d20c32fba 100644 --- a/pkg/workflows/workflows_unit_test.go +++ b/pkg/workflows/workflows_unit_test.go @@ -193,9 +193,9 @@ func TestCreateWorkflow(t *testing.T) { } expectedDestinationConfiguration := []AiWorkflowsDestinationConfiguration{{ - ChannelId: channelId, - Name: "EMPTY", - Type: "EMAIL", + ChannelId: channelId, + Name: "EMPTY", + Type: "EMAIL", NotificationTriggers: []AiWorkflowsNotificationTrigger{"ACTIVATED"}, }} expectedIssuedFilter := AiWorkflowsFilter{ @@ -257,9 +257,9 @@ func TestGetWorkflow(t *testing.T) { workflows := newMockResponse(t, respJSON, http.StatusOK) expectedDestinationConfiguration := []AiWorkflowsDestinationConfiguration{{ - ChannelId: channelId, - Name: "EMPTY", - Type: "EMAIL", + ChannelId: channelId, + Name: "EMPTY", + Type: "EMAIL", NotificationTriggers: []AiWorkflowsNotificationTrigger{"ACTIVATED"}, }} expectedEnrichments := []AiWorkflowsEnrichment{{ diff --git a/pkg/workloads/doc.go b/pkg/workloads/doc.go index b07b9a9a2..aef894489 100644 --- a/pkg/workloads/doc.go +++ b/pkg/workloads/doc.go @@ -2,13 +2,12 @@ Package workloads provides a programmatic API for interacting with New Relic One workloads. It can be used to create, read, update, and delete workloads. -Authentication +# Authentication You will need a valid Personal API key to communicate with the backend New Relic API that provides this functionality. See the API key documentation below for more information on how to locate this key: https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys - */ package workloads