Skip to content

Commit

Permalink
apply builder pattern
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Oct 8, 2024
1 parent 12a9aaa commit 8d5c3d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/append/opentelemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl OpentelemetryLogBuilder {
/// Default to [`Grpc`].
///
/// [`Grpc`]: OpentelemetryWireProtocol::Grpc
pub fn with_protocol(mut self, protocol: OpentelemetryWireProtocol) -> Self {
pub fn protocol(mut self, protocol: OpentelemetryWireProtocol) -> Self {
self.protocol = match protocol {
OpentelemetryWireProtocol::Grpc => Protocol::Grpc,
OpentelemetryWireProtocol::HttpBinary => Protocol::HttpBinary,
Expand All @@ -79,8 +79,8 @@ impl OpentelemetryLogBuilder {
self
}

/// Add a label to the resource.
pub fn with_label(
/// Append a label to the resource.
pub fn label(
mut self,
key: impl Into<Cow<'static, str>>,
value: impl Into<Cow<'static, str>>,
Expand All @@ -89,8 +89,8 @@ impl OpentelemetryLogBuilder {
self
}

/// Add multiple labels to the resource.
pub fn with_labels<K, V>(mut self, labels: impl IntoIterator<Item = (K, V)>) -> Self
/// Append multiple labels to the resource.
pub fn labels<K, V>(mut self, labels: impl IntoIterator<Item = (K, V)>) -> Self
where
K: Into<Cow<'static, str>>,
V: Into<Cow<'static, str>>,
Expand Down

0 comments on commit 8d5c3d7

Please sign in to comment.