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

Update function descriptions #3025

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
4 changes: 1 addition & 3 deletions component/componenttest/nop_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import (
// nopExporterFactory is factory for nopExporter.
type nopExporterFactory struct{}

var nopExporterFactoryInstance = &nopExporterFactory{}

// NewNopExporterFactory returns a component.ExporterFactory that constructs nop exporters.
func NewNopExporterFactory() component.ExporterFactory {
return nopExporterFactoryInstance
return &nopExporterFactory{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why all the changes related to these being singletons?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had referenced a similar change in the consumererror package, but I realize that the usage there is different. So I will revert to the previous implementation.

}

// Type gets the type of the Exporter config created by this factory.
Expand Down
6 changes: 2 additions & 4 deletions component/componenttest/nop_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ import (
// nopExtensionFactory is factory for nopExtension.
type nopExtensionFactory struct{}

var nopExtensionFactoryInstance = &nopExtensionFactory{}

// NewNopExtensionFactory returns a component.ExtensionFactory that constructs nop exporters.
// NewNopExtensionFactory returns a component.ExtensionFactory that constructs nop extensions.
func NewNopExtensionFactory() component.ExtensionFactory {
return nopExtensionFactoryInstance
return &nopExtensionFactory{}
}

// Type gets the type of the Extension config created by this factory.
Expand Down
6 changes: 2 additions & 4 deletions component/componenttest/nop_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ type nopProcessorFactory struct {
component.BaseProcessorFactory
}

var nopProcessorFactoryInstance = &nopProcessorFactory{}

// NewNopProcessorFactory returns a component.ProcessorFactory that constructs nop exporters.
// NewNopProcessorFactory returns a component.ProcessorFactory that constructs nop processors.
func NewNopProcessorFactory() component.ProcessorFactory {
return nopProcessorFactoryInstance
return &nopProcessorFactory{}
}

// Type gets the type of the Processor config created by this factory.
Expand Down
6 changes: 2 additions & 4 deletions component/componenttest/nop_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ import (
// nopReceiverFactory is factory for nopReceiver.
type nopReceiverFactory struct{}

var nopReceiverFactoryInstance = &nopReceiverFactory{}

// NewNopReceiverFactory returns a component.ReceiverFactory that constructs nop exporters.
// NewNopReceiverFactory returns a component.ReceiverFactory that constructs nop receivers.
func NewNopReceiverFactory() component.ReceiverFactory {
return nopReceiverFactoryInstance
return &nopReceiverFactory{}
}

// Type gets the type of the Receiver config created by this factory.
Expand Down
2 changes: 1 addition & 1 deletion component/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type ExporterCreateParams struct {
ApplicationStartInfo ApplicationStartInfo
}

// ExporterFactory can create TracesExporter and MetricsExporter. This is the
// ExporterFactory can create TracesExporter, MetricsExporter, and LogsExporter. This is the
// new factory type that can create new style exporters.
type ExporterFactory interface {
Factory
Expand Down
2 changes: 1 addition & 1 deletion component/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (f *TestExporterFactory) CreateMetricsExporter(context.Context, ExporterCre
return nil, componenterror.ErrDataTypeIsNotSupported
}

// CreateMetricsExporter creates a logs exporter based on this config.
// CreateLogsExporter creates a logs exporter based on this config.
func (f *TestExporterFactory) CreateLogsExporter(context.Context, ExporterCreateParams, config.Exporter) (LogsExporter, error) {
return nil, componenterror.ErrDataTypeIsNotSupported
}
Expand Down
2 changes: 1 addition & 1 deletion component/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type ReceiverCreateParams struct {
ApplicationStartInfo ApplicationStartInfo
}

// ReceiverFactory can create TracesReceiver and MetricsReceiver. This is the
// ReceiverFactory can create TracesReceiver, MetricsReceiver, and LogsReceiver. This is the
// new factory type that can create new style receivers.
type ReceiverFactory interface {
Factory
Expand Down