otlplogstest

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunEndToEndTest

func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlplogs.Exporter, logsCollector LogsCollector)

RunEndToEndTest can be used by otlplogs.Client tests to validate themselves.

func RunExporterShutdownTest

func RunExporterShutdownTest(t *testing.T, factory func() otlplogs.Client)

func SingleReadableLogRecord

func SingleReadableLogRecord() []logssdk.ReadableLogRecord

Types

type LogsCollector

type LogsCollector interface {
	Stop() error
	GetResourceLogs() []*logspb.ResourceLogs
}

LogsCollector mocks a collector for the end-to-end testing.

type LogsStorage

type LogsStorage struct {
	// contains filtered or unexported fields
}

LogsStorage stores the Logs. Mock collectors can use it to store logs they have received.

func NewLogsStorage

func NewLogsStorage() LogsStorage

NewLogsStorage creates a new logs storage.

func (*LogsStorage) AddLogs

AddLogs adds logs to the logs storage.

func (*LogsStorage) GetLogRecords

func (s *LogsStorage) GetLogRecords() []*logspb.LogRecord

GetLogRecords returns the stored logs.

func (*LogsStorage) GetResourceLogs

func (s *LogsStorage) GetResourceLogs() []*logspb.ResourceLogs

GetResourceLogs returns the stored resource logs.

Jump to

Keyboard shortcuts

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