From 3e39909bd396be23353de0f600e602e8f781d42e Mon Sep 17 00:00:00 2001 From: codeboten Date: Tue, 5 Jul 2022 12:29:02 -0700 Subject: [PATCH] update calls in deprecated func --- component/exporter.go | 12 +++--------- component/processor.go | 12 +++--------- component/receiver.go | 12 +++--------- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/component/exporter.go b/component/exporter.go index 32488115cc9..fc89e71c5af 100644 --- a/component/exporter.go +++ b/component/exporter.go @@ -151,9 +151,7 @@ type exporterFactory struct { // WithTracesExporter overrides the default "error not supported" implementation for CreateTracesExporter. // Deprecated: [v0.55.0] Use WithTracesExporterAndStabilityLevel instead. func WithTracesExporter(createTracesExporter CreateTracesExporterFunc) ExporterFactoryOption { - return exporterFactoryOptionFunc(func(o *exporterFactory) { - o.CreateTracesExporterFunc = createTracesExporter - }) + return WithTracesExporterAndStabilityLevel(createTracesExporter, StabilityLevelUndefined) } // WithTracesExporterAndStabilityLevel overrides the default "error not supported" implementation for CreateTracesExporter and the default "undefined" stability level. @@ -167,9 +165,7 @@ func WithTracesExporterAndStabilityLevel(createTracesExporter CreateTracesExport // WithMetricsExporter overrides the default "error not supported" implementation for CreateMetricsExporter. // Deprecated: [v0.55.0] Use WithMetricsExporterAndStabilityLevel instead. func WithMetricsExporter(createMetricsExporter CreateMetricsExporterFunc) ExporterFactoryOption { - return exporterFactoryOptionFunc(func(o *exporterFactory) { - o.CreateMetricsExporterFunc = createMetricsExporter - }) + return WithMetricsExporterAndStabilityLevel(createMetricsExporter, StabilityLevelUndefined) } // WithMetricsExporterAndStabilityLevel overrides the default "error not supported" implementation for CreateMetricsExporter and the default "undefined" stability level. @@ -183,9 +179,7 @@ func WithMetricsExporterAndStabilityLevel(createMetricsExporter CreateMetricsExp // WithLogsExporter overrides the default "error not supported" implementation for CreateLogsExporter. // Deprecated: [v0.55.0] Use WithLogsExporterAndStabilityLevel instead. func WithLogsExporter(createLogsExporter CreateLogsExporterFunc) ExporterFactoryOption { - return exporterFactoryOptionFunc(func(o *exporterFactory) { - o.CreateLogsExporterFunc = createLogsExporter - }) + return WithLogsExporterAndStabilityLevel(createLogsExporter, StabilityLevelUndefined) } // WithLogsExporterAndStabilityLevel overrides the default "error not supported" implementation for CreateLogsExporter and the default "undefined" stability level. diff --git a/component/processor.go b/component/processor.go index 1136ed944fc..7ed227d551b 100644 --- a/component/processor.go +++ b/component/processor.go @@ -181,9 +181,7 @@ type processorFactory struct { // WithTracesProcessor overrides the default "error not supported" implementation for CreateTracesProcessor. // Deprecated: [v0.55.0] Use WithTracesProcessorAndStabilityLevel instead. func WithTracesProcessor(createTracesProcessor CreateTracesProcessorFunc) ProcessorFactoryOption { - return processorFactoryOptionFunc(func(o *processorFactory) { - o.CreateTracesProcessorFunc = createTracesProcessor - }) + return WithTracesProcessorAndStabilityLevel(createTracesProcessor, StabilityLevelUndefined) } // WithTracesProcessorAndStabilityLevel overrides the default "error not supported" implementation for CreateTracesProcessor and the default "undefined" stability level. @@ -197,9 +195,7 @@ func WithTracesProcessorAndStabilityLevel(createTracesProcessor CreateTracesProc // WithMetricsProcessor overrides the default "error not supported" implementation for CreateMetricsProcessor. // Deprecated: [v0.55.0] Use WithMetricsProcessorAndStabilityLevel instead. func WithMetricsProcessor(createMetricsProcessor CreateMetricsProcessorFunc) ProcessorFactoryOption { - return processorFactoryOptionFunc(func(o *processorFactory) { - o.CreateMetricsProcessorFunc = createMetricsProcessor - }) + return WithMetricsProcessorAndStabilityLevel(createMetricsProcessor, StabilityLevelUndefined) } // WithMetricsProcessorAndStabilityLevel overrides the default "error not supported" implementation for CreateMetricsProcessor and the default "undefined" stability level. @@ -213,9 +209,7 @@ func WithMetricsProcessorAndStabilityLevel(createMetricsProcessor CreateMetricsP // WithLogsProcessor overrides the default "error not supported" implementation for CreateLogsProcessor. // Deprecated: [v0.55.0] Use WithLogsProcessorAndStabilityLevel instead. func WithLogsProcessor(createLogsProcessor CreateLogsProcessorFunc) ProcessorFactoryOption { - return processorFactoryOptionFunc(func(o *processorFactory) { - o.CreateLogsProcessorFunc = createLogsProcessor - }) + return WithLogsProcessorAndStabilityLevel(createLogsProcessor, StabilityLevelUndefined) } // WithLogsProcessorAndStabilityLevel overrides the default "error not supported" implementation for CreateLogsProcessor and the default "undefined" stability level. diff --git a/component/receiver.go b/component/receiver.go index de936a156e8..8fee91bc702 100644 --- a/component/receiver.go +++ b/component/receiver.go @@ -213,9 +213,7 @@ type receiverFactory struct { // WithTracesReceiver overrides the default "error not supported" implementation for CreateTracesReceiver. // Deprecated: [v0.55.0] Use WithTracesReceiverAndStabilityLevel instead. func WithTracesReceiver(createTracesReceiver CreateTracesReceiverFunc) ReceiverFactoryOption { - return receiverFactoryOptionFunc(func(o *receiverFactory) { - o.CreateTracesReceiverFunc = createTracesReceiver - }) + return WithTracesReceiverAndStabilityLevel(createTracesReceiver, StabilityLevelUndefined) } // WithTracesReceiverAndStabilityLevel overrides the default "error not supported" implementation for CreateTracesReceiver and the default "undefined" stability level. @@ -229,9 +227,7 @@ func WithTracesReceiverAndStabilityLevel(createTracesReceiver CreateTracesReceiv // WithMetricsReceiver overrides the default "error not supported" implementation for CreateMetricsReceiver. // Deprecated: [v0.55.0] Use WithMetricsReceiverAndStabilityLevel instead. func WithMetricsReceiver(createMetricsReceiver CreateMetricsReceiverFunc) ReceiverFactoryOption { - return receiverFactoryOptionFunc(func(o *receiverFactory) { - o.CreateMetricsReceiverFunc = createMetricsReceiver - }) + return WithMetricsReceiverAndStabilityLevel(createMetricsReceiver, StabilityLevelUndefined) } // WithMetricsReceiverAndStabilityLevel overrides the default "error not supported" implementation for CreateMetricsReceiver and the default "undefined" stability level. @@ -245,9 +241,7 @@ func WithMetricsReceiverAndStabilityLevel(createMetricsReceiver CreateMetricsRec // WithLogsReceiver overrides the default "error not supported" implementation for CreateLogsReceiver. // Deprecated: [v0.55.0] Use WithLogsReceiverAndStabilityLevel instead. func WithLogsReceiver(createLogsReceiver CreateLogsReceiverFunc) ReceiverFactoryOption { - return receiverFactoryOptionFunc(func(o *receiverFactory) { - o.CreateLogsReceiverFunc = createLogsReceiver - }) + return WithLogsReceiverAndStabilityLevel(createLogsReceiver, StabilityLevelUndefined) } // WithLogsReceiverAndStabilityLevel overrides the default "error not supported" implementation for CreateLogsReceiver and the default "undefined" stability level.