From dc85a1dadd628da358ddc6e2700d6d543d8f7706 Mon Sep 17 00:00:00 2001 From: Tom de Bruijn Date: Tue, 15 Aug 2023 19:41:24 +0200 Subject: [PATCH] Fix visibility of things in AppSignal sink It doesn't need to be visible for the entire crate, only the AppSignal sink scope. --- src/sinks/appsignal/config.rs | 12 ++++++------ src/sinks/appsignal/encoder.rs | 2 +- src/sinks/appsignal/request_builder.rs | 14 +++++++------- src/sinks/appsignal/service.rs | 12 ++++++------ src/sinks/appsignal/sink.rs | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/sinks/appsignal/config.rs b/src/sinks/appsignal/config.rs index 16ba89c8b6668..7d85422fbccc2 100644 --- a/src/sinks/appsignal/config.rs +++ b/src/sinks/appsignal/config.rs @@ -30,12 +30,12 @@ use super::{ /// Configuration for the `appsignal` sink. #[configurable_component(sink("appsignal", "Deliver log and metric event data to AppSignal."))] #[derive(Clone, Debug, Default)] -pub struct AppsignalConfig { +pub(super) struct AppsignalConfig { /// The URI for the AppSignal API to send data to. #[configurable(validation(format = "uri"))] #[configurable(metadata(docs::examples = "https://appsignal-endpoint.net"))] #[serde(default = "default_endpoint")] - pub endpoint: String, + pub(super) endpoint: String, /// A valid app-level AppSignal Push API key. #[configurable(metadata(docs::examples = "00000000-0000-0000-0000-000000000000"))] @@ -73,12 +73,12 @@ pub struct AppsignalConfig { acknowledgements: AcknowledgementsConfig, } -pub(crate) fn default_endpoint() -> String { +pub(super) fn default_endpoint() -> String { "https://appsignal-endpoint.net".to_string() } #[derive(Clone, Copy, Debug, Default)] -pub(crate) struct AppsignalDefaultBatchSettings; +pub(super) struct AppsignalDefaultBatchSettings; impl SinkBatchSettings for AppsignalDefaultBatchSettings { const MAX_EVENTS: Option = Some(100); @@ -87,13 +87,13 @@ impl SinkBatchSettings for AppsignalDefaultBatchSettings { } impl AppsignalConfig { - pub(crate) fn build_client(&self, proxy: &ProxyConfig) -> crate::Result { + pub(super) fn build_client(&self, proxy: &ProxyConfig) -> crate::Result { let tls = MaybeTlsSettings::from_config(&self.tls, false)?; let client = HttpClient::new(tls, proxy)?; Ok(client) } - pub(crate) fn build_sink(&self, http_client: HttpClient) -> crate::Result { + pub(super) fn build_sink(&self, http_client: HttpClient) -> crate::Result { let batch_settings = self.batch.into_batcher_settings()?; let endpoint = endpoint_uri(&self.endpoint, "vector/events")?; diff --git a/src/sinks/appsignal/encoder.rs b/src/sinks/appsignal/encoder.rs index dc782ae0171c6..f56edd04c2f68 100644 --- a/src/sinks/appsignal/encoder.rs +++ b/src/sinks/appsignal/encoder.rs @@ -8,7 +8,7 @@ use crate::{ }; #[derive(Clone)] -pub(crate) struct AppsignalEncoder { +pub(super) struct AppsignalEncoder { pub transformer: Transformer, } diff --git a/src/sinks/appsignal/request_builder.rs b/src/sinks/appsignal/request_builder.rs index 8e8cb334143b5..96c0cece7e6f4 100644 --- a/src/sinks/appsignal/request_builder.rs +++ b/src/sinks/appsignal/request_builder.rs @@ -14,10 +14,10 @@ use crate::sinks::util::{ use super::encoder::AppsignalEncoder; #[derive(Clone)] -pub(crate) struct AppsignalRequest { - pub(crate) payload: Bytes, - pub(crate) finalizers: EventFinalizers, - pub(crate) metadata: RequestMetadata, +pub(super) struct AppsignalRequest { + pub(super) payload: Bytes, + pub(super) finalizers: EventFinalizers, + pub(super) metadata: RequestMetadata, } impl MetaDescriptive for AppsignalRequest { @@ -42,9 +42,9 @@ impl ByteSizeOf for AppsignalRequest { } } -pub(crate) struct AppsignalRequestBuilder { - pub(crate) encoder: AppsignalEncoder, - pub(crate) compression: Compression, +pub(super) struct AppsignalRequestBuilder { + pub(super) encoder: AppsignalEncoder, + pub(super) compression: Compression, } impl RequestBuilder> for AppsignalRequestBuilder { diff --git a/src/sinks/appsignal/service.rs b/src/sinks/appsignal/service.rs index 48ff2f3ab49bf..c2fb558d6ac9d 100644 --- a/src/sinks/appsignal/service.rs +++ b/src/sinks/appsignal/service.rs @@ -23,8 +23,8 @@ use crate::{ use super::request_builder::AppsignalRequest; #[derive(Clone)] -pub(crate) struct AppsignalService { - pub(crate) batch_service: +pub(super) struct AppsignalService { + pub(super) batch_service: HttpBatchService, crate::Error>>, AppsignalRequest>, } @@ -91,10 +91,10 @@ impl Service for AppsignalService { } pub struct AppsignalResponse { - pub(crate) event_status: EventStatus, - pub(crate) http_status: StatusCode, - pub(crate) event_byte_size: GroupedCountByteSize, - pub(crate) bytes_sent: usize, + pub(super) event_status: EventStatus, + pub(super) http_status: StatusCode, + pub(super) event_byte_size: GroupedCountByteSize, + pub(super) bytes_sent: usize, } impl DriverResponse for AppsignalResponse { diff --git a/src/sinks/appsignal/sink.rs b/src/sinks/appsignal/sink.rs index 1d004f051f123..ab9b135829abb 100644 --- a/src/sinks/appsignal/sink.rs +++ b/src/sinks/appsignal/sink.rs @@ -16,11 +16,11 @@ use super::{ request_builder::{AppsignalRequest, AppsignalRequestBuilder}, }; -pub(crate) struct AppsignalSink { - pub(crate) service: S, - pub(crate) compression: Compression, - pub(crate) transformer: Transformer, - pub(crate) batch_settings: BatcherSettings, +pub(super) struct AppsignalSink { + pub(super) service: S, + pub(super) compression: Compression, + pub(super) transformer: Transformer, + pub(super) batch_settings: BatcherSettings, } impl AppsignalSink @@ -30,7 +30,7 @@ where S::Response: DriverResponse + Send + 'static, S::Error: std::fmt::Debug + Into + Send, { - pub(crate) async fn run_inner(self: Box, input: BoxStream<'_, Event>) -> Result<(), ()> { + pub(super) async fn run_inner(self: Box, input: BoxStream<'_, Event>) -> Result<(), ()> { let service = ServiceBuilder::new().service(self.service); input