Skip to content

Commit

Permalink
rust: some visibility (pub) cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonish committed Jun 13, 2024
1 parent 0758640 commit 76a254e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/agent/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: (C) 2020 Jason Ish <jason@codemonkey.net>
// SPDX-License-Identifier: MIT

pub mod client;
pub mod importer;
pub(crate) mod client;
pub(crate) mod importer;
2 changes: 1 addition & 1 deletion src/cli/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use clap::{CommandFactory, Parser, Subcommand};

use self::users::UsersCommand;

pub mod users;
pub(crate) mod users;

#[derive(Parser, Debug)]
#[command(name = "config", about = "Configuration commands")]
Expand Down
3 changes: 2 additions & 1 deletion src/cli/elastic/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: (C) 2022 Jason Ish <jason@codemonkey.net>
// SPDX-License-Identifier: MIT

pub(crate) mod info;
pub mod main;

pub(crate) mod info;
pub(crate) mod set_field_limit;
41 changes: 20 additions & 21 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
// SPDX-FileCopyrightText: (C) 2020 Jason Ish <jason@codemonkey.net>
// SPDX-License-Identifier: MIT

#[macro_use]
pub mod cli;
pub mod logger;
pub mod server;
pub mod version;

pub mod agent;
pub mod bookmark;
pub(crate) mod cert;
pub mod cli;
pub mod config;
pub(crate) mod datetime;
mod agent;
mod bookmark;
mod cert;
mod config;
mod datetime;
mod elastic;
pub mod eve;
mod eve;
mod eventrepo;
pub(crate) mod file;
pub mod geoip;
pub mod importer;
pub mod packet;
mod file;
mod geoip;
mod importer;
mod packet;
mod path;
pub mod pcap;
pub mod queryparser;
pub mod resource;
mod pcap;
mod queryparser;
mod resource;
mod rules;
pub mod server;
pub mod sqlite;
pub(crate) mod util;
pub mod version;
mod sqlite;
mod util;

#[macro_use]
extern crate lazy_static;
Expand All @@ -38,8 +37,8 @@ extern crate serde_json;

lazy_static! {
/// Environment variable to enable query logging.
pub static ref LOG_QUERIES: bool = std::env::var("EVEBOX_LOG_QUERIES").is_ok();
static ref LOG_QUERIES: bool = std::env::var("EVEBOX_LOG_QUERIES").is_ok();

/// Environment variable to enable logging of query plans.
pub static ref LOG_QUERY_PLAN: bool = std::env::var("EVEBOX_LOG_QUERY_PLAN").is_ok();
static ref LOG_QUERY_PLAN: bool = std::env::var("EVEBOX_LOG_QUERY_PLAN").is_ok();
}
2 changes: 1 addition & 1 deletion src/queryparser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use nom::{
use crate::datetime;

#[derive(Debug, Clone)]
pub struct QueryStringParseError(String);
pub(crate) struct QueryStringParseError(String);

impl std::error::Error for QueryStringParseError {}

Expand Down
4 changes: 1 addition & 3 deletions src/sqlite/importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ use std::sync::Arc;
use tracing::{debug, error};

#[derive(thiserror::Error, Debug)]
pub enum IndexError {
#[error("timestamp parse error")]
TimestampParseError,
pub(crate) enum IndexError {
#[error("event has no timestamp field")]
TimestampMissing,
}
Expand Down

0 comments on commit 76a254e

Please sign in to comment.