testutils

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// TestMetrics metrics for tests.
	TestMetrics = newMetricsWithAttributeMap(testAttributes)
	// TestTraces traces for tests.
	TestTraces = newTracesWithAttributeMap(testAttributes)
)

Functions

func NewAttributeMap

func NewAttributeMap(mp map[string]string) pcommon.Map

NewAttributeMap creates a new attribute map (string only) from a Go map

func ValidateAPIKeyEndpointInvalid added in v0.51.0

func ValidateAPIKeyEndpointInvalid() (string, http.HandlerFunc)

ValidateAPIKeyEndpointInvalid returns a handler function that returns an invalid API key response

Types

type DatadogServer

type DatadogServer struct {
	*httptest.Server
	MetadataChan chan []byte
}

func DatadogServerMock

func DatadogServerMock(overwriteHandlerFuncs ...OverwriteHandleFunc) *DatadogServer

DatadogServerMock mocks a Datadog backend server

type HTTPRequestRecorder added in v0.57.2

type HTTPRequestRecorder struct {
	Pattern  string
	Header   http.Header
	ByteBody []byte
}

HTTPRequestRecorder records a HTTP request.

func (*HTTPRequestRecorder) HandlerFunc added in v0.57.2

func (rec *HTTPRequestRecorder) HandlerFunc() (string, http.HandlerFunc)

type MockSourceProvider added in v0.57.2

type MockSourceProvider struct {
	Src source.Source
}

func (*MockSourceProvider) Source added in v0.57.2

type OverwriteHandleFunc added in v0.51.0

type OverwriteHandleFunc func() (string, http.HandlerFunc)

OverwriteHandleFuncs allows to overwrite the default handler functions

Jump to

Keyboard shortcuts

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