client

package
v0.0.0-...-5add76e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Code generated by codegen; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var AccountNameColumn = schema.Column{
	Name:       "account_name",
	Type:       arrow.BinaryTypes.String,
	Resolver:   ResolveAccountName,
	PrimaryKey: true,
	NotNull:    true,
}
View Source
var JSONSchema string

Functions

func AccountMultiplex

func AccountMultiplex(meta schema.ClientMeta) []schema.ClientMeta

func Configure

func Configure(ctx context.Context, logger zerolog.Logger, spec *Spec) (schema.ClientMeta, error)

func ConsumePaginatedResponse

func ConsumePaginatedResponse[T any](response <-chan datadog.PaginationResult[T], cancel context.CancelFunc, res chan<- any) error

func DatadogMockTestHelper

func DatadogMockTestHelper(t *testing.T, table *schema.Table, builder func(*testing.T, *gomock.Controller) DatadogServices, _ TestOptions)

func MockPaginatedResponse

func MockPaginatedResponse[T any](result T) (<-chan datadog.PaginationResult[T], func())

func ResolveAccountName

func ResolveAccountName(_ context.Context, meta schema.ClientMeta, r *schema.Resource, col schema.Column) error

func TransformWithStruct

func TransformWithStruct(t any, opts ...transformers.StructTransformerOption) schema.Transform

Types

type Account

type Account struct {
	// Account name.
	Name string `json:"name" jsonschema:"required,minLength=1"`
	// Datadog API key.
	APIKey string `json:"api_key" jsonschema:"required,minLength=1"`
	// Datadog App key.
	AppKey string `json:"app_key" jsonschema:"required,minLength=1"`
}

Account used to specify one or more accounts to extract information from.

type Client

type Client struct {

	// The site to use for the API calls - see https://docs.datadoghq.com/getting_started/site/
	Site string

	Accounts []Account

	DDServices DatadogServices
	// contains filtered or unexported fields
}

func (*Client) BuildContextV1

func (c *Client) BuildContextV1(ctx context.Context) context.Context

func (*Client) BuildContextV2

func (c *Client) BuildContextV2(ctx context.Context) context.Context

func (*Client) Duplicate

func (c *Client) Duplicate() schema.ClientMeta

func (*Client) ID

func (c *Client) ID() string

func (*Client) Logger

func (c *Client) Logger() *zerolog.Logger

type DatadogServices

type DatadogServices struct {
	DashboardListsAPI                   services.DashboardListsAPIClient
	DashboardsAPI                       services.DashboardsAPIClient
	DowntimesAPI                        services.DowntimesAPIClient
	HostsAPI                            services.HostsAPIClient
	IncidentsAPI                        services.IncidentsAPIClient
	MonitorsAPI                         services.MonitorsAPIClient
	NotebooksAPI                        services.NotebooksAPIClient
	RolesAPI                            services.RolesAPIClient
	ServiceLevelObjectivesAPI           services.ServiceLevelObjectivesAPIClient
	ServiceLevelObjectiveCorrectionsAPI services.ServiceLevelObjectiveCorrectionsAPIClient
	SyntheticsAPI                       services.SyntheticsAPIClient
	UsersAPI                            services.UsersAPIClient
	RumAPI                              services.RumAPIClient
}

func NewDatadogServices

func NewDatadogServices(apiClient *datadog.APIClient) DatadogServices

type Spec

type Spec struct {
	// Specify which accounts to sync data from.
	Accounts []Account `json:"accounts" jsonschema:"required,minItems=1"`
	// A best effort maximum number of Go routines to use. Lower this number to reduce memory usage.
	Concurrency int `json:"concurrency"`
	// The Datadog site to connect to. This is usually one of datadoghq.com or datadoghq.eu - see site documentation for more information.
	Site string `json:"site"`
}

Spec the (nested) spec used by the Datadog source plugin.

func (*Spec) SetDefaults

func (s *Spec) SetDefaults()

func (*Spec) Validate

func (s *Spec) Validate() error

type TestOptions

type TestOptions struct{}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Code generated by codegen; DO NOT EDIT.
Code generated by codegen; DO NOT EDIT.
spec
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL