Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keytransaction): add keytransaction package to support managing key transactions #1213

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .tutone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,33 @@ packages:
- name: DateTime
field_type_override: nrtime.DateTime
skip_type_create: true
- name: keytransaction
path: pkg/keytransaction
import_path: github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction
generators:
- typegen
- nerdgraphclient
mutations:
- name: keyTransactionCreate
max_query_field_depth: 4
- name: keyTransactionDelete
max_query_field_depth: 1
- name: keyTransactionUpdate
max_query_field_depth: 4
types:
- name: ID
field_type_override: string
skip_type_create: true
- name: DateTime
field_type_override: nrtime.DateTime
skip_type_create: true
- name: Seconds
field_type_override: nrtime.Seconds
skip_type_create: true
- name: EpochMilliseconds
field_type_override: "*nrtime.EpochMilliseconds"
skip_type_create: true


generators:
- name: typegen
Expand Down
3 changes: 3 additions & 0 deletions newrelic/newrelic.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/newrelic/newrelic-client-go/v2/pkg/events"
"github.com/newrelic/newrelic-client-go/v2/pkg/eventstometrics"
"github.com/newrelic/newrelic-client-go/v2/pkg/installevents"
"github.com/newrelic/newrelic-client-go/v2/pkg/keytransaction"
"github.com/newrelic/newrelic-client-go/v2/pkg/logconfigurations"
"github.com/newrelic/newrelic-client-go/v2/pkg/logging"
"github.com/newrelic/newrelic-client-go/v2/pkg/logs"
Expand Down Expand Up @@ -70,6 +71,7 @@ type NewRelic struct {
UserManagement usermanagement.Usermanagement
Workflows workflows.Workflows
Workloads workloads.Workloads
KeyTransaction keytransaction.Keytransaction

config config.Config
}
Expand Down Expand Up @@ -116,6 +118,7 @@ func New(opts ...ConfigOption) (*NewRelic, error) {
UserManagement: usermanagement.New(cfg),
Workflows: workflows.New(cfg),
Workloads: workloads.New(cfg),
KeyTransaction: keytransaction.New(cfg),
}

return nr, nil
Expand Down
23 changes: 23 additions & 0 deletions pkg/keytransaction/keytransaction.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package keytransaction

import (
"github.com/newrelic/newrelic-client-go/v2/internal/http"
"github.com/newrelic/newrelic-client-go/v2/pkg/config"
"github.com/newrelic/newrelic-client-go/v2/pkg/logging"
)

type Keytransaction struct {
client http.Client
logger logging.Logger
config config.Config
}

func New(config config.Config) Keytransaction {
client := http.NewClient(config)
pkg := Keytransaction{
client: client,
logger: config.GetLogger(),
config: config,
}
return pkg
}
Loading
Loading