Skip to content

Commit

Permalink
Fix visibility of things in AppSignal sink
Browse files Browse the repository at this point in the history
It doesn't need to be visible for the entire crate, only the AppSignal
sink scope.
  • Loading branch information
tombruijn committed Aug 15, 2023
1 parent 230f005 commit dc85a1d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
12 changes: 6 additions & 6 deletions src/sinks/appsignal/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down Expand Up @@ -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<usize> = Some(100);
Expand All @@ -87,13 +87,13 @@ impl SinkBatchSettings for AppsignalDefaultBatchSettings {
}

impl AppsignalConfig {
pub(crate) fn build_client(&self, proxy: &ProxyConfig) -> crate::Result<HttpClient> {
pub(super) fn build_client(&self, proxy: &ProxyConfig) -> crate::Result<HttpClient> {
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<VectorSink> {
pub(super) fn build_sink(&self, http_client: HttpClient) -> crate::Result<VectorSink> {
let batch_settings = self.batch.into_batcher_settings()?;

let endpoint = endpoint_uri(&self.endpoint, "vector/events")?;
Expand Down
2 changes: 1 addition & 1 deletion src/sinks/appsignal/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
};

#[derive(Clone)]
pub(crate) struct AppsignalEncoder {
pub(super) struct AppsignalEncoder {
pub transformer: Transformer,
}

Expand Down
14 changes: 7 additions & 7 deletions src/sinks/appsignal/request_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<Vec<Event>> for AppsignalRequestBuilder {
Expand Down
12 changes: 6 additions & 6 deletions src/sinks/appsignal/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Ready<Result<http::Request<Bytes>, crate::Error>>, AppsignalRequest>,
}

Expand Down Expand Up @@ -91,10 +91,10 @@ impl Service<AppsignalRequest> 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 {
Expand Down
12 changes: 6 additions & 6 deletions src/sinks/appsignal/sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ use super::{
request_builder::{AppsignalRequest, AppsignalRequestBuilder},
};

pub(crate) struct AppsignalSink<S> {
pub(crate) service: S,
pub(crate) compression: Compression,
pub(crate) transformer: Transformer,
pub(crate) batch_settings: BatcherSettings,
pub(super) struct AppsignalSink<S> {
pub(super) service: S,
pub(super) compression: Compression,
pub(super) transformer: Transformer,
pub(super) batch_settings: BatcherSettings,
}

impl<S> AppsignalSink<S>
Expand All @@ -30,7 +30,7 @@ where
S::Response: DriverResponse + Send + 'static,
S::Error: std::fmt::Debug + Into<crate::Error> + Send,
{
pub(crate) async fn run_inner(self: Box<Self>, input: BoxStream<'_, Event>) -> Result<(), ()> {
pub(super) async fn run_inner(self: Box<Self>, input: BoxStream<'_, Event>) -> Result<(), ()> {
let service = ServiceBuilder::new().service(self.service);

input
Expand Down

0 comments on commit dc85a1d

Please sign in to comment.