From ffc56e0399d5966545f741384c3a2709a85c4e4b Mon Sep 17 00:00:00 2001 From: Eddy Lin Date: Mon, 24 May 2021 13:50:15 -0400 Subject: [PATCH] Added doc.go files to the consumer package and subpackages (#3270) * Added consumertest doc.go * Added consumerhelper doc.go * Fixed typo in consumerhelper doc.go * Moved consumererror doc to doc.go * Added consumer doc.go * Added newline to end of doc.go * Added simple doc.go * Fixed typo in pdata doc.go * Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ consumer/consumer.go | 1 - consumer/consumererror/doc.go | 18 ++++++++++++++++++ consumer/consumererror/permanent.go | 3 --- consumer/consumerhelper/doc.go | 17 +++++++++++++++++ consumer/consumertest/doc.go | 17 +++++++++++++++++ consumer/doc.go | 16 ++++++++++++++++ consumer/pdata/doc.go | 2 +- consumer/simple/doc.go | 17 +++++++++++++++++ 9 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 consumer/consumererror/doc.go create mode 100644 consumer/consumerhelper/doc.go create mode 100644 consumer/consumertest/doc.go create mode 100644 consumer/doc.go create mode 100644 consumer/simple/doc.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba07213dda..4f5712d2200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ - Remove unused logstest package (#3222) - Introduce `AppSettings` instead of `Parameters` (#3163) +## 💡 Enhancements 💡 + +- Add `doc.go` files to the consumer package and its subpackages (#3270) + ## v0.27.0 Beta ## 🛑 Breaking changes 🛑 diff --git a/consumer/consumer.go b/consumer/consumer.go index 98212a7826a..bf907473fc0 100644 --- a/consumer/consumer.go +++ b/consumer/consumer.go @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package consumer contains interfaces that receive and process consumerdata. package consumer import ( diff --git a/consumer/consumererror/doc.go b/consumer/consumererror/doc.go new file mode 100644 index 00000000000..c0ec2958402 --- /dev/null +++ b/consumer/consumererror/doc.go @@ -0,0 +1,18 @@ +// 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 consumererror provides wrappers to easily classify errors. This allows +// appropriate action by error handlers without the need to know each individual +// error type/instance. +package consumererror diff --git a/consumer/consumererror/permanent.go b/consumer/consumererror/permanent.go index d02e72a4269..4b2fe49de8d 100644 --- a/consumer/consumererror/permanent.go +++ b/consumer/consumererror/permanent.go @@ -12,9 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package consumererror provides wrappers to easily classify errors. This allows -// appropriate action by error handlers without the need to know each individual -// error type/instance. package consumererror import "errors" diff --git a/consumer/consumerhelper/doc.go b/consumer/consumerhelper/doc.go new file mode 100644 index 00000000000..7dd8fa6fb8f --- /dev/null +++ b/consumer/consumerhelper/doc.go @@ -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 consumerhelper defines types and functions used to create consumer +// Logs, Metrics, and Traces. +package consumerhelper diff --git a/consumer/consumertest/doc.go b/consumer/consumertest/doc.go new file mode 100644 index 00000000000..78a0f4aaf4f --- /dev/null +++ b/consumer/consumertest/doc.go @@ -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 consumertest defines types and functions used to help test packages +// implementing the consumer package interfaces. +package consumertest diff --git a/consumer/doc.go b/consumer/doc.go new file mode 100644 index 00000000000..4dea0ed3b99 --- /dev/null +++ b/consumer/doc.go @@ -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 consumer contains interfaces that receive and process consumerdata. +package consumer diff --git a/consumer/pdata/doc.go b/consumer/pdata/doc.go index 4b4ca0b041b..be88c2a78ea 100644 --- a/consumer/pdata/doc.go +++ b/consumer/pdata/doc.go @@ -22,7 +22,7 @@ // protocol. Note that the underlying data structure is kept private so that in the // future we are free to make changes to it to make more optimal. // -// Most of internal data structures must be created via New* functions. Zero-initialized +// Most of the internal data structures must be created via New* functions. Zero-initialized // structures in most cases are not valid (read comments for each struct to know if it // is the case). This is a slight deviation from idiomatic Go to avoid unnecessary // pointer checks in dozens of functions which assume the invariant that "orig" member diff --git a/consumer/simple/doc.go b/consumer/simple/doc.go new file mode 100644 index 00000000000..2c7e9034372 --- /dev/null +++ b/consumer/simple/doc.go @@ -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 simple facilitates building pdata.Metrics in receivers in an +// easier and more fluent way than using pdata.Metrics directly. +package simple