Improve component package docs (#3305)

* added doc.go file for component package

* added description for package componenthelper

* fixed comment for Shutdown

* added default build info for readability in go docs

* added doc.go for componenterror

* added doc.go for componenthelper

* added newline

* fixed grammar in descriptions

* added newline in componenthelper/doc.go

* added an

* fixed format error

* updated component package comments

* addressing lint error
This commit is contained in:
Bryan Uribe 2021-06-07 02:34:16 -07:00 committed by GitHub
parent db28270a1f
commit 6cbf7e3134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 5 deletions

View File

@ -20,7 +20,7 @@ import (
"go.opentelemetry.io/collector/config"
)
// Component is either a receiver, exporter, processor or an extension.
// Component is either a receiver, exporter, processor, or an extension.
//
// A component's lifecycle has the following phases:
//

View File

@ -0,0 +1,17 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package componenterror provides helper functions to create and process
// OpenTelemetry component errors.
package componenterror

View File

@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package componenterror provides helper functions to create and process
// OpenTelemetry specific errors
package componenterror
import (

View File

@ -23,7 +23,7 @@ import (
// StartFunc specifies the function invoked when the component.Component is being started.
type StartFunc func(context.Context, component.Host) error
// Start calls f(ctx, host).
// Start starts the component.
func (f StartFunc) Start(ctx context.Context, host component.Host) error {
return f(ctx, host)
}
@ -31,7 +31,7 @@ func (f StartFunc) Start(ctx context.Context, host component.Host) error {
// ShutdownFunc specifies the function invoked when the component.Component is being shutdown.
type ShutdownFunc func(context.Context) error
// Shutdown calls f(ctx, host).
// Shutdown shuts down the component.
func (f ShutdownFunc) Shutdown(ctx context.Context) error {
return f(ctx)
}

View File

@ -0,0 +1,16 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package componenthelper assists with the creation of a new component.Component.
package componenthelper

19
component/doc.go Normal file
View File

@ -0,0 +1,19 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package component outlines the components used in the collector
// and provides a foundation for the components creation and
// termination process. A component can be either a receiver, exporter,
// processor, or an extension.
package component